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.cjs
CHANGED
|
@@ -145,24 +145,24 @@ function isSpace(ch) {
|
|
|
145
145
|
function parseAttributes(source2) {
|
|
146
146
|
const attrs2 = {};
|
|
147
147
|
let i = 0;
|
|
148
|
-
const
|
|
149
|
-
while (i <
|
|
150
|
-
while (i <
|
|
148
|
+
const n2 = source2.length;
|
|
149
|
+
while (i < n2) {
|
|
150
|
+
while (i < n2 && !isNameChar(source2[i])) {
|
|
151
151
|
i++;
|
|
152
152
|
}
|
|
153
153
|
const nameStart = i;
|
|
154
|
-
while (i <
|
|
154
|
+
while (i < n2 && isNameChar(source2[i])) {
|
|
155
155
|
i++;
|
|
156
156
|
}
|
|
157
157
|
const name = source2.slice(nameStart, i);
|
|
158
|
-
while (i <
|
|
158
|
+
while (i < n2 && isSpace(source2[i])) {
|
|
159
159
|
i++;
|
|
160
160
|
}
|
|
161
161
|
if (!name || source2[i] !== "=") {
|
|
162
162
|
continue;
|
|
163
163
|
}
|
|
164
164
|
i++;
|
|
165
|
-
while (i <
|
|
165
|
+
while (i < n2 && isSpace(source2[i])) {
|
|
166
166
|
i++;
|
|
167
167
|
}
|
|
168
168
|
const quote = source2[i];
|
|
@@ -1206,12 +1206,12 @@ function cmds(src) {
|
|
|
1206
1206
|
let i = 0;
|
|
1207
1207
|
while (i < tokens.length) {
|
|
1208
1208
|
const op = tokens[i++];
|
|
1209
|
-
const
|
|
1210
|
-
if (
|
|
1209
|
+
const n2 = ARITY[op];
|
|
1210
|
+
if (n2 === void 0) {
|
|
1211
1211
|
throw new Error(`Unknown path op ${op}`);
|
|
1212
1212
|
}
|
|
1213
|
-
const a = tokens.slice(i, i +
|
|
1214
|
-
i +=
|
|
1213
|
+
const a = tokens.slice(i, i + n2);
|
|
1214
|
+
i += n2;
|
|
1215
1215
|
switch (op) {
|
|
1216
1216
|
case "M":
|
|
1217
1217
|
out.push({ kind: "moveTo", x: a[0], y: a[1] });
|
|
@@ -1324,84 +1324,22 @@ var triangle = (g2, dir) => g2.poly([
|
|
|
1324
1324
|
[D * dir, 0],
|
|
1325
1325
|
[-D * dir, D]
|
|
1326
1326
|
]);
|
|
1327
|
-
var
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
[
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
[-8.5, -13.5],
|
|
1344
|
-
[-9.3, -17.2],
|
|
1345
|
-
[-7.8, -19.5],
|
|
1346
|
-
[-4, -22.5],
|
|
1347
|
-
[-3.3, -21.7],
|
|
1348
|
-
[-1.8, -21.7],
|
|
1349
|
-
[-1, -23.2],
|
|
1350
|
-
[0.5, -23.2],
|
|
1351
|
-
[1.2, -21.7],
|
|
1352
|
-
[2.7, -21.7],
|
|
1353
|
-
[3.5, -22.5],
|
|
1354
|
-
[8, -18.7],
|
|
1355
|
-
[8.7, -17.2],
|
|
1356
|
-
[8, -16.5],
|
|
1357
|
-
[8, -15],
|
|
1358
|
-
[9.5, -14.2],
|
|
1359
|
-
[9.5, -13.5],
|
|
1360
|
-
[8, -12.7],
|
|
1361
|
-
[8.7, -9.7],
|
|
1362
|
-
[5, -6],
|
|
1363
|
-
[2, -6],
|
|
1364
|
-
[-2.5, -2.2],
|
|
1365
|
-
[-3.3, 0.8],
|
|
1366
|
-
[-5.5, 2.3],
|
|
1367
|
-
[-4.8, 6.8],
|
|
1368
|
-
[-6.3, 7.5],
|
|
1369
|
-
[-6.3, 18],
|
|
1370
|
-
[-4.8, 18],
|
|
1371
|
-
[-4, 17.3],
|
|
1372
|
-
[4.2, 17.3],
|
|
1373
|
-
[4.2, 6.8],
|
|
1374
|
-
[6.5, 5.3],
|
|
1375
|
-
[6.5, 3.8],
|
|
1376
|
-
[8, 3],
|
|
1377
|
-
[8, 1.5],
|
|
1378
|
-
[8.7, 0.8],
|
|
1379
|
-
[13.2, 0],
|
|
1380
|
-
[17, -4.5],
|
|
1381
|
-
[18.5, -4.5],
|
|
1382
|
-
[18.5, -6],
|
|
1383
|
-
[17.7, -6.7],
|
|
1384
|
-
[18.5, -8.2],
|
|
1385
|
-
[18.5, -15],
|
|
1386
|
-
[20, -15.7],
|
|
1387
|
-
[20, -18],
|
|
1388
|
-
[17.7, -19.5],
|
|
1389
|
-
[17.7, -21],
|
|
1390
|
-
[15.5, -24.7],
|
|
1391
|
-
[15.5, -27],
|
|
1392
|
-
[14, -27],
|
|
1393
|
-
[13.2, -27.7],
|
|
1394
|
-
[13.2, -29.2],
|
|
1395
|
-
[9.5, -30],
|
|
1396
|
-
[8.7, -30.7],
|
|
1397
|
-
[8.7, -32.2],
|
|
1398
|
-
[5.7, -31.5],
|
|
1399
|
-
[4.2, -33.7],
|
|
1400
|
-
[2.7, -33.7],
|
|
1401
|
-
[2, -32.2],
|
|
1402
|
-
[-2.5, -32.2],
|
|
1403
|
-
[-3.3, -33.7]
|
|
1404
|
-
];
|
|
1327
|
+
var U = 90;
|
|
1328
|
+
var question = (g2) => {
|
|
1329
|
+
const x = (v) => g2.x(v * U);
|
|
1330
|
+
const y = (v) => g2.y(v * U);
|
|
1331
|
+
const r = (v) => g2.len(v * U);
|
|
1332
|
+
return [
|
|
1333
|
+
`M ${x(-0.214)} ${y(-0.162)} A ${r(0.214)} ${r(0.2125)} 10800000 10800000`,
|
|
1334
|
+
`A ${r(0.108)} ${r(0.162)} 0 5400000`,
|
|
1335
|
+
`A ${r(0.053)} ${r(0.085)} 16200000 -5400000`,
|
|
1336
|
+
`L ${x(0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.08)}`,
|
|
1337
|
+
`A ${r(0.108)} ${r(0.16)} 10800000 5400000`,
|
|
1338
|
+
`A ${r(0.052)} ${r(0.082)} 5400000 -5400000`,
|
|
1339
|
+
`A ${r(0.107)} ${r(0.1065)} 0 -10800000`,
|
|
1340
|
+
`L ${x(-0.214)} ${y(-0.162)} Z`
|
|
1341
|
+
].join(" ");
|
|
1342
|
+
};
|
|
1405
1343
|
var MOVIE = [
|
|
1406
1344
|
[-33.75, -16.5],
|
|
1407
1345
|
[-33.75, -3],
|
|
@@ -1508,8 +1446,8 @@ var buttons = {
|
|
|
1508
1446
|
)
|
|
1509
1447
|
]),
|
|
1510
1448
|
actionButtonHelp: build("actionButtonHelp", (g2) => [
|
|
1511
|
-
darken(g2
|
|
1512
|
-
darken(g2.circle(
|
|
1449
|
+
darken(question(g2)),
|
|
1450
|
+
darken(g2.circle(0, 0.295 * U, 0.08 * U))
|
|
1513
1451
|
]),
|
|
1514
1452
|
actionButtonInformation: build("actionButtonInformation", (g2) => [
|
|
1515
1453
|
darken(g2.circle(0, 0.4, 34)),
|
|
@@ -4832,12 +4770,46 @@ var leftRightUpArrow2 = exactDef(
|
|
|
4832
4770
|
)
|
|
4833
4771
|
]
|
|
4834
4772
|
);
|
|
4773
|
+
var swooshArrow3 = exactDef(
|
|
4774
|
+
"swooshArrow",
|
|
4775
|
+
{ adj1: 25e3, adj2: 16667 },
|
|
4776
|
+
[
|
|
4777
|
+
"a1 pin 1 adj1 75000",
|
|
4778
|
+
"maxAdj2 */ 70000 w ss",
|
|
4779
|
+
"a2 pin 0 adj2 maxAdj2",
|
|
4780
|
+
"ad1 */ h a1 100000",
|
|
4781
|
+
"ad2 */ ss a2 100000",
|
|
4782
|
+
"xB +- r 0 ad2",
|
|
4783
|
+
"yB +- t ssd8 0",
|
|
4784
|
+
"alfa */ cd4 1 14",
|
|
4785
|
+
"dx0 tan ssd8 alfa",
|
|
4786
|
+
"xC +- xB 0 dx0",
|
|
4787
|
+
"dx1 tan ad1 alfa",
|
|
4788
|
+
"yF +- yB ad1 0",
|
|
4789
|
+
"xF +- xB dx1 0",
|
|
4790
|
+
"xE +- xF dx0 0",
|
|
4791
|
+
"yE +- yF ssd8 0",
|
|
4792
|
+
"dy2 +- yE 0 t",
|
|
4793
|
+
"dy22 */ dy2 1 2",
|
|
4794
|
+
"dy3 */ h 1 20",
|
|
4795
|
+
"yD +- dy22 0 dy3",
|
|
4796
|
+
"dy4 */ hd6 1 1",
|
|
4797
|
+
"yP1 +- hd6 dy4 0",
|
|
4798
|
+
"xP1 val wd6",
|
|
4799
|
+
"dy5 */ hd6 1 2",
|
|
4800
|
+
"yP2 +- yF dy5 0",
|
|
4801
|
+
"xP2 val wd4"
|
|
4802
|
+
],
|
|
4803
|
+
"l t r b",
|
|
4804
|
+
[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")]
|
|
4805
|
+
);
|
|
4835
4806
|
var EXACT_ARROW_PRESET_DEFINITIONS = {
|
|
4836
4807
|
leftRightArrow: leftRightArrow2,
|
|
4837
4808
|
upDownArrow: upDownArrow2,
|
|
4838
4809
|
quadArrow: quadArrow2,
|
|
4839
4810
|
leftUpArrow: leftUpArrow2,
|
|
4840
|
-
leftRightUpArrow: leftRightUpArrow2
|
|
4811
|
+
leftRightUpArrow: leftRightUpArrow2,
|
|
4812
|
+
swooshArrow: swooshArrow3
|
|
4841
4813
|
};
|
|
4842
4814
|
|
|
4843
4815
|
// geometry/preset-shape-definitions-exact-circular.ts
|
|
@@ -4859,32 +4831,32 @@ function onEllipse(name, rw, rh, ang) {
|
|
|
4859
4831
|
`${name}y +- vc ${name}dy 0`
|
|
4860
4832
|
];
|
|
4861
4833
|
}
|
|
4862
|
-
function head(
|
|
4834
|
+
function head(n2, baseAng, tipAng) {
|
|
4863
4835
|
const out = [
|
|
4864
|
-
...onEllipse(`${
|
|
4865
|
-
...onEllipse(`${
|
|
4866
|
-
`${
|
|
4867
|
-
`${
|
|
4868
|
-
`${
|
|
4869
|
-
`${
|
|
4870
|
-
`${
|
|
4871
|
-
`${
|
|
4872
|
-
`${
|
|
4873
|
-
`${
|
|
4874
|
-
`${
|
|
4875
|
-
`${
|
|
4836
|
+
...onEllipse(`${n2}H`, "rw3", "rh3", baseAng),
|
|
4837
|
+
...onEllipse(`${n2}A`, "rw3", "rh3", tipAng),
|
|
4838
|
+
`${n2}Gdx cos thh ${tipAng}`,
|
|
4839
|
+
`${n2}Gdy sin thh ${tipAng}`,
|
|
4840
|
+
`${n2}Gx +- ${n2}Hx ${n2}Gdx 0`,
|
|
4841
|
+
`${n2}Gy +- ${n2}Hy ${n2}Gdy 0`,
|
|
4842
|
+
`${n2}Bx +- ${n2}Hx 0 ${n2}Gdx`,
|
|
4843
|
+
`${n2}By +- ${n2}Hy 0 ${n2}Gdy`,
|
|
4844
|
+
`${n2}sx1 +- ${n2}Bx 0 hc`,
|
|
4845
|
+
`${n2}sy1 +- ${n2}By 0 vc`,
|
|
4846
|
+
`${n2}sx2 +- ${n2}Gx 0 hc`,
|
|
4847
|
+
`${n2}sy2 +- ${n2}Gy 0 vc`
|
|
4876
4848
|
];
|
|
4877
4849
|
for (const [k, rw, rh] of [
|
|
4878
4850
|
["F", "rw1", "rh1"],
|
|
4879
4851
|
["D", "rw2", "rh2"]
|
|
4880
4852
|
]) {
|
|
4881
|
-
const m = `${
|
|
4853
|
+
const m = `${n2}${k}`;
|
|
4882
4854
|
out.push(
|
|
4883
4855
|
`${m}r min ${rw} ${rh}`,
|
|
4884
|
-
`${m}x1 */ ${
|
|
4885
|
-
`${m}y1 */ ${
|
|
4886
|
-
`${m}x2 */ ${
|
|
4887
|
-
`${m}y2 */ ${
|
|
4856
|
+
`${m}x1 */ ${n2}sx1 ${m}r ${rw}`,
|
|
4857
|
+
`${m}y1 */ ${n2}sy1 ${m}r ${rh}`,
|
|
4858
|
+
`${m}x2 */ ${n2}sx2 ${m}r ${rw}`,
|
|
4859
|
+
`${m}y2 */ ${n2}sy2 ${m}r ${rh}`,
|
|
4888
4860
|
`${m}ex +- ${m}x2 0 ${m}x1`,
|
|
4889
4861
|
`${m}ey +- ${m}y2 0 ${m}y1`,
|
|
4890
4862
|
`${m}len mod ${m}ex ${m}ey 0`,
|
|
@@ -4938,7 +4910,7 @@ var BASE = [
|
|
|
4938
4910
|
"tAng at2 rI tq",
|
|
4939
4911
|
"hAng at2 Hdx Hdy"
|
|
4940
4912
|
];
|
|
4941
|
-
var headPath = (
|
|
4913
|
+
var headPath = (n2) => `L ${n2}Gx ${n2}Gy L ${n2}Ax ${n2}Ay L ${n2}Bx ${n2}By L ${n2}DX ${n2}DY`;
|
|
4942
4914
|
var circularArrow3 = exactDef(
|
|
4943
4915
|
"circularArrow",
|
|
4944
4916
|
{ adj1: 12500, adj2: 1142319, adj3: 20457681, adj4: 108e5, adj5: 12500 },
|
|
@@ -5557,19 +5529,19 @@ var EXACT_MISC_PRESET_DEFINITIONS = {
|
|
|
5557
5529
|
};
|
|
5558
5530
|
|
|
5559
5531
|
// geometry/preset-shape-definitions-exact-funnel.ts
|
|
5560
|
-
function newton(m,
|
|
5532
|
+
function newton(m, n2) {
|
|
5561
5533
|
return [
|
|
5562
|
-
`${
|
|
5563
|
-
`${
|
|
5564
|
-
`${
|
|
5565
|
-
`${
|
|
5566
|
-
`${
|
|
5567
|
-
`${
|
|
5568
|
-
`${
|
|
5569
|
-
`${
|
|
5570
|
-
`${
|
|
5571
|
-
`${
|
|
5572
|
-
`${
|
|
5534
|
+
`${n2}b1 */ ${m} b1 1`,
|
|
5535
|
+
`${n2}b2 */ ${m} b2 1`,
|
|
5536
|
+
`${n2}s1 mod a1 ${n2}b1 0`,
|
|
5537
|
+
`${n2}s2 mod a2 ${n2}b2 0`,
|
|
5538
|
+
`${n2}m1 */ ${m} dY 1`,
|
|
5539
|
+
`${n2}f0 +- ${n2}m1 ${n2}s2 ${n2}s1`,
|
|
5540
|
+
`${n2}t1 */ ${n2}b1 b1 ${n2}s1`,
|
|
5541
|
+
`${n2}t2 */ ${n2}b2 b2 ${n2}s2`,
|
|
5542
|
+
`${n2}d0 +- dY ${n2}t2 ${n2}t1`,
|
|
5543
|
+
`${n2}d1 */ ${n2}f0 1 ${n2}d0`,
|
|
5544
|
+
`${n2} +- ${m} 0 ${n2}d1`
|
|
5573
5545
|
];
|
|
5574
5546
|
}
|
|
5575
5547
|
var STEPS = ["mA", "mB", "mC", "mD", "mE", "mF"];
|
|
@@ -5586,7 +5558,7 @@ var funnel = exactDef(
|
|
|
5586
5558
|
"a1m +- a1 0 a2",
|
|
5587
5559
|
"m0 */ a1m 1 dY",
|
|
5588
5560
|
...newton("m0", "mA"),
|
|
5589
|
-
...STEPS.slice(1).flatMap((
|
|
5561
|
+
...STEPS.slice(1).flatMap((n2, i) => newton(STEPS[i], n2)),
|
|
5590
5562
|
"mb1 */ mF b1 1",
|
|
5591
5563
|
"mb2 */ mF b2 1",
|
|
5592
5564
|
"phi1 at2 a1 mb1",
|
|
@@ -5643,10 +5615,13 @@ var verticalScroll = exactDef(
|
|
|
5643
5615
|
p(
|
|
5644
5616
|
"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"
|
|
5645
5617
|
),
|
|
5646
|
-
p(
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5618
|
+
p(
|
|
5619
|
+
"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",
|
|
5620
|
+
{
|
|
5621
|
+
fill: "darkenLess",
|
|
5622
|
+
stroke: false
|
|
5623
|
+
}
|
|
5624
|
+
),
|
|
5650
5625
|
p(
|
|
5651
5626
|
"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",
|
|
5652
5627
|
{ fill: "none" }
|
|
@@ -5662,10 +5637,13 @@ var horizontalScroll = exactDef(
|
|
|
5662
5637
|
p(
|
|
5663
5638
|
"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"
|
|
5664
5639
|
),
|
|
5665
|
-
p(
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5640
|
+
p(
|
|
5641
|
+
"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",
|
|
5642
|
+
{
|
|
5643
|
+
fill: "darkenLess",
|
|
5644
|
+
stroke: false
|
|
5645
|
+
}
|
|
5646
|
+
),
|
|
5669
5647
|
p(
|
|
5670
5648
|
"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",
|
|
5671
5649
|
{ fill: "none" }
|
|
@@ -5721,11 +5699,11 @@ var EXACT_LEFT_RIGHT_RIBBON_PRESET_DEFINITIONS = { leftRightRibbon };
|
|
|
5721
5699
|
|
|
5722
5700
|
// geometry/preset-shape-definitions-exact-ellipse-ribbons.ts
|
|
5723
5701
|
var AV = { adj1: 25e3, adj2: 5e4, adj3: 12500 };
|
|
5724
|
-
function para(
|
|
5725
|
-
return [`${
|
|
5702
|
+
function para(n2, x) {
|
|
5703
|
+
return [`${n2}q */ ${x} ${x} w`, `${n2}r +- ${x} 0 ${n2}q`, `${n2} */ f1 ${n2}r 1`];
|
|
5726
5704
|
}
|
|
5727
5705
|
function build2(name, flip) {
|
|
5728
|
-
const y = (
|
|
5706
|
+
const y = (n2, off) => flip ? `${n2} +- b 0 ${off}` : `${n2} +- t ${off} 0`;
|
|
5729
5707
|
const gd17 = [
|
|
5730
5708
|
"a1 pin 0 adj1 100000",
|
|
5731
5709
|
"a2 pin 25000 adj2 75000",
|
|
@@ -6858,8 +6836,8 @@ function ray(baseX1, baseY1, baseX2, baseY2, apexX, apexY) {
|
|
|
6858
6836
|
]
|
|
6859
6837
|
};
|
|
6860
6838
|
}
|
|
6861
|
-
function starTrigTable(
|
|
6862
|
-
const total =
|
|
6839
|
+
function starTrigTable(n2) {
|
|
6840
|
+
const total = n2 * 2;
|
|
6863
6841
|
const step = Math.PI * 2 / total;
|
|
6864
6842
|
const start = -Math.PI / 2;
|
|
6865
6843
|
const result = [];
|
|
@@ -6872,8 +6850,8 @@ function starTrigTable(n) {
|
|
|
6872
6850
|
}
|
|
6873
6851
|
return result;
|
|
6874
6852
|
}
|
|
6875
|
-
function buildStarN(
|
|
6876
|
-
const trig = starTrigTable(
|
|
6853
|
+
function buildStarN(n2, defaultAdj, hf, vf) {
|
|
6854
|
+
const trig = starTrigTable(n2);
|
|
6877
6855
|
const gdLst = [
|
|
6878
6856
|
gd9("a", `pin 0 adj 50000`),
|
|
6879
6857
|
gd9("swd2", hf === void 0 ? "*/ wd2 1 1" : "*/ wd2 hf 100000"),
|
|
@@ -6898,7 +6876,7 @@ function buildStarN(n, defaultAdj, hf, vf) {
|
|
|
6898
6876
|
}
|
|
6899
6877
|
commands.push({ kind: "close" });
|
|
6900
6878
|
return {
|
|
6901
|
-
name: `star${
|
|
6879
|
+
name: `star${n2}`,
|
|
6902
6880
|
avLst: {
|
|
6903
6881
|
adj: defaultAdj,
|
|
6904
6882
|
...hf === void 0 ? {} : { hf },
|
|
@@ -13559,7 +13537,7 @@ function fontRule(node) {
|
|
|
13559
13537
|
}
|
|
13560
13538
|
function hasFontLength(node) {
|
|
13561
13539
|
return flattenEngineTree(node).some(
|
|
13562
|
-
(
|
|
13540
|
+
(n2) => n2.constraints.some((c) => LENGTHS.has(c.type) && FONT_TYPES.has(c.refType))
|
|
13563
13541
|
);
|
|
13564
13542
|
}
|
|
13565
13543
|
function fontSearchPlan(node) {
|
|
@@ -13591,17 +13569,17 @@ function fits(node, context) {
|
|
|
13591
13569
|
if (!box) {
|
|
13592
13570
|
return true;
|
|
13593
13571
|
}
|
|
13594
|
-
for (const
|
|
13595
|
-
const b =
|
|
13596
|
-
if (!b ||
|
|
13572
|
+
for (const n2 of flattenEngineTree(node)) {
|
|
13573
|
+
const b = n2.box;
|
|
13574
|
+
if (!b || n2.alg.type === "conn" || !(b.w > 0) || !(b.h > 0)) {
|
|
13597
13575
|
continue;
|
|
13598
13576
|
}
|
|
13599
13577
|
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) {
|
|
13600
13578
|
return false;
|
|
13601
13579
|
}
|
|
13602
|
-
const font = layoutFontOf(
|
|
13603
|
-
const text2 = font === void 0 ? void 0 : context.textOf(
|
|
13604
|
-
if (font !== void 0 && text2 && !textFitsAt(
|
|
13580
|
+
const font = layoutFontOf(n2);
|
|
13581
|
+
const text2 = font === void 0 ? void 0 : context.textOf(n2);
|
|
13582
|
+
if (font !== void 0 && text2 && !textFitsAt(n2, text2, font, context.metrics, layoutFontOf)) {
|
|
13605
13583
|
return false;
|
|
13606
13584
|
}
|
|
13607
13585
|
}
|
|
@@ -13609,14 +13587,14 @@ function fits(node, context) {
|
|
|
13609
13587
|
}
|
|
13610
13588
|
function recordGrowth(node) {
|
|
13611
13589
|
const nodes = flattenEngineTree(node);
|
|
13612
|
-
for (const
|
|
13613
|
-
const grown =
|
|
13614
|
-
if (grown !== void 0 && canGrow(
|
|
13615
|
-
|
|
13590
|
+
for (const n2 of nodes) {
|
|
13591
|
+
const grown = n2.box?.h;
|
|
13592
|
+
if (grown !== void 0 && canGrow(n2, "h") && grown > (n2.growFloor?.h ?? -Infinity)) {
|
|
13593
|
+
n2.growFloor = { ...n2.growFloor, h: grown };
|
|
13616
13594
|
}
|
|
13617
13595
|
}
|
|
13618
|
-
for (const
|
|
13619
|
-
for (const group of
|
|
13596
|
+
for (const n2 of nodes) {
|
|
13597
|
+
for (const group of n2.groups) {
|
|
13620
13598
|
if (group.type !== "h" && group.type !== "w") {
|
|
13621
13599
|
continue;
|
|
13622
13600
|
}
|
|
@@ -13633,11 +13611,11 @@ function recordGrowth(node) {
|
|
|
13633
13611
|
}
|
|
13634
13612
|
}
|
|
13635
13613
|
function resetCandidate(node) {
|
|
13636
|
-
for (const
|
|
13637
|
-
|
|
13638
|
-
if (
|
|
13639
|
-
|
|
13640
|
-
|
|
13614
|
+
for (const n2 of flattenEngineTree(node)) {
|
|
13615
|
+
n2.growFloor = void 0;
|
|
13616
|
+
if (n2 !== node) {
|
|
13617
|
+
n2.minValues.clear();
|
|
13618
|
+
n2.maxValues.clear();
|
|
13641
13619
|
}
|
|
13642
13620
|
}
|
|
13643
13621
|
}
|
|
@@ -14405,10 +14383,10 @@ function arrangeCycle(node) {
|
|
|
14405
14383
|
}
|
|
14406
14384
|
const params = node.alg.params;
|
|
14407
14385
|
const hub = params.ctrShpMap === "fNode" ? groups.shift() : void 0;
|
|
14408
|
-
const
|
|
14386
|
+
const n2 = groups.length;
|
|
14409
14387
|
const cx0 = box.x + box.w / 2;
|
|
14410
14388
|
const cy0 = box.y + box.h / 2;
|
|
14411
|
-
if (
|
|
14389
|
+
if (n2 === 0) {
|
|
14412
14390
|
if (hub) {
|
|
14413
14391
|
placeGroup(hub, box.x, box.y, box.w, box.h);
|
|
14414
14392
|
}
|
|
@@ -14421,7 +14399,7 @@ function arrangeCycle(node) {
|
|
|
14421
14399
|
const parsedSpan = Number(params.spanAng);
|
|
14422
14400
|
const spanAng = Number.isFinite(parsedSpan) ? parsedSpan : 360;
|
|
14423
14401
|
const rotPath = params.rotPath === "alongPath";
|
|
14424
|
-
if (
|
|
14402
|
+
if (n2 === 1) {
|
|
14425
14403
|
const w0 = box.w;
|
|
14426
14404
|
const h0 = Math.min(box.h, box.w * heightOverWidth);
|
|
14427
14405
|
placeGroupCentered(groups[0], cx0, cy0, w0, h0);
|
|
@@ -14435,7 +14413,7 @@ function arrangeCycle(node) {
|
|
|
14435
14413
|
return;
|
|
14436
14414
|
}
|
|
14437
14415
|
const full = Math.abs(spanAng) >= 360;
|
|
14438
|
-
const step = full ? spanAng /
|
|
14416
|
+
const step = full ? spanAng / n2 : spanAng / (n2 - 1);
|
|
14439
14417
|
const halfStepRad = Math.abs(step) * DEG_TO_RAD / 2;
|
|
14440
14418
|
const sinHalf = Math.sin(halfStepRad);
|
|
14441
14419
|
const r0 = sinHalf > 1e-6 ? (1 + gap) / (2 * sinHalf) : 0;
|
|
@@ -14974,8 +14952,8 @@ function sanitizeLvlNode(lvlNode) {
|
|
|
14974
14952
|
function arrangePyra(node) {
|
|
14975
14953
|
const box = node.box;
|
|
14976
14954
|
const children2 = contentChildren(node);
|
|
14977
|
-
const
|
|
14978
|
-
if (!box ||
|
|
14955
|
+
const n2 = children2.length;
|
|
14956
|
+
if (!box || n2 === 0) {
|
|
14979
14957
|
return;
|
|
14980
14958
|
}
|
|
14981
14959
|
const lvlNodeName = node.alg.params.pyraLvlNode ?? "level";
|
|
@@ -14987,12 +14965,12 @@ function arrangePyra(node) {
|
|
|
14987
14965
|
}
|
|
14988
14966
|
const inverted = node.alg.params.linDir === "fromT";
|
|
14989
14967
|
const gap = Math.max(0, node.values.get("sibSp") ?? node.values.get("sp") ?? 0);
|
|
14990
|
-
const bandH = Math.max(0, (box.h - gap * (
|
|
14968
|
+
const bandH = Math.max(0, (box.h - gap * (n2 - 1)) / n2);
|
|
14991
14969
|
const bandCx = box.x + box.w / 2;
|
|
14992
14970
|
children2.forEach((child3, i) => {
|
|
14993
14971
|
const top = box.y + i * (bandH + gap);
|
|
14994
|
-
const effectiveI = inverted ?
|
|
14995
|
-
const halfWide = box.w * (effectiveI + 1) /
|
|
14972
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
14973
|
+
const halfWide = box.w * (effectiveI + 1) / n2 / 2;
|
|
14996
14974
|
child3.box = { x: bandCx - halfWide, y: top, w: halfWide * 2, h: bandH };
|
|
14997
14975
|
});
|
|
14998
14976
|
}
|
|
@@ -15010,7 +14988,7 @@ function applyPyraAccentSplit(node) {
|
|
|
15010
14988
|
const txName = node.alg.params.pyraAcctTxNode ?? "acctTx";
|
|
15011
14989
|
const inverted = node.alg.params.linDir === "fromT";
|
|
15012
14990
|
const items = contentChildren(node);
|
|
15013
|
-
const
|
|
14991
|
+
const n2 = items.length;
|
|
15014
14992
|
const bandCx = box.x + box.w / 2;
|
|
15015
14993
|
items.forEach((item2, i) => {
|
|
15016
14994
|
const itemBox = item2.box;
|
|
@@ -15038,8 +15016,8 @@ function applyPyraAccentSplit(node) {
|
|
|
15038
15016
|
h: descendant.box.h
|
|
15039
15017
|
};
|
|
15040
15018
|
}
|
|
15041
|
-
const effectiveI = inverted ?
|
|
15042
|
-
const halfNarrow = box.w * effectiveI /
|
|
15019
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
15020
|
+
const halfNarrow = box.w * effectiveI / n2 / 2;
|
|
15043
15021
|
const accentLeft = scaleFromAnchor(bandCx + halfNarrow, box.x, scale);
|
|
15044
15022
|
const accentRight = box.x + box.w;
|
|
15045
15023
|
for (const root of accentRoots) {
|
|
@@ -15109,8 +15087,8 @@ function measure2(node, box, cells, spacer, row) {
|
|
|
15109
15087
|
);
|
|
15110
15088
|
return { cellW, cellH, along, across, cols };
|
|
15111
15089
|
}
|
|
15112
|
-
function fits2(fit,
|
|
15113
|
-
const lines = Math.ceil(
|
|
15090
|
+
function fits2(fit, n2, box, row) {
|
|
15091
|
+
const lines = Math.ceil(n2 / fit.cols);
|
|
15114
15092
|
const lineLen = fit.cols * (row ? fit.cellW : fit.cellH) + (fit.cols - 1) * fit.along;
|
|
15115
15093
|
const across = lines * (row ? fit.cellH : fit.cellW) + (lines - 1) * fit.across;
|
|
15116
15094
|
return row ? lineLen <= box.w + 1e-6 && across <= box.h + 1e-6 : lineLen <= box.h + 1e-6 && across <= box.w + 1e-6;
|
|
@@ -15190,19 +15168,19 @@ function gridSize(dims, m, row) {
|
|
|
15190
15168
|
const acrossLen = lines * (row ? m.cellH : m.cellW) + (lines - 1) * m.across;
|
|
15191
15169
|
return row ? { w: alongLen, h: acrossLen } : { w: acrossLen, h: alongLen };
|
|
15192
15170
|
}
|
|
15193
|
-
function dimsFor(lineLen,
|
|
15194
|
-
const lines = Math.max(1, Math.ceil(
|
|
15171
|
+
function dimsFor(lineLen, n2, row) {
|
|
15172
|
+
const lines = Math.max(1, Math.ceil(n2 / lineLen));
|
|
15195
15173
|
return row ? { cols: lineLen, rows: lines } : { cols: lines, rows: lineLen };
|
|
15196
15174
|
}
|
|
15197
|
-
function chooseDims(node,
|
|
15175
|
+
function chooseDims(node, n2, m, box, row) {
|
|
15198
15176
|
const fixed = node.values.get("bkPtFixedVal") ?? Number(node.alg.params.bkPtFixedVal);
|
|
15199
15177
|
if (node.alg.params.bkpt === "fixed" && Number.isFinite(fixed) && fixed > 0) {
|
|
15200
|
-
return dimsFor(Math.min(
|
|
15178
|
+
return dimsFor(Math.min(n2, Math.round(fixed)), n2, row);
|
|
15201
15179
|
}
|
|
15202
|
-
let best = dimsFor(
|
|
15180
|
+
let best = dimsFor(n2, n2, row);
|
|
15203
15181
|
let bestScale = -Infinity;
|
|
15204
|
-
for (let lineLen =
|
|
15205
|
-
const dims = dimsFor(lineLen,
|
|
15182
|
+
for (let lineLen = n2; lineLen >= 1; lineLen--) {
|
|
15183
|
+
const dims = dimsFor(lineLen, n2, row);
|
|
15206
15184
|
const size = gridSize(dims, m, row);
|
|
15207
15185
|
const scale = Math.min(box.w / Math.max(1e-9, size.w), box.h / Math.max(1e-9, size.h));
|
|
15208
15186
|
if (scale > bestScale + 1e-9) {
|
|
@@ -15212,7 +15190,7 @@ function chooseDims(node, n, m, box, row) {
|
|
|
15212
15190
|
}
|
|
15213
15191
|
if (node.alg.params.bkpt === "bal") {
|
|
15214
15192
|
const lines = row ? best.rows : best.cols;
|
|
15215
|
-
return dimsFor(Math.ceil(
|
|
15193
|
+
return dimsFor(Math.ceil(n2 / lines), n2, row);
|
|
15216
15194
|
}
|
|
15217
15195
|
return best;
|
|
15218
15196
|
}
|
|
@@ -15239,8 +15217,8 @@ function arrangeSnake(node) {
|
|
|
15239
15217
|
if (!(m.cellW > 0) || !(m.cellH > 0)) {
|
|
15240
15218
|
return;
|
|
15241
15219
|
}
|
|
15242
|
-
const
|
|
15243
|
-
const dims = ruled ? dimsFor(ruled.cols,
|
|
15220
|
+
const n2 = cells.length;
|
|
15221
|
+
const dims = ruled ? dimsFor(ruled.cols, n2, row) : chooseDims(node, n2, m, box, row);
|
|
15244
15222
|
const size = gridSize(dims, m, row);
|
|
15245
15223
|
const scale = Math.min(1, box.w / size.w, box.h / size.h);
|
|
15246
15224
|
const cw = m.cellW * scale;
|
|
@@ -15256,7 +15234,7 @@ function arrangeSnake(node) {
|
|
|
15256
15234
|
const reverseAlternate = params.contDir === "revDir";
|
|
15257
15235
|
cells.forEach((cell, i) => {
|
|
15258
15236
|
const line2 = Math.floor(i / lineLen);
|
|
15259
|
-
const inLine = Math.min(lineLen,
|
|
15237
|
+
const inLine = Math.min(lineLen, n2 - line2 * lineLen);
|
|
15260
15238
|
const reversedLine = reverseAlternate && line2 % 2 === 1;
|
|
15261
15239
|
const pos = reversedLine ? lineLen - 1 - i % lineLen : i % lineLen;
|
|
15262
15240
|
const centre = params.off === "ctr" ? (lineLen - inLine) / 2 : 0;
|
|
@@ -15556,9 +15534,9 @@ function allNodes(entries) {
|
|
|
15556
15534
|
roots.add(top);
|
|
15557
15535
|
}
|
|
15558
15536
|
const out = [];
|
|
15559
|
-
const visit = (
|
|
15560
|
-
out.push(
|
|
15561
|
-
|
|
15537
|
+
const visit = (n2) => {
|
|
15538
|
+
out.push(n2);
|
|
15539
|
+
n2.children.forEach(visit);
|
|
15562
15540
|
};
|
|
15563
15541
|
roots.forEach(visit);
|
|
15564
15542
|
return out;
|
|
@@ -15827,7 +15805,7 @@ function isRenderable(node, presented, literalText) {
|
|
|
15827
15805
|
if (literalText && literalText.trim().length > 0) {
|
|
15828
15806
|
return true;
|
|
15829
15807
|
}
|
|
15830
|
-
return presented.some((
|
|
15808
|
+
return presented.some((n2) => (n2?.text ?? "").trim().length > 0);
|
|
15831
15809
|
}
|
|
15832
15810
|
|
|
15833
15811
|
// diagram/engine/engine-to-result.ts
|
|
@@ -15948,7 +15926,7 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
|
|
|
15948
15926
|
if (!rawXmlText || !(widthPt > 0) || !(heightPt > 0)) {
|
|
15949
15927
|
return void 0;
|
|
15950
15928
|
}
|
|
15951
|
-
const nodeById = new Map(nodes.map((
|
|
15929
|
+
const nodeById = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
15952
15930
|
const metrics = textMetricsFor(resolveFontTable(smartArtData.themeMinorFont));
|
|
15953
15931
|
const context = {
|
|
15954
15932
|
textOf: (node) => nodeTextFor(node, sourceIdsOf(node), transitionLabelOf(node), nodeById),
|
|
@@ -16491,11 +16469,11 @@ function navigateAxisHop(current, axis, nodes, childrenOf, parentOf, roots) {
|
|
|
16491
16469
|
}
|
|
16492
16470
|
const excluded = new Set(
|
|
16493
16471
|
(axis === "follow" ? descendantsOf(node, childrenOf) : ancestorsOf(node, parentOf)).map(
|
|
16494
|
-
(
|
|
16472
|
+
(n2) => n2.id
|
|
16495
16473
|
)
|
|
16496
16474
|
);
|
|
16497
16475
|
const range = axis === "follow" ? nodes.slice(docIndex + 1) : nodes.slice(0, docIndex);
|
|
16498
|
-
addAll(range.filter((
|
|
16476
|
+
addAll(range.filter((n2) => !excluded.has(n2.id)));
|
|
16499
16477
|
break;
|
|
16500
16478
|
}
|
|
16501
16479
|
case "root": {
|
|
@@ -16527,7 +16505,7 @@ function selectRange(nodes, start, count) {
|
|
|
16527
16505
|
return nodes.slice(zeroBasedStart, zeroBasedStart + take);
|
|
16528
16506
|
}
|
|
16529
16507
|
function applyPointTypeAndRange(nodes, pointType2, start, count) {
|
|
16530
|
-
const filtered = pointType2 ? nodes.filter((
|
|
16508
|
+
const filtered = pointType2 ? nodes.filter((n2) => pointTypeMatches(n2, pointType2)) : nodes;
|
|
16531
16509
|
return selectRange(filtered, start, count);
|
|
16532
16510
|
}
|
|
16533
16511
|
function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
|
|
@@ -16541,7 +16519,7 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
|
|
|
16541
16519
|
if (axis[0] === "root" && axis.length > 1 && axis[1] !== "ch") {
|
|
16542
16520
|
return void 0;
|
|
16543
16521
|
}
|
|
16544
|
-
const byId = new Map(nodes.map((
|
|
16522
|
+
const byId = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
16545
16523
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
16546
16524
|
const parentOf = /* @__PURE__ */ new Map();
|
|
16547
16525
|
for (const node of nodes) {
|
|
@@ -16556,7 +16534,7 @@ function resolveAxisNodes(nodes, axis, pointTypes, start, count, context) {
|
|
|
16556
16534
|
}
|
|
16557
16535
|
}
|
|
16558
16536
|
}
|
|
16559
|
-
const roots = nodes.filter((
|
|
16537
|
+
const roots = nodes.filter((n2) => !n2.parentId || !byId.has(n2.parentId));
|
|
16560
16538
|
let current;
|
|
16561
16539
|
let nextHop;
|
|
16562
16540
|
if (axis[0] === "root" && axis.length > 1) {
|
|
@@ -16613,7 +16591,7 @@ function resolveAxisMaxDepth(nodes, axis, pointTypes, start, count, anchor) {
|
|
|
16613
16591
|
if (anchor.length === 0) {
|
|
16614
16592
|
return void 0;
|
|
16615
16593
|
}
|
|
16616
|
-
const byId = new Map(nodes.map((
|
|
16594
|
+
const byId = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
16617
16595
|
let max = 0;
|
|
16618
16596
|
for (const anchorPoint of anchor) {
|
|
16619
16597
|
const resolved = resolveAxisNodes(nodes, axis, pointTypes, start, count, [anchorPoint]);
|
|
@@ -17794,14 +17772,14 @@ function selectArrangedNodes(node, flat, roots) {
|
|
|
17794
17772
|
// diagram/layout/smartart-tree.ts
|
|
17795
17773
|
function buildForest(nodes) {
|
|
17796
17774
|
const map = /* @__PURE__ */ new Map();
|
|
17797
|
-
for (const
|
|
17798
|
-
map.set(
|
|
17775
|
+
for (const n2 of nodes) {
|
|
17776
|
+
map.set(n2.id, { node: n2, children: [] });
|
|
17799
17777
|
}
|
|
17800
17778
|
const roots = [];
|
|
17801
|
-
for (const
|
|
17802
|
-
const tn = map.get(
|
|
17803
|
-
if (
|
|
17804
|
-
map.get(
|
|
17779
|
+
for (const n2 of nodes) {
|
|
17780
|
+
const tn = map.get(n2.id);
|
|
17781
|
+
if (n2.parentId && map.has(n2.parentId)) {
|
|
17782
|
+
map.get(n2.parentId).children.push(tn);
|
|
17805
17783
|
} else {
|
|
17806
17784
|
roots.push(tn);
|
|
17807
17785
|
}
|
|
@@ -17809,16 +17787,16 @@ function buildForest(nodes) {
|
|
|
17809
17787
|
return roots;
|
|
17810
17788
|
}
|
|
17811
17789
|
function buildTree(nodes) {
|
|
17812
|
-
const hasNestedChildren = nodes.some((
|
|
17790
|
+
const hasNestedChildren = nodes.some((n2) => n2.children !== void 0 && n2.children.length > 0);
|
|
17813
17791
|
if (!hasNestedChildren) {
|
|
17814
17792
|
return buildForest(nodes);
|
|
17815
17793
|
}
|
|
17816
|
-
const toTreeNode = (
|
|
17817
|
-
node:
|
|
17818
|
-
children: (
|
|
17794
|
+
const toTreeNode = (n2) => ({
|
|
17795
|
+
node: n2,
|
|
17796
|
+
children: (n2.children ?? []).map(toTreeNode)
|
|
17819
17797
|
});
|
|
17820
|
-
const allIds = new Set(nodes.map((
|
|
17821
|
-
const roots = nodes.filter((
|
|
17798
|
+
const allIds = new Set(nodes.map((n2) => n2.id));
|
|
17799
|
+
const roots = nodes.filter((n2) => !n2.parentId || !allIds.has(n2.parentId));
|
|
17822
17800
|
return roots.map(toTreeNode);
|
|
17823
17801
|
}
|
|
17824
17802
|
var MAX_TREE_DEPTH = 256;
|
|
@@ -18479,10 +18457,10 @@ function buildCycleHubBox(hubNode, ring, totalNodeCount, inputs, hubFontFit) {
|
|
|
18479
18457
|
}
|
|
18480
18458
|
|
|
18481
18459
|
// diagram/layout/smartart-layout-interpreter-cycle-connectors.ts
|
|
18482
|
-
function buildCycleRingConnectors(ring,
|
|
18460
|
+
function buildCycleRingConnectors(ring, n2, connectorCount, ringCentre, elementId) {
|
|
18483
18461
|
return Array.from({ length: connectorCount }, (_, i) => {
|
|
18484
18462
|
const from = ring.centers[i];
|
|
18485
|
-
const to = ring.centers[(i + 1) %
|
|
18463
|
+
const to = ring.centers[(i + 1) % n2];
|
|
18486
18464
|
const midX = (from.x + to.x) / 2;
|
|
18487
18465
|
const midY = (from.y + to.y) / 2;
|
|
18488
18466
|
const pullRadius = Math.max(ring.nodeWidth, ring.nodeHeight) / 2;
|
|
@@ -19037,9 +19015,9 @@ function resolveRingAxisOffset(dimension, boundSize, scale, values) {
|
|
|
19037
19015
|
|
|
19038
19016
|
// diagram/layout/smartart-layout-interpreter-cycle-ring.ts
|
|
19039
19017
|
var DEG_TO_RAD4 = Math.PI / 180;
|
|
19040
|
-
function degenerateRingLayout(
|
|
19018
|
+
function degenerateRingLayout(n2, heightOverWidth, box) {
|
|
19041
19019
|
const boxCentre = { x: box.width / 2, y: box.height / 2 };
|
|
19042
|
-
if (
|
|
19020
|
+
if (n2 <= 0) {
|
|
19043
19021
|
return {
|
|
19044
19022
|
centers: [],
|
|
19045
19023
|
nodeWidth: 0,
|
|
@@ -19049,7 +19027,7 @@ function degenerateRingLayout(n, heightOverWidth, box) {
|
|
|
19049
19027
|
hubHalfHeight: 0
|
|
19050
19028
|
};
|
|
19051
19029
|
}
|
|
19052
|
-
if (
|
|
19030
|
+
if (n2 === 1) {
|
|
19053
19031
|
const w0 = box.width;
|
|
19054
19032
|
const h0 = Math.min(box.height, box.width * Math.max(0.01, heightOverWidth));
|
|
19055
19033
|
return {
|
|
@@ -19063,8 +19041,8 @@ function degenerateRingLayout(n, heightOverWidth, box) {
|
|
|
19063
19041
|
}
|
|
19064
19042
|
return void 0;
|
|
19065
19043
|
}
|
|
19066
|
-
function ringLayoutForGapFactor(
|
|
19067
|
-
if (
|
|
19044
|
+
function ringLayoutForGapFactor(n2, stAngDeg, spanDeg, gapFactor, heightOverWidth, box, hubGeometry, sibTransBulgeRatio, knownNodeWidthPx) {
|
|
19045
|
+
if (n2 === 1 && hubGeometry && knownNodeWidthPx !== void 0 && knownNodeWidthPx > 0) {
|
|
19068
19046
|
return nestedHubSatelliteRingLayout(
|
|
19069
19047
|
stAngDeg,
|
|
19070
19048
|
heightOverWidth,
|
|
@@ -19073,12 +19051,12 @@ function ringLayoutForGapFactor(n, stAngDeg, spanDeg, gapFactor, heightOverWidth
|
|
|
19073
19051
|
knownNodeWidthPx
|
|
19074
19052
|
);
|
|
19075
19053
|
}
|
|
19076
|
-
const degenerate = degenerateRingLayout(
|
|
19054
|
+
const degenerate = degenerateRingLayout(n2, heightOverWidth, box);
|
|
19077
19055
|
if (degenerate) {
|
|
19078
19056
|
return degenerate;
|
|
19079
19057
|
}
|
|
19080
19058
|
const full = Math.abs(spanDeg) >= 360;
|
|
19081
|
-
const step = full ? spanDeg /
|
|
19059
|
+
const step = full ? spanDeg / n2 : spanDeg / (n2 - 1);
|
|
19082
19060
|
const halfStepRad = Math.abs(step) * DEG_TO_RAD4 / 2;
|
|
19083
19061
|
const clampedGap = Math.max(0, gapFactor);
|
|
19084
19062
|
const sinHalf = Math.sin(halfStepRad);
|
|
@@ -19088,7 +19066,7 @@ function ringLayoutForGapFactor(n, stAngDeg, spanDeg, gapFactor, heightOverWidth
|
|
|
19088
19066
|
const r0Hub = hubHalfWidth + hubGeometry.gapRatio + 0.5;
|
|
19089
19067
|
r0 = Math.max(r0, r0Hub);
|
|
19090
19068
|
}
|
|
19091
|
-
const natural = Array.from({ length:
|
|
19069
|
+
const natural = Array.from({ length: n2 }, (_, i) => {
|
|
19092
19070
|
const angleRad = (stAngDeg + i * step - 90) * DEG_TO_RAD4;
|
|
19093
19071
|
return { x: r0 * Math.cos(angleRad), y: r0 * Math.sin(angleRad) };
|
|
19094
19072
|
});
|
|
@@ -19117,10 +19095,10 @@ function ringLayoutForGapFactor(n, stAngDeg, spanDeg, gapFactor, heightOverWidth
|
|
|
19117
19095
|
hubHalfHeight: naturalHubRadius * scaleY
|
|
19118
19096
|
};
|
|
19119
19097
|
}
|
|
19120
|
-
function computeCycleRingLayout(
|
|
19121
|
-
const nestedHubSatellite =
|
|
19098
|
+
function computeCycleRingLayout(n2, stAngDeg, spanDeg, minGapRatio, heightOverWidth, box, absoluteGapPx, hubGeometry, absoluteHubGapPx, sibTransBulgeRatio, knownNodeWidthPx) {
|
|
19099
|
+
const nestedHubSatellite = n2 === 1 && hubGeometry && knownNodeWidthPx !== void 0 && knownNodeWidthPx > 0;
|
|
19122
19100
|
if (!nestedHubSatellite) {
|
|
19123
|
-
const degenerate = degenerateRingLayout(
|
|
19101
|
+
const degenerate = degenerateRingLayout(n2, heightOverWidth, box);
|
|
19124
19102
|
if (degenerate) {
|
|
19125
19103
|
return degenerate;
|
|
19126
19104
|
}
|
|
@@ -19129,7 +19107,7 @@ function computeCycleRingLayout(n, stAngDeg, spanDeg, minGapRatio, heightOverWid
|
|
|
19129
19107
|
const needsHubGapIteration = absoluteHubGapPx !== void 0 && absoluteHubGapPx > 0 && hubGeometry !== void 0;
|
|
19130
19108
|
if (!needsGapIteration && !needsHubGapIteration) {
|
|
19131
19109
|
return ringLayoutForGapFactor(
|
|
19132
|
-
|
|
19110
|
+
n2,
|
|
19133
19111
|
stAngDeg,
|
|
19134
19112
|
spanDeg,
|
|
19135
19113
|
minGapRatio,
|
|
@@ -19144,7 +19122,7 @@ function computeCycleRingLayout(n, stAngDeg, spanDeg, minGapRatio, heightOverWid
|
|
|
19144
19122
|
let hub = hubGeometry;
|
|
19145
19123
|
for (let iteration = 0; iteration < 20; iteration += 1) {
|
|
19146
19124
|
const candidate = ringLayoutForGapFactor(
|
|
19147
|
-
|
|
19125
|
+
n2,
|
|
19148
19126
|
stAngDeg,
|
|
19149
19127
|
spanDeg,
|
|
19150
19128
|
gapFactor,
|
|
@@ -19166,7 +19144,7 @@ function computeCycleRingLayout(n, stAngDeg, spanDeg, minGapRatio, heightOverWid
|
|
|
19166
19144
|
}
|
|
19167
19145
|
}
|
|
19168
19146
|
return ringLayoutForGapFactor(
|
|
19169
|
-
|
|
19147
|
+
n2,
|
|
19170
19148
|
stAngDeg,
|
|
19171
19149
|
spanDeg,
|
|
19172
19150
|
gapFactor,
|
|
@@ -19206,11 +19184,11 @@ function arrangeCycle2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
19206
19184
|
box,
|
|
19207
19185
|
sizeBox
|
|
19208
19186
|
);
|
|
19209
|
-
const
|
|
19187
|
+
const n2 = ringNodes.length;
|
|
19210
19188
|
const startDeg = numericParam(plan.node, "stAng", 0);
|
|
19211
19189
|
const spanDeg = numericParam(plan.node, "spanAng", 360);
|
|
19212
19190
|
const ring = computeCycleRingLayout(
|
|
19213
|
-
|
|
19191
|
+
n2,
|
|
19214
19192
|
startDeg,
|
|
19215
19193
|
spanDeg,
|
|
19216
19194
|
minGapRatio,
|
|
@@ -19223,12 +19201,12 @@ function arrangeCycle2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
19223
19201
|
knownNodeWidthPx
|
|
19224
19202
|
);
|
|
19225
19203
|
const full = Math.abs(spanDeg) >= 360;
|
|
19226
|
-
const connectorCount =
|
|
19227
|
-
const ringStepDeg =
|
|
19204
|
+
const connectorCount = n2 > 0 ? full ? n2 : Math.max(0, n2 - 1) : 0;
|
|
19205
|
+
const ringStepDeg = n2 > 0 ? full ? spanDeg / n2 : spanDeg / Math.max(1, n2 - 1) : 0;
|
|
19228
19206
|
const ringCentre = ring.hubCenter;
|
|
19229
19207
|
const connectors2 = buildCycleRingConnectors(
|
|
19230
19208
|
ring,
|
|
19231
|
-
|
|
19209
|
+
n2,
|
|
19232
19210
|
connectorCount,
|
|
19233
19211
|
ringCentre,
|
|
19234
19212
|
elementId
|
|
@@ -19406,12 +19384,12 @@ function buildHubRenderedNode(arranger, hubNode, box, palette, style, elementId,
|
|
|
19406
19384
|
|
|
19407
19385
|
// diagram/layout/smartart-node-tree-axis.ts
|
|
19408
19386
|
function topLevelSmartArtNodes(nodes) {
|
|
19409
|
-
const hasNestedChildren = nodes.some((
|
|
19387
|
+
const hasNestedChildren = nodes.some((n2) => n2.children !== void 0 && n2.children.length > 0);
|
|
19410
19388
|
if (hasNestedChildren) {
|
|
19411
19389
|
return nodes;
|
|
19412
19390
|
}
|
|
19413
|
-
const ids = new Set(nodes.map((
|
|
19414
|
-
return nodes.filter((
|
|
19391
|
+
const ids = new Set(nodes.map((n2) => n2.id));
|
|
19392
|
+
return nodes.filter((n2) => !n2.parentId || !ids.has(n2.parentId));
|
|
19415
19393
|
}
|
|
19416
19394
|
function smartArtDescendantsWithText(node, childrenOf) {
|
|
19417
19395
|
const out = [];
|
|
@@ -19434,15 +19412,15 @@ function smartArtDescendantsWithText(node, childrenOf) {
|
|
|
19434
19412
|
}
|
|
19435
19413
|
function smartArtChildrenOf(nodes, connections) {
|
|
19436
19414
|
const map = /* @__PURE__ */ new Map();
|
|
19437
|
-
for (const
|
|
19438
|
-
if (
|
|
19439
|
-
map.set(
|
|
19440
|
-
} else if (
|
|
19441
|
-
const list2 = map.get(
|
|
19415
|
+
for (const n2 of nodes) {
|
|
19416
|
+
if (n2.children && n2.children.length > 0) {
|
|
19417
|
+
map.set(n2.id, n2.children);
|
|
19418
|
+
} else if (n2.parentId) {
|
|
19419
|
+
const list2 = map.get(n2.parentId);
|
|
19442
19420
|
if (list2) {
|
|
19443
|
-
list2.push(
|
|
19421
|
+
list2.push(n2);
|
|
19444
19422
|
} else {
|
|
19445
|
-
map.set(
|
|
19423
|
+
map.set(n2.parentId, [n2]);
|
|
19446
19424
|
}
|
|
19447
19425
|
}
|
|
19448
19426
|
}
|
|
@@ -19566,7 +19544,7 @@ function applyCustomLayoutToNode(node, custom, box) {
|
|
|
19566
19544
|
}
|
|
19567
19545
|
}
|
|
19568
19546
|
function applyCustomLayoutOverrides(result, nodes, box) {
|
|
19569
|
-
const nodeById = new Map(nodes.map((
|
|
19547
|
+
const nodeById = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
19570
19548
|
let changed = false;
|
|
19571
19549
|
const nodesOut = result.nodes.map((rendered) => {
|
|
19572
19550
|
const node = rendered.nodeId ? nodeById.get(rendered.nodeId) : void 0;
|
|
@@ -19750,8 +19728,8 @@ function resolveContentSizedExtents(texts, crossExtentPx, fontSizePx, table, lin
|
|
|
19750
19728
|
lines * fontSizePx * smartArtLineEm(table) * lineSpacingFactor + marginVerticalPx + 2 * cornerInsetPx
|
|
19751
19729
|
);
|
|
19752
19730
|
});
|
|
19753
|
-
const
|
|
19754
|
-
const gapTotal = Math.max(0,
|
|
19731
|
+
const n2 = natural.length;
|
|
19732
|
+
const gapTotal = Math.max(0, n2 - 1) * gap;
|
|
19755
19733
|
const total = natural.reduce((sum, extent) => sum + extent, 0) + gapTotal;
|
|
19756
19734
|
if (total <= usableMain || total - gapTotal <= 0) {
|
|
19757
19735
|
return natural;
|
|
@@ -20029,24 +20007,24 @@ function resolveMainAxisGap(index, role, mainAxisType, ceilingPx) {
|
|
|
20029
20007
|
}
|
|
20030
20008
|
return void 0;
|
|
20031
20009
|
}
|
|
20032
|
-
function resolveMainAxisLayout(constraints, index, role, mainAxisType, ceilingPx, usableMain, begPad, endPad,
|
|
20010
|
+
function resolveMainAxisLayout(constraints, index, role, mainAxisType, ceilingPx, usableMain, begPad, endPad, n2, clampRatio) {
|
|
20033
20011
|
const explicitSib = resolveRatioConstraint(constraints, index, role, ["sibSp", "sp"], Number.NaN);
|
|
20034
20012
|
if (!Number.isNaN(explicitSib)) {
|
|
20035
20013
|
const sib2 = clampRatio(explicitSib);
|
|
20036
|
-
const denom2 = begPad + endPad +
|
|
20037
|
-
const mainExtent2 =
|
|
20014
|
+
const denom2 = begPad + endPad + n2 + Math.max(0, n2 - 1) * sib2;
|
|
20015
|
+
const mainExtent2 = n2 > 0 ? usableMain / denom2 : usableMain;
|
|
20038
20016
|
return { mainExtent: mainExtent2, gap: sib2 * mainExtent2 };
|
|
20039
20017
|
}
|
|
20040
20018
|
const inferredGap = resolveMainAxisGap(index, role, mainAxisType, ceilingPx);
|
|
20041
20019
|
if (inferredGap && "absolutePx" in inferredGap) {
|
|
20042
20020
|
const gapAbs = Math.max(0, inferredGap.absolutePx);
|
|
20043
|
-
const denom2 = begPad + endPad +
|
|
20044
|
-
const mainExtent2 =
|
|
20021
|
+
const denom2 = begPad + endPad + n2;
|
|
20022
|
+
const mainExtent2 = n2 > 0 ? Math.max(0, usableMain - Math.max(0, n2 - 1) * gapAbs) / denom2 : usableMain;
|
|
20045
20023
|
return { mainExtent: mainExtent2, gap: gapAbs };
|
|
20046
20024
|
}
|
|
20047
20025
|
const sib = clampRatio(inferredGap && "relative" in inferredGap ? inferredGap.relative : 0.25);
|
|
20048
|
-
const denom = begPad + endPad +
|
|
20049
|
-
const mainExtent =
|
|
20026
|
+
const denom = begPad + endPad + n2 + Math.max(0, n2 - 1) * sib;
|
|
20027
|
+
const mainExtent = n2 > 0 ? usableMain / denom : usableMain;
|
|
20050
20028
|
return { mainExtent, gap: sib * mainExtent };
|
|
20051
20029
|
}
|
|
20052
20030
|
|
|
@@ -20093,15 +20071,15 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
20093
20071
|
const reversed = resolvedLinDir(view, plan.node, nodes.length, presLayoutVars, "fromT") === "fromB";
|
|
20094
20072
|
const rowChild = findRowChild(view, plan.node, presLayoutVars);
|
|
20095
20073
|
const colReversed = rowChild ? resolvedLinDir(view, rowChild, nodes.length, presLayoutVars, "fromL") === "fromR" : false;
|
|
20096
|
-
const byId = new Map(nodes.map((
|
|
20097
|
-
const childrenIn = (
|
|
20074
|
+
const byId = new Map(nodes.map((n2) => [n2.id, n2]));
|
|
20075
|
+
const childrenIn = (n2) => (childrenOf.get(n2.id) ?? []).filter((c) => byId.has(c.id));
|
|
20098
20076
|
const childIds = /* @__PURE__ */ new Set();
|
|
20099
|
-
for (const
|
|
20100
|
-
for (const c of childrenIn(
|
|
20077
|
+
for (const n2 of nodes) {
|
|
20078
|
+
for (const c of childrenIn(n2)) {
|
|
20101
20079
|
childIds.add(c.id);
|
|
20102
20080
|
}
|
|
20103
20081
|
}
|
|
20104
|
-
const roots = nodes.filter((
|
|
20082
|
+
const roots = nodes.filter((n2) => !childIds.has(n2.id));
|
|
20105
20083
|
const depthOf2 = /* @__PURE__ */ new Map();
|
|
20106
20084
|
let maxDepth2 = 0;
|
|
20107
20085
|
const depthStack = roots.map((r) => ({
|
|
@@ -20122,11 +20100,11 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
20122
20100
|
const rowGap = DEFAULT_GAP_RATIO2 * rowHeight;
|
|
20123
20101
|
const rowY = (depth) => (reversed ? generations - 1 - depth : depth) * (rowHeight + rowGap);
|
|
20124
20102
|
const splitAcross = (items, x, width) => {
|
|
20125
|
-
const
|
|
20126
|
-
if (
|
|
20103
|
+
const n2 = items.length;
|
|
20104
|
+
if (n2 === 0) {
|
|
20127
20105
|
return [];
|
|
20128
20106
|
}
|
|
20129
|
-
const denom =
|
|
20107
|
+
const denom = n2 + Math.max(0, n2 - 1) * DEFAULT_GAP_RATIO2;
|
|
20130
20108
|
const colWidth = width / denom;
|
|
20131
20109
|
const colGap = DEFAULT_GAP_RATIO2 * colWidth;
|
|
20132
20110
|
const ordered2 = colReversed ? [...items].reverse() : items;
|
|
@@ -20192,24 +20170,24 @@ function arrangeRecursiveTable(view, plan, nodes, box, palette, style, elementId
|
|
|
20192
20170
|
}
|
|
20193
20171
|
|
|
20194
20172
|
// diagram/layout/smartart-layout-snake-grid.ts
|
|
20195
|
-
function snakeGridDims(plan,
|
|
20173
|
+
function snakeGridDims(plan, n2, w, h, flowDir) {
|
|
20196
20174
|
const bkpt = algorithmParam(plan.node, "bkpt");
|
|
20197
20175
|
const fixedVal = findConstraint(plan.node.constraints, "bkPtFixedVal")?.value;
|
|
20198
20176
|
if (bkpt === "fixed" && typeof fixedVal === "number" && fixedVal > 0) {
|
|
20199
|
-
const lineLength = Math.max(1, Math.min(
|
|
20177
|
+
const lineLength = Math.max(1, Math.min(n2, Math.round(fixedVal)));
|
|
20200
20178
|
if (flowDir === "col") {
|
|
20201
20179
|
const rows = lineLength;
|
|
20202
|
-
return { cols: Math.max(1, Math.ceil(
|
|
20180
|
+
return { cols: Math.max(1, Math.ceil(n2 / rows)), rows };
|
|
20203
20181
|
}
|
|
20204
20182
|
const cols2 = lineLength;
|
|
20205
|
-
return { cols: cols2, rows: Math.max(1, Math.ceil(
|
|
20183
|
+
return { cols: cols2, rows: Math.max(1, Math.ceil(n2 / cols2)) };
|
|
20206
20184
|
}
|
|
20207
20185
|
if (flowDir === "col") {
|
|
20208
|
-
const rows = Math.max(1, Math.round(Math.sqrt(
|
|
20209
|
-
return { cols: Math.max(1, Math.ceil(
|
|
20186
|
+
const rows = Math.max(1, Math.round(Math.sqrt(n2 * Math.max(0.2, h / Math.max(1, w)))));
|
|
20187
|
+
return { cols: Math.max(1, Math.ceil(n2 / rows)), rows };
|
|
20210
20188
|
}
|
|
20211
|
-
const cols = Math.max(1, Math.round(Math.sqrt(
|
|
20212
|
-
return { cols, rows: Math.max(1, Math.ceil(
|
|
20189
|
+
const cols = Math.max(1, Math.round(Math.sqrt(n2 * Math.max(0.2, w / Math.max(1, h)))));
|
|
20190
|
+
return { cols, rows: Math.max(1, Math.ceil(n2 / cols)) };
|
|
20213
20191
|
}
|
|
20214
20192
|
function snakeCell(i, dims, flowDir, sameDir, grDir) {
|
|
20215
20193
|
const primaryCount = flowDir === "col" ? dims.rows : dims.cols;
|
|
@@ -20233,7 +20211,7 @@ function snakeCell(i, dims, flowDir, sameDir, grDir) {
|
|
|
20233
20211
|
function arrangeSnake2(plan, nodes, box, palette, style, elementId, index = EMPTY_CONSTRAINT_INDEX, childrenOf, fontName) {
|
|
20234
20212
|
const { width: w, height: h } = box;
|
|
20235
20213
|
const ctx = styleContext(style);
|
|
20236
|
-
const
|
|
20214
|
+
const n2 = nodes.length;
|
|
20237
20215
|
const sib = resolveRatioConstraint(
|
|
20238
20216
|
plan.node.constraints,
|
|
20239
20217
|
index,
|
|
@@ -20245,7 +20223,7 @@ function arrangeSnake2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
20245
20223
|
const grDirRaw = algorithmParam(plan.node, "grDir");
|
|
20246
20224
|
const grDir = grDirRaw === "tR" || grDirRaw === "bL" || grDirRaw === "bR" ? grDirRaw : "tL";
|
|
20247
20225
|
const sameDir = algorithmParam(plan.node, "contDir") === "sameDir";
|
|
20248
|
-
const { cols, rows } = snakeGridDims(plan,
|
|
20226
|
+
const { cols, rows } = snakeGridDims(plan, n2, w, h, flowDir);
|
|
20249
20227
|
const usableW = w - INSET * 2;
|
|
20250
20228
|
const usableH = h - INSET * 2;
|
|
20251
20229
|
const mainCount = flowDir === "col" ? rows : cols;
|
|
@@ -20310,7 +20288,7 @@ function arrangeSnake2(plan, nodes, box, palette, style, elementId, index = EMPT
|
|
|
20310
20288
|
height: cellH,
|
|
20311
20289
|
node,
|
|
20312
20290
|
index: i,
|
|
20313
|
-
total:
|
|
20291
|
+
total: n2,
|
|
20314
20292
|
palette,
|
|
20315
20293
|
style,
|
|
20316
20294
|
ctx,
|
|
@@ -20355,7 +20333,7 @@ function arrangeLinear2(view, plan, flow, nodes, box, palette, style, elementId,
|
|
|
20355
20333
|
const endPad = clampRatio(resolveRatioConstraint(constraints, index, role, ["endPad"], 0));
|
|
20356
20334
|
const aspect = itemAspect(view, plan, index, nodes.length, presLayoutVars);
|
|
20357
20335
|
const flow2 = ordered(nodes, flow);
|
|
20358
|
-
const
|
|
20336
|
+
const n2 = flow2.length;
|
|
20359
20337
|
const horizontal = flow.orientation === "horizontal";
|
|
20360
20338
|
const usableMain = (horizontal ? w : h) - INSET * 2;
|
|
20361
20339
|
const usableCross = (horizontal ? h : w) - INSET * 2;
|
|
@@ -20369,7 +20347,7 @@ function arrangeLinear2(view, plan, flow, nodes, box, palette, style, elementId,
|
|
|
20369
20347
|
usableMain,
|
|
20370
20348
|
begPad,
|
|
20371
20349
|
endPad,
|
|
20372
|
-
|
|
20350
|
+
n2,
|
|
20373
20351
|
clampRatio
|
|
20374
20352
|
);
|
|
20375
20353
|
const itemTemplate = itemNode(plan.node);
|
|
@@ -20429,7 +20407,7 @@ function arrangeLinear2(view, plan, flow, nodes, box, palette, style, elementId,
|
|
|
20429
20407
|
height: horizontal ? itemH : itemMainExtent,
|
|
20430
20408
|
node,
|
|
20431
20409
|
index: i,
|
|
20432
|
-
total:
|
|
20410
|
+
total: n2,
|
|
20433
20411
|
palette,
|
|
20434
20412
|
style,
|
|
20435
20413
|
ctx,
|
|
@@ -20937,7 +20915,7 @@ function resolveIterationRect(dims, box, iteration, iterationCount) {
|
|
|
20937
20915
|
|
|
20938
20916
|
// diagram/layout/smartart-layout-interpreter-composite-group-slots.ts
|
|
20939
20917
|
function contentSignature(content) {
|
|
20940
|
-
return content.map((
|
|
20918
|
+
return content.map((n2) => n2.id).sort().join(" ");
|
|
20941
20919
|
}
|
|
20942
20920
|
function resolveGroupedSlots(candidates, box, index) {
|
|
20943
20921
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -21091,18 +21069,18 @@ function renderForEachBoundSlots(slots, flat, box, absX, absY, childrenOf, ctx,
|
|
|
21091
21069
|
// diagram/hierarchy/smartart-hierarchy-pitch.ts
|
|
21092
21070
|
var GENERATION_MARGIN_RATIO = 0.1675;
|
|
21093
21071
|
function computeAxisPitch(dimension, margin, itemSize, count, fixedGapRatio) {
|
|
21094
|
-
const
|
|
21095
|
-
const gap =
|
|
21072
|
+
const n2 = Math.max(1, count);
|
|
21073
|
+
const gap = n2 <= 1 ? 0 : fixedGapRatio !== void 0 ? itemSize * Math.max(0, fixedGapRatio) : Math.max(0, (dimension - margin - n2 * itemSize) / (n2 - 1));
|
|
21096
21074
|
const pitch = itemSize + gap;
|
|
21097
|
-
const centeredShift = (dimension -
|
|
21098
|
-
const maxShift = dimension -
|
|
21075
|
+
const centeredShift = (dimension - n2 * pitch + margin) / 2;
|
|
21076
|
+
const maxShift = dimension - n2 * itemSize - gap * (n2 - 0.5);
|
|
21099
21077
|
return { pitch, shift: Math.min(centeredShift, maxShift) };
|
|
21100
21078
|
}
|
|
21101
21079
|
function centeredAxisPitch(dimension, itemSize, gapRatio, count) {
|
|
21102
|
-
const
|
|
21103
|
-
const gap =
|
|
21080
|
+
const n2 = Math.max(1, count);
|
|
21081
|
+
const gap = n2 > 1 ? itemSize * Math.max(0, gapRatio) : 0;
|
|
21104
21082
|
const pitch = itemSize + gap;
|
|
21105
|
-
const span =
|
|
21083
|
+
const span = n2 * itemSize + Math.max(0, n2 - 1) * gap;
|
|
21106
21084
|
const shift = (dimension - span) / 2;
|
|
21107
21085
|
return { pitch, shift };
|
|
21108
21086
|
}
|
|
@@ -21637,7 +21615,7 @@ function findNamedNode(node, name) {
|
|
|
21637
21615
|
function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMPTY_CONSTRAINT_INDEX, childrenOf, fontName) {
|
|
21638
21616
|
const { width: w, height: h } = box;
|
|
21639
21617
|
const ctx = styleContext(style);
|
|
21640
|
-
const
|
|
21618
|
+
const n2 = nodes.length;
|
|
21641
21619
|
const bandW = w - DEFAULT_INSET * 2;
|
|
21642
21620
|
const bandCx = DEFAULT_INSET + bandW / 2;
|
|
21643
21621
|
const gapRatio = resolveRatioConstraint(
|
|
@@ -21648,7 +21626,7 @@ function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMP
|
|
|
21648
21626
|
DEFAULT_GAP_RATIO3
|
|
21649
21627
|
);
|
|
21650
21628
|
const usableH = h - DEFAULT_INSET * 2;
|
|
21651
|
-
const bandH =
|
|
21629
|
+
const bandH = n2 > 0 ? usableH / (n2 + Math.max(0, n2 - 1) * gapRatio) : usableH;
|
|
21652
21630
|
const gap = gapRatio * bandH;
|
|
21653
21631
|
const lvlNodeName = algorithmParam(plan.node, "pyraLvlNode");
|
|
21654
21632
|
const lvlNode = lvlNodeName ? findNamedNode(plan.node, lvlNodeName) : void 0;
|
|
@@ -21662,9 +21640,9 @@ function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMP
|
|
|
21662
21640
|
const halfBandH = (slotBot - slotTop) * lvlHeightRatio / 2;
|
|
21663
21641
|
const yTop = slotMidY - halfBandH;
|
|
21664
21642
|
const yBot = slotMidY + halfBandH;
|
|
21665
|
-
const effectiveI = inverted ?
|
|
21666
|
-
const fTop = effectiveI /
|
|
21667
|
-
const fBot = (effectiveI + 1) /
|
|
21643
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
21644
|
+
const fTop = effectiveI / n2;
|
|
21645
|
+
const fBot = (effectiveI + 1) / n2;
|
|
21668
21646
|
const halfTop = bandW * fTop / 2 * lvlWidthRatio;
|
|
21669
21647
|
const halfBot = bandW * fBot / 2 * lvlWidthRatio;
|
|
21670
21648
|
return { node, yTop, yBot, halfTop, halfBot };
|
|
@@ -21701,7 +21679,7 @@ function arrangePyramid(plan, nodes, box, palette, style, elementId, index = EMP
|
|
|
21701
21679
|
fontHeight: bandH,
|
|
21702
21680
|
node,
|
|
21703
21681
|
index: i,
|
|
21704
|
-
total:
|
|
21682
|
+
total: n2,
|
|
21705
21683
|
palette,
|
|
21706
21684
|
style,
|
|
21707
21685
|
ctx,
|
|
@@ -21851,7 +21829,7 @@ function resolveHierarchyItemNode(algorithmNode) {
|
|
|
21851
21829
|
return first2;
|
|
21852
21830
|
}
|
|
21853
21831
|
const allNames = new Set(
|
|
21854
|
-
candidates.map((c) => c.name).filter((
|
|
21832
|
+
candidates.map((c) => c.name).filter((n2) => n2 !== void 0)
|
|
21855
21833
|
);
|
|
21856
21834
|
const constraints = algorithmNode.allConstraints ?? algorithmNode.constraints ?? [];
|
|
21857
21835
|
for (const candidate of candidates) {
|
|
@@ -23005,11 +22983,11 @@ function transposeResult(result, realWidth, realHeight) {
|
|
|
23005
22983
|
// diagram/hierarchy/smartart-hierarchy-fit-item-box.ts
|
|
23006
22984
|
var ALL_CHILDREN_HANG_EXTRA_RATIO = 0.6587;
|
|
23007
22985
|
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) {
|
|
23008
|
-
const
|
|
22986
|
+
const n2 = Math.max(1, columns);
|
|
23009
22987
|
const usableW = box.width - 2 * box.width * marginXRatio;
|
|
23010
22988
|
const allHangExtra = allChildrenHang ? ALL_CHILDREN_HANG_EXTRA_RATIO : 0;
|
|
23011
|
-
const hangColumnFraction =
|
|
23012
|
-
const widthFit = usableW / (
|
|
22989
|
+
const hangColumnFraction = n2 > 0 ? Math.min(1, Math.max(0, hangingColumns) / n2) : 0;
|
|
22990
|
+
const widthFit = usableW / (n2 + Math.max(0, n2 - 1) * sibSpRatio + maxHangDepth * HIER_TAIL_OFFSET_RATIO * hangColumnFraction + allHangExtra);
|
|
23013
22991
|
const generations = Math.max(1, levels);
|
|
23014
22992
|
const usableH = box.height - 2 * box.height * marginYRatio;
|
|
23015
22993
|
const heightFit = usableH / (generations + maxHangRows + Math.max(0, generations - 1) * generationGapRatio + maxHangRows * hangHeightRatio);
|
|
@@ -24105,17 +24083,17 @@ function resolvePyraAcctRatio(planNode, index) {
|
|
|
24105
24083
|
const constraints = planNode.allConstraints ?? planNode.constraints;
|
|
24106
24084
|
return resolveRatioConstraint(constraints, index, roleOf(planNode), ["pyraAcctRatio"], 0);
|
|
24107
24085
|
}
|
|
24108
|
-
function pyramidRowGeometry(i,
|
|
24086
|
+
function pyramidRowGeometry(i, n2, box, gapRatio, inverted) {
|
|
24109
24087
|
const bandW = box.width - DEFAULT_INSET * 2;
|
|
24110
24088
|
const bandCx = DEFAULT_INSET + bandW / 2;
|
|
24111
24089
|
const usableH = box.height - DEFAULT_INSET * 2;
|
|
24112
|
-
const bandH =
|
|
24090
|
+
const bandH = n2 > 0 ? usableH / (n2 + Math.max(0, n2 - 1) * gapRatio) : usableH;
|
|
24113
24091
|
const gap = gapRatio * bandH;
|
|
24114
24092
|
const slotTop = DEFAULT_INSET + i * (bandH + gap);
|
|
24115
24093
|
const slotBot = slotTop + bandH;
|
|
24116
|
-
const effectiveI = inverted ?
|
|
24117
|
-
const fTop = effectiveI /
|
|
24118
|
-
const fBot = (effectiveI + 1) /
|
|
24094
|
+
const effectiveI = inverted ? n2 - 1 - i : i;
|
|
24095
|
+
const fTop = effectiveI / n2;
|
|
24096
|
+
const fBot = (effectiveI + 1) / n2;
|
|
24119
24097
|
const halfTop = bandW * fTop / 2;
|
|
24120
24098
|
const halfBot = bandW * fBot / 2;
|
|
24121
24099
|
return {
|
|
@@ -24133,7 +24111,7 @@ function repositionPyramidBands(result, box, planNode, topLevelIds, flatNodes, h
|
|
|
24133
24111
|
return result;
|
|
24134
24112
|
}
|
|
24135
24113
|
const scale = 1 - pyraAcctRatio;
|
|
24136
|
-
const
|
|
24114
|
+
const n2 = topLevelIds.length;
|
|
24137
24115
|
const rowIndexById = new Map(topLevelIds.map((id, i) => [id, i]));
|
|
24138
24116
|
const parentIdById = new Map(flatNodes.map((node) => [node.id, node.parentId]));
|
|
24139
24117
|
const gapRatio = resolveRatioConstraint(
|
|
@@ -24157,7 +24135,7 @@ function repositionPyramidBands(result, box, planNode, topLevelIds, flatNodes, h
|
|
|
24157
24135
|
if (rowIndex === void 0) {
|
|
24158
24136
|
return rendered;
|
|
24159
24137
|
}
|
|
24160
|
-
const row = pyramidRowGeometry(rowIndex,
|
|
24138
|
+
const row = pyramidRowGeometry(rowIndex, n2, box, gapRatio, inverted);
|
|
24161
24139
|
const scaledLeftTop = scale * row.leftTop;
|
|
24162
24140
|
const scaledRightTop = scale * row.rightTop;
|
|
24163
24141
|
const scaledLeftBot = scale * row.leftBot;
|
|
@@ -24275,12 +24253,12 @@ function runArrangement(view, input) {
|
|
|
24275
24253
|
input.connections,
|
|
24276
24254
|
presLayoutVars
|
|
24277
24255
|
) : withNamedRule;
|
|
24278
|
-
const hasAccentSomewhere = arranged.some((node) => flat.some((
|
|
24256
|
+
const hasAccentSomewhere = arranged.some((node) => flat.some((n2) => n2.parentId === node.id));
|
|
24279
24257
|
const withPyramidBands = plan.kind === "pyramid" ? repositionPyramidBands(
|
|
24280
24258
|
withItemRoles,
|
|
24281
24259
|
box,
|
|
24282
24260
|
plan.node,
|
|
24283
|
-
arranged.map((
|
|
24261
|
+
arranged.map((n2) => n2.id),
|
|
24284
24262
|
flat,
|
|
24285
24263
|
hasAccentSomewhere,
|
|
24286
24264
|
constraintIndex
|
|
@@ -24923,7 +24901,7 @@ function descendants2(root, local) {
|
|
|
24923
24901
|
function orderedColorTransforms(channels, transforms) {
|
|
24924
24902
|
let { r, g: g2, b } = channels;
|
|
24925
24903
|
let alpha = 1;
|
|
24926
|
-
const
|
|
24904
|
+
const wrap2 = (value) => (value % 360 + 360) % 360;
|
|
24927
24905
|
for (const transform of transforms) {
|
|
24928
24906
|
const { name, value } = transform;
|
|
24929
24907
|
const fraction = parseDrawingFraction(value);
|
|
@@ -24941,14 +24919,14 @@ function orderedColorTransforms(channels, transforms) {
|
|
|
24941
24919
|
[r, g2, b] = [mix(r), mix(g2), mix(b)];
|
|
24942
24920
|
} else {
|
|
24943
24921
|
const hsl = rgbToHsl(r, g2, b);
|
|
24944
|
-
if (name === "comp") hsl.h =
|
|
24922
|
+
if (name === "comp") hsl.h = wrap2(hsl.h + 180);
|
|
24945
24923
|
else if (name === "hue") {
|
|
24946
24924
|
const hue = parseDrawingHueDegrees(value);
|
|
24947
|
-
if (hue !== void 0) hsl.h =
|
|
24925
|
+
if (hue !== void 0) hsl.h = wrap2(hue);
|
|
24948
24926
|
} else if (name === "hueOff") {
|
|
24949
24927
|
const hue = parseDrawingHueDegrees(value);
|
|
24950
|
-
if (hue !== void 0) hsl.h =
|
|
24951
|
-
} else if (name === "hueMod" && fraction !== void 0) hsl.h =
|
|
24928
|
+
if (hue !== void 0) hsl.h = wrap2(hsl.h + hue);
|
|
24929
|
+
} else if (name === "hueMod" && fraction !== void 0) hsl.h = wrap2(hsl.h * fraction);
|
|
24952
24930
|
else if (name === "sat" && fraction !== void 0) hsl.s = clampUnitInterval(fraction);
|
|
24953
24931
|
else if (name === "satMod" && fraction !== void 0) hsl.s *= fraction;
|
|
24954
24932
|
else if (name === "satOff" && fraction !== void 0)
|
|
@@ -25106,13 +25084,13 @@ function resolveDrawingColor(color, theme, options) {
|
|
|
25106
25084
|
}
|
|
25107
25085
|
if (["hue", "hueMod", "hueOff", "sat", "satMod", "satOff", "lum", "lumMod", "lumOff"].some(has)) {
|
|
25108
25086
|
const hsl = rgbToHsl(r, g2, b);
|
|
25109
|
-
const
|
|
25087
|
+
const wrap2 = (degrees) => (degrees % 360 + 360) % 360;
|
|
25110
25088
|
const hueAbs = parseDrawingHueDegrees(find("hue"));
|
|
25111
|
-
if (hueAbs !== void 0) hsl.h =
|
|
25089
|
+
if (hueAbs !== void 0) hsl.h = wrap2(hueAbs);
|
|
25112
25090
|
const hueMod = parseDrawingFraction(find("hueMod"));
|
|
25113
|
-
if (hueMod !== void 0) hsl.h =
|
|
25091
|
+
if (hueMod !== void 0) hsl.h = wrap2(hsl.h * hueMod);
|
|
25114
25092
|
const hueOff = parseDrawingHueDegrees(find("hueOff"));
|
|
25115
|
-
if (hueOff !== void 0) hsl.h =
|
|
25093
|
+
if (hueOff !== void 0) hsl.h = wrap2(hsl.h + hueOff);
|
|
25116
25094
|
const satAbs = parseDrawingFraction(find("sat"));
|
|
25117
25095
|
if (satAbs !== void 0) hsl.s = clampUnitInterval(satAbs);
|
|
25118
25096
|
const satMod = parseDrawingFraction(find("satMod"));
|
|
@@ -25282,12 +25260,12 @@ function parseArtisticPictureExtension(node) {
|
|
|
25282
25260
|
const key = ARTISTIC_PRIMARY_ATTRIBUTE[effect.localName];
|
|
25283
25261
|
if (!key) return void 0;
|
|
25284
25262
|
const raw = key ? effect.getAttribute(key) : null;
|
|
25285
|
-
const
|
|
25286
|
-
if (!Number.isFinite(
|
|
25263
|
+
const n2 = raw === null ? 0 : Number(raw);
|
|
25264
|
+
if (!Number.isFinite(n2)) return void 0;
|
|
25287
25265
|
return {
|
|
25288
25266
|
kind: "artistic",
|
|
25289
25267
|
name: effect.localName,
|
|
25290
|
-
radius: effect.localName === "artisticBlur" ?
|
|
25268
|
+
radius: effect.localName === "artisticBlur" ? n2 : n2 / 1e3,
|
|
25291
25269
|
baked: true,
|
|
25292
25270
|
...unhandled.length ? { unhandled } : {}
|
|
25293
25271
|
};
|
|
@@ -25399,10 +25377,10 @@ function parseStandardPictureEffect(node) {
|
|
|
25399
25377
|
const raw = node.getAttribute(attribute);
|
|
25400
25378
|
if (raw === null) continue;
|
|
25401
25379
|
const percent = raw.endsWith("%");
|
|
25402
|
-
const
|
|
25403
|
-
if (!Number.isFinite(
|
|
25380
|
+
const n2 = Number(percent ? raw.slice(0, -1) : raw) / (key === "hue" ? 6e4 : key === "radiusEmu" ? 1 : percent ? 100 : 1e5);
|
|
25381
|
+
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))
|
|
25404
25382
|
return void 0;
|
|
25405
|
-
values[key] =
|
|
25383
|
+
values[key] = n2;
|
|
25406
25384
|
}
|
|
25407
25385
|
if (["biLevel", "alphaBiLevel"].includes(name) && values.threshold === void 0)
|
|
25408
25386
|
return void 0;
|
|
@@ -25412,9 +25390,9 @@ function parseStandardPictureEffect(node) {
|
|
|
25412
25390
|
const nested = cont ? elements(cont) : [];
|
|
25413
25391
|
if (nested.length !== 1 || nested[0]?.localName !== "alphaModFix") return void 0;
|
|
25414
25392
|
const raw = nested[0].getAttribute("amt") ?? "100000";
|
|
25415
|
-
const
|
|
25416
|
-
if (!Number.isFinite(
|
|
25417
|
-
values.amount =
|
|
25393
|
+
const n2 = Number(raw.endsWith("%") ? raw.slice(0, -1) : raw) / (raw.endsWith("%") ? 100 : 1e5);
|
|
25394
|
+
if (!Number.isFinite(n2) || n2 < 0) return void 0;
|
|
25395
|
+
values.amount = n2;
|
|
25418
25396
|
}
|
|
25419
25397
|
let colors = [];
|
|
25420
25398
|
if (name === "duotone") {
|
|
@@ -25510,8 +25488,8 @@ function picturePercentage(value) {
|
|
|
25510
25488
|
const text2 = String(value ?? "").trim();
|
|
25511
25489
|
if (!text2) return void 0;
|
|
25512
25490
|
const percent = text2.endsWith("%");
|
|
25513
|
-
const
|
|
25514
|
-
return Number.isFinite(
|
|
25491
|
+
const n2 = Number(percent ? text2.slice(0, -1) : text2) / (percent ? 100 : 1e5);
|
|
25492
|
+
return Number.isFinite(n2) ? n2 : void 0;
|
|
25515
25493
|
}
|
|
25516
25494
|
function readPictureEffect(name, attribute) {
|
|
25517
25495
|
if (name === "grayscl") return { kind: "grayscale" };
|
|
@@ -25591,8 +25569,8 @@ function applyPictureEffects(blip, effects) {
|
|
|
25591
25569
|
// drawingml/read-3d-values.ts
|
|
25592
25570
|
var integer = (value) => {
|
|
25593
25571
|
if (value === void 0 || value === null || String(value).trim() === "") return void 0;
|
|
25594
|
-
const
|
|
25595
|
-
return Number.isSafeInteger(
|
|
25572
|
+
const n2 = Number(value);
|
|
25573
|
+
return Number.isSafeInteger(n2) ? n2 : void 0;
|
|
25596
25574
|
};
|
|
25597
25575
|
function readScene3DValues(node, read) {
|
|
25598
25576
|
const out = {};
|
|
@@ -25713,16 +25691,16 @@ function parsePictureLayout(fill) {
|
|
|
25713
25691
|
["scaleX", "sx"],
|
|
25714
25692
|
["scaleY", "sy"]
|
|
25715
25693
|
]) {
|
|
25716
|
-
const
|
|
25717
|
-
if (
|
|
25694
|
+
const n2 = picturePercentage(tile.getAttribute(attr));
|
|
25695
|
+
if (n2 !== void 0) value[key] = n2;
|
|
25718
25696
|
}
|
|
25719
25697
|
for (const [key, attr] of [
|
|
25720
25698
|
["offsetXEmu", "tx"],
|
|
25721
25699
|
["offsetYEmu", "ty"]
|
|
25722
25700
|
]) {
|
|
25723
25701
|
const raw = tile.getAttribute(attr);
|
|
25724
|
-
const
|
|
25725
|
-
if (Number.isSafeInteger(
|
|
25702
|
+
const n2 = raw === null ? NaN : Number(raw);
|
|
25703
|
+
if (Number.isSafeInteger(n2)) value[key] = n2;
|
|
25726
25704
|
}
|
|
25727
25705
|
const alignment = tile.getAttribute("algn");
|
|
25728
25706
|
if (alignment) value.alignment = alignment;
|
|
@@ -25777,14 +25755,14 @@ function applyPictureLayout(fill, layout) {
|
|
|
25777
25755
|
["offsetXEmu", "tx"],
|
|
25778
25756
|
["offsetYEmu", "ty"]
|
|
25779
25757
|
]) {
|
|
25780
|
-
const
|
|
25781
|
-
if (
|
|
25758
|
+
const n2 = layout.tile[key];
|
|
25759
|
+
if (n2 !== void 0 && (!Number.isFinite(n2) || (name === "sx" || name === "sy" ? n2 <= 0 : !Number.isSafeInteger(n2))))
|
|
25782
25760
|
throw new RangeError("Invalid picture tile");
|
|
25783
|
-
if (
|
|
25761
|
+
if (n2 !== before.tile?.[key])
|
|
25784
25762
|
attr(
|
|
25785
25763
|
tile,
|
|
25786
25764
|
name,
|
|
25787
|
-
|
|
25765
|
+
n2 === void 0 ? void 0 : Math.round(n2 * (name === "sx" || name === "sy" ? 1e5 : 1)),
|
|
25788
25766
|
void 0
|
|
25789
25767
|
);
|
|
25790
25768
|
}
|
|
@@ -25801,11 +25779,11 @@ function applyPictureLayout(fill, layout) {
|
|
|
25801
25779
|
if (tile) fill.removeChild(tile);
|
|
25802
25780
|
const rect2 = make(make(fill, "stretch"), "fillRect");
|
|
25803
25781
|
for (const key of ["l", "t", "r", "b"]) {
|
|
25804
|
-
const
|
|
25805
|
-
if (
|
|
25782
|
+
const n2 = layout.fillRect?.[key];
|
|
25783
|
+
if (n2 !== void 0 && !Number.isFinite(n2))
|
|
25806
25784
|
throw new RangeError("Invalid picture fill rectangle");
|
|
25807
|
-
if (
|
|
25808
|
-
attr(rect2, key,
|
|
25785
|
+
if (n2 !== before.fillRect?.[key])
|
|
25786
|
+
attr(rect2, key, n2 === void 0 ? void 0 : Math.round(n2 * 1e5), void 0);
|
|
25809
25787
|
}
|
|
25810
25788
|
}
|
|
25811
25789
|
}
|
|
@@ -26531,12 +26509,12 @@ function findDiagramShapeIndex(shapes, nodes, nodeId) {
|
|
|
26531
26509
|
}
|
|
26532
26510
|
}
|
|
26533
26511
|
if (shapes.length === nodes.length) {
|
|
26534
|
-
const nodeIdx = nodes.findIndex((
|
|
26512
|
+
const nodeIdx = nodes.findIndex((n2) => n2.id === nodeId);
|
|
26535
26513
|
if (nodeIdx >= 0) {
|
|
26536
26514
|
return nodeIdx;
|
|
26537
26515
|
}
|
|
26538
26516
|
}
|
|
26539
|
-
const node = nodes.find((
|
|
26517
|
+
const node = nodes.find((n2) => n2.id === nodeId);
|
|
26540
26518
|
if (node?.text) {
|
|
26541
26519
|
const text2 = node.text.trim();
|
|
26542
26520
|
const matches = [];
|
|
@@ -26584,7 +26562,7 @@ function createOfficeGuid() {
|
|
|
26584
26562
|
// diagram/edit/node-ops.ts
|
|
26585
26563
|
var diagramModelId = (options) => (options?.createModelId ?? createOfficeGuid)();
|
|
26586
26564
|
function findDiagramRootParentId(nodes) {
|
|
26587
|
-
const nodeIds = new Set(nodes.map((
|
|
26565
|
+
const nodeIds = new Set(nodes.map((n2) => n2.id));
|
|
26588
26566
|
for (const node of nodes) {
|
|
26589
26567
|
if (node.parentId && !nodeIds.has(node.parentId)) {
|
|
26590
26568
|
return node.parentId;
|
|
@@ -26621,13 +26599,13 @@ function insertSibling(data, text2, siblingId, offset, options) {
|
|
|
26621
26599
|
const newId = diagramModelId(options);
|
|
26622
26600
|
let parentId;
|
|
26623
26601
|
if (siblingId) {
|
|
26624
|
-
const sibling = data.nodes.find((
|
|
26602
|
+
const sibling = data.nodes.find((n2) => n2.id === siblingId);
|
|
26625
26603
|
parentId = sibling?.parentId;
|
|
26626
26604
|
}
|
|
26627
26605
|
parentId ??= findDiagramRootParentId(data.nodes);
|
|
26628
26606
|
const newNode = { id: newId, text: text2, parentId };
|
|
26629
26607
|
const nodes = [...data.nodes];
|
|
26630
|
-
const siblingIndex = siblingId ? nodes.findIndex((
|
|
26608
|
+
const siblingIndex = siblingId ? nodes.findIndex((n2) => n2.id === siblingId) : -1;
|
|
26631
26609
|
if (siblingIndex >= 0) {
|
|
26632
26610
|
nodes.splice(siblingIndex + offset, 0, newNode);
|
|
26633
26611
|
} else {
|
|
@@ -26652,7 +26630,7 @@ function addDiagramNodeBelow(data, parentId, text2, options) {
|
|
|
26652
26630
|
return withEditedStructure(data, nodes, connections);
|
|
26653
26631
|
}
|
|
26654
26632
|
function addDiagramNodeAbove(data, nodeId, text2, options) {
|
|
26655
|
-
const target = data.nodes.find((
|
|
26633
|
+
const target = data.nodes.find((n2) => n2.id === nodeId);
|
|
26656
26634
|
if (!target) {
|
|
26657
26635
|
return data;
|
|
26658
26636
|
}
|
|
@@ -26679,13 +26657,13 @@ function addDiagramNodeAbove(data, nodeId, text2, options) {
|
|
|
26679
26657
|
return withEditedStructure(data, nodes, connections);
|
|
26680
26658
|
}
|
|
26681
26659
|
function removeDiagramNode(data, nodeId) {
|
|
26682
|
-
const removedNode = data.nodes.find((
|
|
26683
|
-
const childIds = data.nodes.filter((
|
|
26684
|
-
const nodes = data.nodes.filter((
|
|
26685
|
-
if (
|
|
26686
|
-
return { ...
|
|
26660
|
+
const removedNode = data.nodes.find((n2) => n2.id === nodeId);
|
|
26661
|
+
const childIds = data.nodes.filter((n2) => n2.parentId === nodeId).map((n2) => n2.id);
|
|
26662
|
+
const nodes = data.nodes.filter((n2) => n2.id !== nodeId).map((n2) => {
|
|
26663
|
+
if (n2.parentId === nodeId) {
|
|
26664
|
+
return { ...n2, parentId: removedNode?.parentId };
|
|
26687
26665
|
}
|
|
26688
|
-
return { ...
|
|
26666
|
+
return { ...n2 };
|
|
26689
26667
|
});
|
|
26690
26668
|
const connections = (data.connections ?? []).filter((c) => c.sourceId !== nodeId && c.destId !== nodeId).map((c) => ({ ...c }));
|
|
26691
26669
|
const grandParentId = removedNode?.parentId;
|
|
@@ -26697,7 +26675,7 @@ function removeDiagramNode(data, nodeId) {
|
|
|
26697
26675
|
return withEditedStructure(data, nodes, connections);
|
|
26698
26676
|
}
|
|
26699
26677
|
function setDiagramNodeText(data, nodeId, newText) {
|
|
26700
|
-
const nodes = data.nodes.map((
|
|
26678
|
+
const nodes = data.nodes.map((n2) => n2.id === nodeId ? { ...n2, text: newText } : n2);
|
|
26701
26679
|
return {
|
|
26702
26680
|
...data,
|
|
26703
26681
|
nodes,
|
|
@@ -26711,12 +26689,12 @@ function setDiagramNodeText(data, nodeId, newText) {
|
|
|
26711
26689
|
|
|
26712
26690
|
// diagram/edit/node-order.ts
|
|
26713
26691
|
function moveDiagramNode(data, nodeId, direction) {
|
|
26714
|
-
const node = data.nodes.find((
|
|
26692
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26715
26693
|
if (!node) {
|
|
26716
26694
|
return data;
|
|
26717
26695
|
}
|
|
26718
|
-
const siblings = data.nodes.filter((
|
|
26719
|
-
const currentIndex = siblings.findIndex((
|
|
26696
|
+
const siblings = data.nodes.filter((n2) => n2.parentId === node.parentId);
|
|
26697
|
+
const currentIndex = siblings.findIndex((n2) => n2.id === nodeId);
|
|
26720
26698
|
const targetIndex = currentIndex + direction;
|
|
26721
26699
|
const current = siblings[currentIndex];
|
|
26722
26700
|
const target = siblings[targetIndex];
|
|
@@ -26724,8 +26702,8 @@ function moveDiagramNode(data, nodeId, direction) {
|
|
|
26724
26702
|
return data;
|
|
26725
26703
|
}
|
|
26726
26704
|
const nodes = [...data.nodes];
|
|
26727
|
-
const currentGlobalIndex = nodes.findIndex((
|
|
26728
|
-
const targetGlobalIndex = nodes.findIndex((
|
|
26705
|
+
const currentGlobalIndex = nodes.findIndex((n2) => n2.id === current.id);
|
|
26706
|
+
const targetGlobalIndex = nodes.findIndex((n2) => n2.id === target.id);
|
|
26729
26707
|
if (currentGlobalIndex >= 0 && targetGlobalIndex >= 0) {
|
|
26730
26708
|
nodes[currentGlobalIndex] = target;
|
|
26731
26709
|
nodes[targetGlobalIndex] = current;
|
|
@@ -26733,12 +26711,12 @@ function moveDiagramNode(data, nodeId, direction) {
|
|
|
26733
26711
|
return withEditedStructure(data, nodes);
|
|
26734
26712
|
}
|
|
26735
26713
|
function moveDiagramNodeToIndex(data, nodeId, newIndex) {
|
|
26736
|
-
const node = data.nodes.find((
|
|
26714
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26737
26715
|
if (!node) {
|
|
26738
26716
|
return data;
|
|
26739
26717
|
}
|
|
26740
|
-
const siblings = data.nodes.filter((
|
|
26741
|
-
const currentIndex = siblings.findIndex((
|
|
26718
|
+
const siblings = data.nodes.filter((n2) => n2.parentId === node.parentId);
|
|
26719
|
+
const currentIndex = siblings.findIndex((n2) => n2.id === nodeId);
|
|
26742
26720
|
if (currentIndex < 0) {
|
|
26743
26721
|
return data;
|
|
26744
26722
|
}
|
|
@@ -26752,21 +26730,21 @@ function moveDiagramNodeToIndex(data, nodeId, newIndex) {
|
|
|
26752
26730
|
const siblingIds = new Set(siblings.map((s) => s.id));
|
|
26753
26731
|
const nodes = [];
|
|
26754
26732
|
let sibIdx = 0;
|
|
26755
|
-
for (const
|
|
26756
|
-
nodes.push(siblingIds.has(
|
|
26733
|
+
for (const n2 of data.nodes) {
|
|
26734
|
+
nodes.push(siblingIds.has(n2.id) ? reorderedSiblings[sibIdx++] ?? n2 : n2);
|
|
26757
26735
|
}
|
|
26758
26736
|
return withEditedStructure(data, nodes);
|
|
26759
26737
|
}
|
|
26760
26738
|
function promoteDiagramNode(data, nodeId) {
|
|
26761
|
-
const node = data.nodes.find((
|
|
26739
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26762
26740
|
if (!node || !node.parentId) {
|
|
26763
26741
|
return data;
|
|
26764
26742
|
}
|
|
26765
|
-
const parent = data.nodes.find((
|
|
26743
|
+
const parent = data.nodes.find((n2) => n2.id === node.parentId);
|
|
26766
26744
|
if (!parent) {
|
|
26767
26745
|
return data;
|
|
26768
26746
|
}
|
|
26769
|
-
const nodes = data.nodes.map((
|
|
26747
|
+
const nodes = data.nodes.map((n2) => n2.id === nodeId ? { ...n2, parentId: parent.parentId } : n2);
|
|
26770
26748
|
const connections = (data.connections ?? []).filter((c) => !(c.sourceId === node.parentId && c.destId === nodeId)).map((c) => ({ ...c }));
|
|
26771
26749
|
if (parent.parentId) {
|
|
26772
26750
|
connections.push({
|
|
@@ -26780,18 +26758,18 @@ function promoteDiagramNode(data, nodeId) {
|
|
|
26780
26758
|
return withEditedStructure(data, nodes, connections);
|
|
26781
26759
|
}
|
|
26782
26760
|
function demoteDiagramNode(data, nodeId) {
|
|
26783
|
-
const node = data.nodes.find((
|
|
26761
|
+
const node = data.nodes.find((n2) => n2.id === nodeId);
|
|
26784
26762
|
if (!node) {
|
|
26785
26763
|
return data;
|
|
26786
26764
|
}
|
|
26787
|
-
const siblings = data.nodes.filter((
|
|
26788
|
-
const currentIndex = siblings.findIndex((
|
|
26765
|
+
const siblings = data.nodes.filter((n2) => n2.parentId === node.parentId);
|
|
26766
|
+
const currentIndex = siblings.findIndex((n2) => n2.id === nodeId);
|
|
26789
26767
|
const previous = currentIndex > 0 ? siblings[currentIndex - 1] : void 0;
|
|
26790
26768
|
if (!previous) {
|
|
26791
26769
|
return data;
|
|
26792
26770
|
}
|
|
26793
26771
|
const newParentId = previous.id;
|
|
26794
|
-
const nodes = data.nodes.map((
|
|
26772
|
+
const nodes = data.nodes.map((n2) => n2.id === nodeId ? { ...n2, parentId: newParentId } : n2);
|
|
26795
26773
|
const connections = (data.connections ?? []).filter((c) => !(c.sourceId === node.parentId && c.destId === nodeId)).map((c) => ({ ...c }));
|
|
26796
26774
|
connections.push({
|
|
26797
26775
|
sourceId: newParentId,
|
|
@@ -27315,7 +27293,7 @@ function resolveDiagramReflowCategory(layoutType) {
|
|
|
27315
27293
|
|
|
27316
27294
|
// diagram/edit/reflow.ts
|
|
27317
27295
|
function diagramContentNodes(nodes) {
|
|
27318
|
-
return nodes.filter((
|
|
27296
|
+
return nodes.filter((n2) => n2.text.length > 0);
|
|
27319
27297
|
}
|
|
27320
27298
|
function reflowDiagramLayout(data, bounds) {
|
|
27321
27299
|
const nodes = diagramContentNodes(data.nodes);
|
|
@@ -29508,7 +29486,7 @@ var IV = [
|
|
|
29508
29486
|
1541459225
|
|
29509
29487
|
];
|
|
29510
29488
|
var W = new Uint32Array(64);
|
|
29511
|
-
var rotr = (x,
|
|
29489
|
+
var rotr = (x, n2) => x >>> n2 | x << 32 - n2;
|
|
29512
29490
|
function compress(h, view, offset) {
|
|
29513
29491
|
for (let i = 0; i < 16; i++) W[i] = view.getUint32(offset + i * 4);
|
|
29514
29492
|
for (let i = 16; i < 64; i++) {
|
|
@@ -31395,7 +31373,7 @@ function parseCustomGeometry(custom, width, height) {
|
|
|
31395
31373
|
}
|
|
31396
31374
|
const pathWidth = path.hasAttribute("w") ? Number(path.getAttribute("w")) : contextWidth;
|
|
31397
31375
|
const pathHeight = path.hasAttribute("h") ? Number(path.getAttribute("h")) : contextHeight;
|
|
31398
|
-
if (![pathWidth, pathHeight].every((
|
|
31376
|
+
if (![pathWidth, pathHeight].every((n2) => Number.isFinite(n2) && n2 > 0)) return void 0;
|
|
31399
31377
|
paths.push({
|
|
31400
31378
|
commands,
|
|
31401
31379
|
width: pathWidth,
|
|
@@ -32247,7 +32225,7 @@ function lerpStops(a, b, t) {
|
|
|
32247
32225
|
opacity: oa + (ob - oa) * t
|
|
32248
32226
|
};
|
|
32249
32227
|
}
|
|
32250
|
-
function
|
|
32228
|
+
function gradientColorAt(stops, position) {
|
|
32251
32229
|
const first2 = stops[0];
|
|
32252
32230
|
const last = stops[stops.length - 1];
|
|
32253
32231
|
if (position <= first2.position) {
|
|
@@ -32309,7 +32287,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options) {
|
|
|
32309
32287
|
if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
|
|
32310
32288
|
for (let i = bands; i >= 0; i -= 1) {
|
|
32311
32289
|
const t = i / bands;
|
|
32312
|
-
const { color, opacity } =
|
|
32290
|
+
const { color, opacity } = gradientColorAt(sorted, t * 100);
|
|
32313
32291
|
const left = lerpEdge(inner.left, 0, t);
|
|
32314
32292
|
const top = lerpEdge(inner.top, 0, t);
|
|
32315
32293
|
const right = lerpEdge(inner.right, 100, t);
|
|
@@ -32334,10 +32312,10 @@ function buildRectPathGradientExactSvg(stops, focalPoint, fillToRect) {
|
|
|
32334
32312
|
}
|
|
32335
32313
|
const sorted = [...stops].sort((a, b) => a.position - b.position);
|
|
32336
32314
|
const { left, top, right, bottom } = resolveInnerRect(fillToRect, focalPoint);
|
|
32337
|
-
const
|
|
32338
|
-
const alpha = (opacity, attr) => (opacity ?? 1) < 1 ? ` ${attr}="${
|
|
32315
|
+
const n2 = (value) => String(Math.round(value * 1e3) / 1e3);
|
|
32316
|
+
const alpha = (opacity, attr) => (opacity ?? 1) < 1 ? ` ${attr}="${n2(Math.max(0, opacity ?? 1))}"` : "";
|
|
32339
32317
|
const stopMarkup = sorted.map(
|
|
32340
|
-
(stop) => `<stop offset="${
|
|
32318
|
+
(stop) => `<stop offset="${n2(Math.min(Math.max(stop.position, 0), 100) / 100)}" stop-color="${stop.color}"${alpha(stop.opacity, "stop-opacity")}/>`
|
|
32341
32319
|
).join("");
|
|
32342
32320
|
const sides = [
|
|
32343
32321
|
{ id: "t", pts: [0, 0, 100, 0, right, top, left, top], v: [0, top, 0, 0], size: top },
|
|
@@ -32356,15 +32334,15 @@ function buildRectPathGradientExactSvg(stops, focalPoint, fillToRect) {
|
|
|
32356
32334
|
}
|
|
32357
32335
|
].filter((side) => side.size > 1e-3);
|
|
32358
32336
|
const defs = sides.map(
|
|
32359
|
-
(side) => `<linearGradient id="${side.id}" gradientUnits="userSpaceOnUse" x1="${
|
|
32337
|
+
(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>`
|
|
32360
32338
|
).join("");
|
|
32361
32339
|
const polygons = sides.map((side) => {
|
|
32362
|
-
const points = side.pts.map(
|
|
32340
|
+
const points = side.pts.map(n2);
|
|
32363
32341
|
const pairs = [0, 2, 4, 6].map((i) => `${points[i]},${points[i + 1]}`).join(" ");
|
|
32364
32342
|
return `<polygon points="${pairs}" fill="url(#${side.id})"/>`;
|
|
32365
32343
|
}).join("");
|
|
32366
32344
|
const first2 = sorted[0];
|
|
32367
|
-
const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${
|
|
32345
|
+
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")}/>` : "";
|
|
32368
32346
|
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>`;
|
|
32369
32347
|
}
|
|
32370
32348
|
function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
|
|
@@ -32372,6 +32350,152 @@ function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
|
|
|
32372
32350
|
return `url("data:image/svg+xml,${encodeURIComponent(markup).replace(/[()]/gu, (c) => c === "(" ? "%28" : "%29")}")`;
|
|
32373
32351
|
}
|
|
32374
32352
|
|
|
32353
|
+
// drawingml/shape-path-gradient.ts
|
|
32354
|
+
var CIRCLE_FIELD_PRESETS = new Set(
|
|
32355
|
+
[
|
|
32356
|
+
"chevron",
|
|
32357
|
+
"rightArrow",
|
|
32358
|
+
"leftArrow",
|
|
32359
|
+
"upArrow",
|
|
32360
|
+
"downArrow",
|
|
32361
|
+
"stripedRightArrow",
|
|
32362
|
+
"notchedRightArrow",
|
|
32363
|
+
"bentUpArrow",
|
|
32364
|
+
"bentArrow",
|
|
32365
|
+
"uturnArrow",
|
|
32366
|
+
"leftRightArrow",
|
|
32367
|
+
"upDownArrow",
|
|
32368
|
+
"leftUpArrow",
|
|
32369
|
+
"leftRightUpArrow",
|
|
32370
|
+
"quadArrow",
|
|
32371
|
+
"curvedRightArrow",
|
|
32372
|
+
"curvedLeftArrow",
|
|
32373
|
+
"curvedUpArrow",
|
|
32374
|
+
"curvedDownArrow",
|
|
32375
|
+
"swooshArrow",
|
|
32376
|
+
"lightningBolt",
|
|
32377
|
+
"sun",
|
|
32378
|
+
"moon",
|
|
32379
|
+
"smileyFace",
|
|
32380
|
+
"ribbon",
|
|
32381
|
+
"ribbon2",
|
|
32382
|
+
"ellipseRibbon",
|
|
32383
|
+
"ellipseRibbon2",
|
|
32384
|
+
"leftRightRibbon",
|
|
32385
|
+
"verticalScroll",
|
|
32386
|
+
"horizontalScroll",
|
|
32387
|
+
"wave",
|
|
32388
|
+
"doubleWave",
|
|
32389
|
+
"flowChartDocument",
|
|
32390
|
+
"flowChartMultidocument",
|
|
32391
|
+
"flowChartPunchedTape",
|
|
32392
|
+
"flowChartMagneticDisk",
|
|
32393
|
+
"flowChartDisplay"
|
|
32394
|
+
].map((name) => name.toLowerCase())
|
|
32395
|
+
);
|
|
32396
|
+
var LEGACY_FIELD_PRESETS = new Set(
|
|
32397
|
+
[
|
|
32398
|
+
"donut",
|
|
32399
|
+
"noSmoking",
|
|
32400
|
+
"blockArc",
|
|
32401
|
+
"frame",
|
|
32402
|
+
"chord",
|
|
32403
|
+
"funnel",
|
|
32404
|
+
"mathDivide",
|
|
32405
|
+
"mathNotEqual",
|
|
32406
|
+
"cornerTabs",
|
|
32407
|
+
"squareTabs",
|
|
32408
|
+
"plaqueTabs",
|
|
32409
|
+
"circularArrow",
|
|
32410
|
+
"leftCircularArrow",
|
|
32411
|
+
"leftRightCircularArrow",
|
|
32412
|
+
"flowChartMagneticTape",
|
|
32413
|
+
"flowChartMagneticDrum"
|
|
32414
|
+
].map((name) => name.toLowerCase())
|
|
32415
|
+
);
|
|
32416
|
+
function shapePathGradientField(preset) {
|
|
32417
|
+
if (!preset || preset === "custom") return "circle";
|
|
32418
|
+
const key = preset.toLowerCase();
|
|
32419
|
+
if (CIRCLE_FIELD_PRESETS.has(key)) return "circle";
|
|
32420
|
+
if (LEGACY_FIELD_PRESETS.has(key)) return "legacy";
|
|
32421
|
+
return "outline";
|
|
32422
|
+
}
|
|
32423
|
+
var BAND_COUNT2 = 100;
|
|
32424
|
+
function n(value) {
|
|
32425
|
+
return String(Math.round(value * 1e3) / 1e3);
|
|
32426
|
+
}
|
|
32427
|
+
var ARG_COUNT = { M: 2, L: 2, Q: 4, C: 6, A: 7, Z: 0 };
|
|
32428
|
+
function scalePathAbout(d, s, fx, fy) {
|
|
32429
|
+
const tokens = d.match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gu);
|
|
32430
|
+
if (!tokens) return void 0;
|
|
32431
|
+
const out = [];
|
|
32432
|
+
let i = 0;
|
|
32433
|
+
while (i < tokens.length) {
|
|
32434
|
+
const command = tokens[i++];
|
|
32435
|
+
const count = ARG_COUNT[command];
|
|
32436
|
+
if (count === void 0) return void 0;
|
|
32437
|
+
out.push(command);
|
|
32438
|
+
if (command === "Z") continue;
|
|
32439
|
+
const args = tokens.slice(i, i + count).map(Number);
|
|
32440
|
+
i += count;
|
|
32441
|
+
if (args.length !== count || args.some((value) => !Number.isFinite(value))) return void 0;
|
|
32442
|
+
if (command === "A") {
|
|
32443
|
+
out.push(
|
|
32444
|
+
n(args[0] * s),
|
|
32445
|
+
n(args[1] * s),
|
|
32446
|
+
n(args[2]),
|
|
32447
|
+
n(args[3]),
|
|
32448
|
+
n(args[4]),
|
|
32449
|
+
n(fx + (args[5] - fx) * s),
|
|
32450
|
+
n(fy + (args[6] - fy) * s)
|
|
32451
|
+
);
|
|
32452
|
+
continue;
|
|
32453
|
+
}
|
|
32454
|
+
for (let k = 0; k < count; k += 2) {
|
|
32455
|
+
out.push(n(fx + (args[k] - fx) * s), n(fy + (args[k + 1] - fy) * s));
|
|
32456
|
+
}
|
|
32457
|
+
}
|
|
32458
|
+
return out.join(" ");
|
|
32459
|
+
}
|
|
32460
|
+
function closedSubpaths(d) {
|
|
32461
|
+
const parts = d.split(/(?=M)/u).map((part) => part.trim()).filter((part) => part.endsWith("Z"));
|
|
32462
|
+
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
32463
|
+
}
|
|
32464
|
+
function buildOutlinePathGradientSvg(stops, d, width, height, focusX, focusY) {
|
|
32465
|
+
if (stops.length === 0 || !(width > 0) || !(height > 0)) return void 0;
|
|
32466
|
+
if (scalePathAbout(d, 1, 0, 0) === void 0) return void 0;
|
|
32467
|
+
const sorted = [...stops].sort((a, b) => a.position - b.position);
|
|
32468
|
+
const fx = focusX * width;
|
|
32469
|
+
const fy = focusY * height;
|
|
32470
|
+
const translucent = sorted.some((stop) => (stop.opacity ?? 1) < 1);
|
|
32471
|
+
const body = [];
|
|
32472
|
+
if (translucent) {
|
|
32473
|
+
for (let i = BAND_COUNT2; i >= 1; i -= 1) {
|
|
32474
|
+
const outer = scalePathAbout(d, i / BAND_COUNT2, fx, fy);
|
|
32475
|
+
if (outer === void 0) return void 0;
|
|
32476
|
+
const inner = i > 1 ? scalePathAbout(d, (i - 1) / BAND_COUNT2, fx, fy) : void 0;
|
|
32477
|
+
const { color, opacity } = gradientColorAt(sorted, (i - 0.5) / BAND_COUNT2 * 100);
|
|
32478
|
+
const alpha = opacity < 1 ? ` fill-opacity="${n(Math.max(0, opacity))}"` : "";
|
|
32479
|
+
body.push(
|
|
32480
|
+
`<path d="${outer}${inner ? ` ${inner}` : ""}" fill="${color}"${alpha} fill-rule="evenodd"/>`
|
|
32481
|
+
);
|
|
32482
|
+
}
|
|
32483
|
+
return wrap(width, height, body.join(""));
|
|
32484
|
+
}
|
|
32485
|
+
body.push(`<defs><path id="p" d="${d}"/></defs>`);
|
|
32486
|
+
for (let i = BAND_COUNT2; i >= 1; i -= 1) {
|
|
32487
|
+
const s = i / BAND_COUNT2;
|
|
32488
|
+
const { color } = gradientColorAt(sorted, (i - 0.5) / BAND_COUNT2 * 100);
|
|
32489
|
+
body.push(
|
|
32490
|
+
`<use href="#p" transform="matrix(${n(s)} 0 0 ${n(s)} ${n(fx * (1 - s))} ${n(fy * (1 - s))})" fill="${color}"/>`
|
|
32491
|
+
);
|
|
32492
|
+
}
|
|
32493
|
+
return wrap(width, height, body.join(""));
|
|
32494
|
+
}
|
|
32495
|
+
function wrap(width, height, body) {
|
|
32496
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n(width)} ${n(height)}" preserveAspectRatio="none">${body}</svg>`;
|
|
32497
|
+
}
|
|
32498
|
+
|
|
32375
32499
|
exports.DEFAULT_GENERATED_DIAGRAM_SCHEME = DEFAULT_GENERATED_DIAGRAM_SCHEME;
|
|
32376
32500
|
exports.DIAGRAM_ADD_SHAPE_COMMANDS = DIAGRAM_ADD_SHAPE_COMMANDS;
|
|
32377
32501
|
exports.DIAGRAM_ADD_SHAPE_LABEL = DIAGRAM_ADD_SHAPE_LABEL;
|
|
@@ -32427,6 +32551,7 @@ exports.buildFabricatedColorsXml = buildFabricatedColorsXml;
|
|
|
32427
32551
|
exports.buildFabricatedQuickStyleXml = buildFabricatedQuickStyleXml;
|
|
32428
32552
|
exports.buildForest = buildForest;
|
|
32429
32553
|
exports.buildGeneratedDiagramCache = buildGeneratedDiagramCache;
|
|
32554
|
+
exports.buildOutlinePathGradientSvg = buildOutlinePathGradientSvg;
|
|
32430
32555
|
exports.buildRectPathGradientExactSvg = buildRectPathGradientExactSvg;
|
|
32431
32556
|
exports.buildRectPathGradientImage = buildRectPathGradientImage;
|
|
32432
32557
|
exports.buildRectPathGradientSvg = buildRectPathGradientSvg;
|
|
@@ -32437,6 +32562,7 @@ exports.chooseAlgorithm = chooseAlgorithm;
|
|
|
32437
32562
|
exports.chooseAlgorithmOfType = chooseAlgorithmOfType;
|
|
32438
32563
|
exports.circleNode = circleNode;
|
|
32439
32564
|
exports.clampByRules = clampByRules;
|
|
32565
|
+
exports.closedSubpaths = closedSubpaths;
|
|
32440
32566
|
exports.collectFoldedDescendants = collectFoldedDescendants;
|
|
32441
32567
|
exports.collectTransitionText = collectTransitionText;
|
|
32442
32568
|
exports.computeDiagramDrawingBounds = computeDiagramDrawingBounds;
|
|
@@ -32481,6 +32607,7 @@ exports.foldedItemText = foldedItemText;
|
|
|
32481
32607
|
exports.formatDiagramSource = formatDiagramSource;
|
|
32482
32608
|
exports.formatXsdDouble = formatXsdDouble;
|
|
32483
32609
|
exports.generatedDrawingDigest = generatedDrawingDigest;
|
|
32610
|
+
exports.gradientColorAt = gradientColorAt;
|
|
32484
32611
|
exports.groupedChildren = groupedChildren;
|
|
32485
32612
|
exports.interpretSmartArtLayout = interpretSmartArtLayout;
|
|
32486
32613
|
exports.isDrawableDiagramShapeView = isDrawableDiagramShapeView;
|
|
@@ -32577,11 +32704,13 @@ exports.resolveTieredItemFontSize = resolveTieredItemFontSize;
|
|
|
32577
32704
|
exports.ruleAttributes = ruleAttributes;
|
|
32578
32705
|
exports.runEngineLayout = runEngineLayout;
|
|
32579
32706
|
exports.runSmartArtEngine = runSmartArtEngine;
|
|
32707
|
+
exports.scalePathAbout = scalePathAbout;
|
|
32580
32708
|
exports.selectArrangedNodes = selectArrangedNodes;
|
|
32581
32709
|
exports.selectConstraints = selectConstraints;
|
|
32582
32710
|
exports.setDiagramNodeStyle = setDiagramNodeStyle;
|
|
32583
32711
|
exports.setDiagramNodeText = setDiagramNodeText;
|
|
32584
32712
|
exports.setDrawingFillXml = setDrawingFillXml;
|
|
32713
|
+
exports.shapePathGradientField = shapePathGradientField;
|
|
32585
32714
|
exports.smartArtChildrenOf = smartArtChildrenOf;
|
|
32586
32715
|
exports.structuralChooseAlgDepth = structuralChooseAlgDepth;
|
|
32587
32716
|
exports.styleContext = styleContext;
|