@aiderdesk/aiderdesk 0.77.0 → 0.78.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.
Files changed (83) hide show
  1. package/out/renderer/assets/{AgentSettings-B73lGg-P.js → AgentSettings-mSGpRs0A.js} +1228 -4469
  2. package/out/renderer/assets/{InfoIcon-BaDK-htg.js → InfoIcon-Dllba1sv.js} +1 -1
  3. package/out/renderer/assets/{Onboarding-CttlAepw.js → Onboarding-D_AT4vxY.js} +4 -4
  4. package/out/renderer/assets/{ProviderHeader-B0-K9908.js → ProviderHeader-DAchpkUt.js} +8 -20
  5. package/out/renderer/assets/{SettingsPage-BtyX7Wv1.js → SettingsPage-DPaPSR-0.js} +5612 -291
  6. package/out/renderer/assets/{UsageDashboard-CKuev9SP.js → UsageDashboard-CfP-txzz.js} +3 -3
  7. package/out/renderer/assets/abnfDiagram-N423BO3Z-tqPb0OUs.js +118 -0
  8. package/out/renderer/assets/{arc-CDCMm4PF.js → arc-lUzj6CoE.js} +1 -1
  9. package/out/renderer/assets/{architectureDiagram-3BPJPVTR-DoyTFQYe.js → architectureDiagram-T3A2C74G-CuNUo8J6.js} +242 -133
  10. package/out/renderer/assets/{blockDiagram-GPEHLZMM-CophuS51.js → blockDiagram-VBNYF7ZC-CIiOkZ_D.js} +76 -77
  11. package/out/renderer/assets/{c4Diagram-AAUBKEIU-Dc3YxNWW.js → c4Diagram-5PPSVZJV-DcgBNVnI.js} +2 -2
  12. package/out/renderer/assets/{channel-cZzRDUFG.js → channel-PMBABQAa.js} +1 -1
  13. package/out/renderer/assets/{chunk-ND2GUHAM-BWiS_Ttp.js → chunk-2GRJ4B5K-CJI-utiZ.js} +4 -4
  14. package/out/renderer/assets/{chunk-QZHKN3VN-4NHol9Dz.js → chunk-2Q5K7J3B-D8LOcAuY.js} +1 -1
  15. package/out/renderer/assets/{chunk-AQP2D5EJ-CYCp3XBh.js → chunk-5RXB4S5H-dp0xqMbI.js} +67 -32
  16. package/out/renderer/assets/{chunk-FMBD7UC4-DIj-DOVN.js → chunk-5VM5RSS4-D731WvT8.js} +1 -1
  17. package/out/renderer/assets/chunk-6Q2QTUOP-BjzdFhNB.js +860 -0
  18. package/out/renderer/assets/{chunk-727SXJPM-CPUXDO_8.js → chunk-GF5L2VYU-Ct3zh1DW.js} +18 -8
  19. package/out/renderer/assets/{chunk-4BX2VUAB-DKNGjk29.js → chunk-JWPE2WC7-OPg0X7jU.js} +1 -1
  20. package/out/renderer/assets/{chunk-2J33WTMH-YV6ZtOyU.js → chunk-KBJHAD2P-qbM4OnIO.js} +1 -1
  21. package/out/renderer/assets/{dagre-BM42HDAG-5_V5lQc0.js → chunk-RYQCIY6F-DQI4Jds6.js} +85 -316
  22. package/out/renderer/assets/{chunk-55IACEB6-MkIW5gHI.js → chunk-XXDRQBXY-D_LC4QkV.js} +1 -1
  23. package/out/renderer/assets/{classDiagram-4FO5ZUOK-C1yfJEIb.js → classDiagram-JCYQIIEL-D4e_9tkA.js} +6 -6
  24. package/out/renderer/assets/{classDiagram-v2-Q7XG4LA2-C1yfJEIb.js → classDiagram-v2-OCEON4UE-D4e_9tkA.js} +6 -6
  25. package/out/renderer/assets/{cose-bilkent-S5V4N54A-B8D60fQa.js → cose-bilkent-JH36ORCC-tRlBuEjd.js} +2 -2
  26. package/out/renderer/assets/{wardley-L42UT6IY-CsNzYaF9.js → cynefin-VYW2F7L2-BiEI2vQb.js} +1527 -120
  27. package/out/renderer/assets/cynefinDiagram-MW4NZA55-DBSV1HcE.js +453 -0
  28. package/out/renderer/assets/{cytoscape.esm-BNSvh83I.js → cytoscape.esm-Bx_1tVW-.js} +160 -67
  29. package/out/renderer/assets/dagre-VZM6K2ZE-DRrMrSSw.js +522 -0
  30. package/out/renderer/assets/diagram-7IWD3JNH-CreTV9nH.js +488 -0
  31. package/out/renderer/assets/{diagram-KO2AKTUF-So0t9fVd.js → diagram-B4RE2ZJO-3tlgxoIb.js} +3 -3
  32. package/out/renderer/assets/{diagram-LMA3HP47-CbSRJgt4.js → diagram-LBJQPF4R-BFO2qTLJ.js} +3 -3
  33. package/out/renderer/assets/{diagram-OG6HWLK6-Bls2tZCJ.js → diagram-Q27KOJAE-BDgXUH9Q.js} +30 -24
  34. package/out/renderer/assets/{diagram-2AECGRRQ-Bb4cbiKY.js → diagram-UB23O5K3-Qw-ipaCG.js} +18 -8
  35. package/out/renderer/assets/ebnfDiagram-BXEA7PRR-izS1zYs0.js +138 -0
  36. package/out/renderer/assets/{erDiagram-TEJ5UH35-CESbOlvh.js → erDiagram-JOGREHBK-ld9lNh2F.js} +88 -77
  37. package/out/renderer/assets/{flowDiagram-I6XJVG4X-B-35DKDx.js → flowDiagram-UKHOOZJN-g11KS_zg.js} +112 -96
  38. package/out/renderer/assets/{ganttDiagram-6RSMTGT7-BL1OQkTj.js → ganttDiagram-PKOTCBZU-CMsbJWqv.js} +31 -19
  39. package/out/renderer/assets/{gitGraphDiagram-PVQCEYII-SJkGLAAz.js → gitGraphDiagram-DS77QQ5N-CKiYKjBJ.js} +4 -4
  40. package/out/renderer/assets/{graph-BSxR7Gef.js → graph--1WSNErU.js} +10 -10
  41. package/out/renderer/assets/{index-BqZxyppq.js → index-BJGP-Ed0.js} +1 -1
  42. package/out/renderer/assets/{index-NF_MxNl9.js → index-BSQTFZZV.js} +1 -1
  43. package/out/renderer/assets/{index-xCqv98zj.js → index-BSRjTKaQ.js} +1 -1
  44. package/out/renderer/assets/{index-Cmn9J2p1.js → index-BahRAP01.js} +2586 -1866
  45. package/out/renderer/assets/{index-DGcKtfCM.js → index-BbYkC4ZX.js} +1 -1
  46. package/out/renderer/assets/{index-VX8ukL4o.js → index-BktqS5iT.js} +1 -1
  47. package/out/renderer/assets/{index-DFODyrlX.js → index-DJfxm3SJ.js} +3 -3
  48. package/out/renderer/assets/{index-BVOpoJw8.js → index-DqZ8FyZG.js} +1 -1
  49. package/out/renderer/assets/{index-HJk8ZKtm.js → index-r15oFU5X.js} +1 -1
  50. package/out/renderer/assets/{index-DgDxO_E3.js → index-xC4jIIdf.js} +1 -1
  51. package/out/renderer/assets/{infoDiagram-5YYISTIA-lRTvqfXx.js → infoDiagram-6WML65LV-CZoJK8b2.js} +3 -3
  52. package/out/renderer/assets/{ishikawaDiagram-YF4QCWOH-CtsU-ctO.js → ishikawaDiagram-WSZJBQD7-BrUuSNZ-.js} +1 -1
  53. package/out/renderer/assets/{journeyDiagram-JHISSGLW-3MrLeKXj.js → journeyDiagram-NVQOT4AX-w91U6vB5.js} +4 -4
  54. package/out/renderer/assets/{jsx-dev-runtime-BTcJ8PkQ.js → jsx-dev-runtime-Bu2_G2cv.js} +1 -1
  55. package/out/renderer/assets/{kanban-definition-UN3LZRKU-CinUVJ12.js → kanban-definition-27J2QSJJ-DVuGbAnS.js} +2 -2
  56. package/out/renderer/assets/{katex-Co8xHYNH.js → katex-oVG3DVWa.js} +4039 -4063
  57. package/out/renderer/assets/{layout-C9eRMSnE.js → layout-BA4uCGdL.js} +36 -320
  58. package/out/renderer/assets/{linear-WwW43_Ig.js → linear-CWQmShZV.js} +1 -1
  59. package/out/renderer/assets/map-DSwlVIuN.js +299 -0
  60. package/out/renderer/assets/{mindmap-definition-RKZ34NQL-B-K0dkdA.js → mindmap-definition-FAOFIHXS-CbswsknG.js} +3 -3
  61. package/out/renderer/assets/pegDiagram-VL7TDLO6-CCqeWB6l.js +126 -0
  62. package/out/renderer/assets/{pieDiagram-4H26LBE5-eotxzUOT.js → pieDiagram-7S7Q4E2Y-Chd5qh8F.js} +89 -19
  63. package/out/renderer/assets/{quadrantDiagram-W4KKPZXB-BtKKvYmW.js → quadrantDiagram-CIZ2JOQS-CzmUVvXi.js} +8 -9
  64. package/out/renderer/assets/railroadDiagram-AXF67PYL-CXY83yzR.js +92 -0
  65. package/out/renderer/assets/{requirementDiagram-4Y6WPE33-k_JQl4AM.js → requirementDiagram-LRYGKXZP-DToxgkKr.js} +3 -3
  66. package/out/renderer/assets/{sankeyDiagram-5OEKKPKP-BVDWaFSn.js → sankeyDiagram-W5VNT64P-CRs67mfK.js} +1 -1
  67. package/out/renderer/assets/{sequenceDiagram-3UESZ5HK-dpVnolZO.js → sequenceDiagram-SI44F4Z6-CzmgqSt2.js} +11 -11
  68. package/out/renderer/assets/sizeCapture-X5ZJPWSS-mheyKWG9.js +62 -0
  69. package/out/renderer/assets/{stateDiagram-AJRCARHV-DYd-R9tJ.js → stateDiagram-OKZ733FA-DGyuxXU_.js} +8 -6
  70. package/out/renderer/assets/{stateDiagram-v2-BHNVJYJU-CyE2HX6z.js → stateDiagram-v2-UEYNNEHI-TldVLbtJ.js} +5 -4
  71. package/out/renderer/assets/swimlanes-SLNWSIFB-B3lFy2HE.js +8557 -0
  72. package/out/renderer/assets/swimlanesDiagram-ULZ7WXOC-BxN-HDA3.js +20 -0
  73. package/out/renderer/assets/{time-Claj2vse.js → time-DcFzC-ob.js} +1 -1
  74. package/out/renderer/assets/{timeline-definition-PNZ67QCA-0vKYrH6S.js → timeline-definition-Z64GVDOM-DQ7vCcJR.js} +2 -2
  75. package/out/renderer/assets/{vennDiagram-CIIHVFJN-op3DVQGG.js → vennDiagram-T6HMQDX7-MrgLWWY3.js} +32 -3
  76. package/out/renderer/assets/{wardleyDiagram-YWT4CUSO-D3jK8kAv.js → wardleyDiagram-T6FBY63Y-BCA6xyJ2.js} +3 -3
  77. package/out/renderer/assets/{xychartDiagram-2RQKCTM6-C9wPvZAU.js → xychartDiagram-ELKLHX3M-BZmPte5b.js} +125 -57
  78. package/out/renderer/index.html +1 -1
  79. package/out/renderer/sw.js +4 -0
  80. package/out/resources/skills/extension-creator/references/extension-interface.md +3 -0
  81. package/out/runner.js +4902 -3209
  82. package/package.json +5 -4
  83. package/out/renderer/assets/diagram-5GNKFQAL-DQ_vjlxb.js +0 -169
@@ -1,8 +1,8 @@
1
- import { g as getIconStyles } from "./chunk-FMBD7UC4-DIj-DOVN.js";
2
- import { c as createTooltip } from "./chunk-ND2GUHAM-BWiS_Ttp.js";
3
- import { g as getDiagramElement } from "./chunk-55IACEB6-MkIW5gHI.js";
4
- import { s as setupViewPortForSVG } from "./chunk-2J33WTMH-YV6ZtOyU.js";
5
- import { _ as __name, O as log, L as getConfig2, a2 as getRegisteredLayoutAlgorithm, a3 as render, a4 as utils_default, N as select, ab as purify, K as setAccTitle, J as getAccTitle, C as setAccDescription, H as getAccDescription, a5 as setDiagramTitle, a6 as getDiagramTitle, Z as common_default, ac as clear, aa as getEdgeId, W as sanitizeText, aM as parseGenericTypes } from "./index-Cmn9J2p1.js";
1
+ import { g as getIconStyles } from "./chunk-5VM5RSS4-D731WvT8.js";
2
+ import { g as getDiagramElement } from "./chunk-XXDRQBXY-D_LC4QkV.js";
3
+ import { s as setupViewPortForSVG } from "./chunk-KBJHAD2P-qbM4OnIO.js";
4
+ import { _ as __name, O as log, L as getConfig2, a9 as getRegisteredLayoutAlgorithm, aa as render, ab as utils_default, N as select, aJ as purify, K as setAccTitle, J as getAccTitle, C as setAccDescription, H as getAccDescription, a3 as setDiagramTitle, a4 as getDiagramTitle, Z as common_default, a5 as clear, a6 as getEdgeId, W as sanitizeText, aK as parseGenericTypes } from "./index-BahRAP01.js";
5
+ import { f as createTooltip } from "./chunk-2GRJ4B5K-CJI-utiZ.js";
6
6
  var parser = (function() {
7
7
  var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
8
8
  for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
@@ -1342,6 +1342,7 @@ var ClassDB = class _ClassDB {
1342
1342
  if (/\d/.exec(_id[0])) {
1343
1343
  id = MERMAID_DOM_ID_PREFIX + id;
1344
1344
  }
1345
+ id = this.splitClassNameAndType(id).className;
1345
1346
  const classNode = this.classes.get(id);
1346
1347
  if (classNode) {
1347
1348
  classNode.cssClasses += " " + className;
@@ -1380,7 +1381,11 @@ var ClassDB = class _ClassDB {
1380
1381
  setTooltip(ids, tooltip) {
1381
1382
  ids.split(",").forEach((id) => {
1382
1383
  if (tooltip !== void 0) {
1383
- this.classes.get(id).tooltip = sanitizeText2(tooltip);
1384
+ const className = this.splitClassNameAndType(id).className;
1385
+ const classNode = this.classes.get(className);
1386
+ if (classNode) {
1387
+ classNode.tooltip = sanitizeText2(tooltip);
1388
+ }
1384
1389
  }
1385
1390
  });
1386
1391
  }
@@ -1404,6 +1409,7 @@ var ClassDB = class _ClassDB {
1404
1409
  if (/\d/.exec(_id[0])) {
1405
1410
  id = MERMAID_DOM_ID_PREFIX + id;
1406
1411
  }
1412
+ id = this.splitClassNameAndType(id).className;
1407
1413
  const theClass = this.classes.get(id);
1408
1414
  if (theClass) {
1409
1415
  theClass.link = utils_default.formatUrl(linkStr, config);
@@ -1428,7 +1434,11 @@ var ClassDB = class _ClassDB {
1428
1434
  setClickEvent(ids, functionName, functionArgs) {
1429
1435
  ids.split(",").forEach((id) => {
1430
1436
  this.setClickFunc(id, functionName, functionArgs);
1431
- this.classes.get(id).haveCallback = true;
1437
+ const className = this.splitClassNameAndType(id).className;
1438
+ const classNode = this.classes.get(className);
1439
+ if (classNode) {
1440
+ classNode.haveCallback = true;
1441
+ }
1432
1442
  });
1433
1443
  this.setCssClass(ids, "clickable");
1434
1444
  }
@@ -1441,7 +1451,7 @@ var ClassDB = class _ClassDB {
1441
1451
  if (functionName === void 0) {
1442
1452
  return;
1443
1453
  }
1444
- const id = domId;
1454
+ const id = this.splitClassNameAndType(domId).className;
1445
1455
  if (this.classes.has(id)) {
1446
1456
  let argList = [];
1447
1457
  if (typeof functionArgs === "string") {
@@ -1,4 +1,4 @@
1
- import { _ as __name } from "./index-Cmn9J2p1.js";
1
+ import { _ as __name } from "./index-BahRAP01.js";
2
2
  function populateCommonDb(ast, db) {
3
3
  if (ast.accDescr) {
4
4
  db.setAccDescription?.(ast.accDescr);
@@ -1,4 +1,4 @@
1
- import { _ as __name, Q as configureSvgSize, O as log } from "./index-Cmn9J2p1.js";
1
+ import { _ as __name, Q as configureSvgSize, O as log } from "./index-BahRAP01.js";
2
2
  var setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding, cssDiagram, useMaxWidth) => {
3
3
  svg.attr("class", cssDiagram);
4
4
  const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
@@ -1,6 +1,6 @@
1
- import { _ as __name, bM as markers_default, bN as clear2, bO as clear, bP as clear$1, O as log, L as getConfig2, bQ as updateNodeBounds, bR as setNodeElem, aX as insertNode, bH as getSubGraphTitleMargins, aY as positionNode, aW as insertCluster, bS as insertEdge, bT as positionEdgeLabel, bU as insertEdgeLabel } from "./index-Cmn9J2p1.js";
2
- import { i as isUndefined, G as Graph } from "./graph-BSxR7Gef.js";
3
- import { b as baseClone, m as map, l as layout } from "./layout-C9eRMSnE.js";
1
+ import { _ as __name, O as log } from "./index-BahRAP01.js";
2
+ import { i as isUndefined, G as Graph } from "./graph--1WSNErU.js";
3
+ import { b as baseClone, m as map } from "./map-DSwlVIuN.js";
4
4
  var CLONE_SYMBOLS_FLAG = 4;
5
5
  function clone(value) {
6
6
  return baseClone(value, CLONE_SYMBOLS_FLAG);
@@ -50,7 +50,7 @@ function writeEdges(g) {
50
50
  var clusterDb = /* @__PURE__ */ new Map();
51
51
  var descendants = /* @__PURE__ */ new Map();
52
52
  var parents = /* @__PURE__ */ new Map();
53
- var clear4 = /* @__PURE__ */ __name(() => {
53
+ var clear = /* @__PURE__ */ __name(() => {
54
54
  descendants.clear();
55
55
  parents.clear();
56
56
  clusterDb.clear();
@@ -121,9 +121,19 @@ var copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {
121
121
  log.info("Edge data", data2, rootId);
122
122
  try {
123
123
  if (edgeInCluster(edge, rootId)) {
124
- log.info("Copying as ", edge.v, edge.w, data2, edge.name);
125
- newGraph.setEdge(edge.v, edge.w, data2, edge.name);
126
- log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));
124
+ const rootDescendants = descendants.get(rootId) || [];
125
+ const vIn = rootDescendants.includes(edge.v) || isDescendant(edge.v, rootId) || edge.v === rootId;
126
+ const wIn = rootDescendants.includes(edge.w) || isDescendant(edge.w, rootId) || edge.w === rootId;
127
+ if (vIn && wIn) {
128
+ log.info("Copying as ", edge.v, edge.w, data2, edge.name);
129
+ newGraph.setEdge(edge.v, edge.w, data2, edge.name);
130
+ log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));
131
+ } else {
132
+ const newV = vIn ? rootId : edge.v;
133
+ const newW = wIn ? rootId : edge.w;
134
+ log.info("Rebinding cross-boundary edge as ", newV, newW, data2, edge.name);
135
+ graph.setEdge(newV, newW, data2, edge.name);
136
+ }
127
137
  } else {
128
138
  log.info(
129
139
  "Skipping copy of edge ",
@@ -244,6 +254,13 @@ var adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {
244
254
  if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {
245
255
  clusterDb.get(id).id = parent;
246
256
  }
257
+ const hasDirectOutgoingEdge = graph.edges().some((edge) => edge.v === id);
258
+ if (nonClusterChild && clusterDb.get(id)?.externalConnections && hasDirectOutgoingEdge && isNodeInExtractableCluster(graph, nonClusterChild, id)) {
259
+ const safeAnchor = findSafeAnchorNode(graph, id, graph.parent(nonClusterChild));
260
+ if (safeAnchor) {
261
+ clusterDb.get(id).id = safeAnchor;
262
+ }
263
+ }
247
264
  }
248
265
  graph.edges().forEach(function(e) {
249
266
  const edge = graph.edge(e);
@@ -316,6 +333,36 @@ var extractor = /* @__PURE__ */ __name((graph, depth) => {
316
333
  );
317
334
  if (!clusterDb.has(node)) {
318
335
  log.debug("Not a cluster", node, depth);
336
+ } else if (clusterDb.get(node)?.clusterData?.explicitDir && graph.children(node) && graph.children(node).length > 0) {
337
+ log.warn("Cluster with explicit dir, creating subgraph for children", node, depth);
338
+ const dir = clusterDb.get(node).clusterData.dir;
339
+ const clusterGraph = new Graph({
340
+ multigraph: true,
341
+ compound: true
342
+ }).setGraph({
343
+ rankdir: dir,
344
+ nodesep: 50,
345
+ ranksep: 50,
346
+ marginx: 8,
347
+ marginy: 8
348
+ }).setDefaultEdgeLabel(function() {
349
+ return {};
350
+ });
351
+ copy(node, graph, clusterGraph, node);
352
+ const clusterNodeData = graph.node(node) || {};
353
+ graph.setNode(node, {
354
+ ...clusterNodeData,
355
+ clusterNode: true,
356
+ id: node,
357
+ clusterData: clusterDb.get(node).clusterData,
358
+ label: clusterDb.get(node).label,
359
+ graph: clusterGraph
360
+ });
361
+ log.warn(
362
+ "Subgraph for cluster with explicit dir created:",
363
+ node,
364
+ write(clusterGraph)
365
+ );
319
366
  } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {
320
367
  log.warn(
321
368
  "Cluster without external connections, without a parent and with children",
@@ -340,16 +387,16 @@ var extractor = /* @__PURE__ */ __name((graph, depth) => {
340
387
  }).setDefaultEdgeLabel(function() {
341
388
  return {};
342
389
  });
343
- log.warn("Old graph before copy", write(graph));
344
390
  copy(node, graph, clusterGraph, node);
391
+ const clusterNodeData = graph.node(node) || {};
345
392
  graph.setNode(node, {
393
+ ...clusterNodeData,
346
394
  clusterNode: true,
347
395
  id: node,
348
396
  clusterData: clusterDb.get(node).clusterData,
349
397
  label: clusterDb.get(node).label,
350
398
  graph: clusterGraph
351
399
  });
352
- log.warn("New graph after copy node: (", node, ")", write(clusterGraph));
353
400
  log.debug("Old graph after copy", write(graph));
354
401
  } else {
355
402
  log.warn(
@@ -390,316 +437,38 @@ var sorter = /* @__PURE__ */ __name((graph, nodes) => {
390
437
  return result;
391
438
  }, "sorter");
392
439
  var sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), "sortNodesByHierarchy");
393
- var recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id, parentCluster, siteConfig) => {
394
- log.warn("Graph in recursive render:XAX", write(graph), parentCluster);
395
- const dir = graph.graph().rankdir;
396
- log.trace("Dir in recursive render - dir:", dir);
397
- const elem = _elem.insert("g").attr("class", "root");
398
- if (!graph.nodes()) {
399
- log.info("No nodes found for", graph);
400
- } else {
401
- log.info("Recursive render XXX", graph.nodes());
402
- }
403
- if (graph.edges().length > 0) {
404
- log.info("Recursive edges", graph.edge(graph.edges()[0]));
440
+ var isNodeInExtractableCluster = /* @__PURE__ */ __name((graph, node, rootId) => {
441
+ let parent = graph.parent(node);
442
+ while (parent && parent !== rootId) {
443
+ const cluster = clusterDb.get(parent);
444
+ if (cluster && !cluster.externalConnections) {
445
+ return true;
446
+ }
447
+ parent = graph.parent(parent);
405
448
  }
406
- const clusters = elem.insert("g").attr("class", "clusters");
407
- const edgePaths = elem.insert("g").attr("class", "edgePaths");
408
- const edgeLabels = elem.insert("g").attr("class", "edgeLabels");
409
- const nodes = elem.insert("g").attr("class", "nodes");
410
- await Promise.all(
411
- graph.nodes().map(async function(v) {
412
- const node = graph.node(v);
413
- if (parentCluster !== void 0) {
414
- const data = JSON.parse(JSON.stringify(parentCluster.clusterData));
415
- log.trace(
416
- "Setting data for parent cluster XXX\n Node.id = ",
417
- v,
418
- "\n data=",
419
- data.height,
420
- "\nParent cluster",
421
- parentCluster.height
422
- );
423
- graph.setNode(parentCluster.id, data);
424
- if (!graph.parent(v)) {
425
- log.trace("Setting parent", v, parentCluster.id);
426
- graph.setParent(v, parentCluster.id, data);
427
- }
428
- }
429
- log.info("(Insert) Node XXX" + v + ": " + JSON.stringify(graph.node(v)));
430
- if (node?.clusterNode) {
431
- log.info("Cluster identified XBX", v, node.width, graph.node(v));
432
- const { ranksep, nodesep } = graph.graph();
433
- node.graph.setGraph({
434
- ...node.graph.graph(),
435
- ranksep: ranksep + 25,
436
- nodesep
437
- });
438
- const o = await recursiveRender(
439
- nodes,
440
- node.graph,
441
- diagramType,
442
- id,
443
- graph.node(v),
444
- siteConfig
445
- );
446
- const newEl = o.elem;
447
- updateNodeBounds(node, newEl);
448
- node.diff = o.diff || 0;
449
- log.info(
450
- "New compound node after recursive render XAX",
451
- v,
452
- "width",
453
- // node,
454
- node.width,
455
- "height",
456
- node.height
457
- // node.x,
458
- // node.y
459
- );
460
- setNodeElem(newEl, node);
461
- } else {
462
- if (graph.children(v).length > 0) {
463
- log.trace(
464
- "Cluster - the non recursive path XBX",
465
- v,
466
- node.id,
467
- node,
468
- node.width,
469
- "Graph:",
470
- graph
471
- );
472
- log.trace(findNonClusterChild(node.id, graph));
473
- clusterDb.set(node.id, { id: findNonClusterChild(node.id, graph), node });
474
- } else {
475
- log.trace("Node - the non recursive path XAX", v, nodes, graph.node(v), dir);
476
- await insertNode(nodes, graph.node(v), { config: siteConfig, dir });
477
- }
478
- }
479
- })
480
- );
481
- const processEdges = /* @__PURE__ */ __name(async () => {
482
- const edgePromises = graph.edges().map(async function(e) {
483
- const edge = graph.edge(e.v, e.w, e.name);
484
- log.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e));
485
- log.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(graph.edge(e)));
486
- log.info(
487
- "Fix",
488
- clusterDb,
489
- "ids:",
490
- e.v,
491
- e.w,
492
- "Translating: ",
493
- clusterDb.get(e.v),
494
- clusterDb.get(e.w)
495
- );
496
- await insertEdgeLabel(edgeLabels, edge);
497
- });
498
- await Promise.all(edgePromises);
499
- }, "processEdges");
500
- await processEdges();
501
- log.info("Graph before layout:", JSON.stringify(write(graph)));
502
- log.info("############################################# XXX");
503
- log.info("### Layout ### XXX");
504
- log.info("############################################# XXX");
505
- layout(graph);
506
- log.info("Graph after layout:", JSON.stringify(write(graph)));
507
- let diff = 0;
508
- let { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);
509
- await Promise.all(
510
- sortNodesByHierarchy(graph).map(async function(v) {
511
- const node = graph.node(v);
512
- log.info(
513
- "Position XBX => " + v + ": (" + node.x,
514
- "," + node.y,
515
- ") width: ",
516
- node.width,
517
- " height: ",
518
- node.height
519
- );
520
- if (node?.clusterNode) {
521
- node.y += subGraphTitleTotalMargin;
522
- log.info(
523
- "A tainted cluster node XBX1",
524
- v,
525
- node.id,
526
- node.width,
527
- node.height,
528
- node.x,
529
- node.y,
530
- graph.parent(v)
531
- );
532
- clusterDb.get(node.id).node = node;
533
- positionNode(node);
534
- } else {
535
- if (graph.children(v).length > 0) {
536
- log.info(
537
- "A pure cluster node XBX1",
538
- v,
539
- node.id,
540
- node.x,
541
- node.y,
542
- node.width,
543
- node.height,
544
- graph.parent(v)
545
- );
546
- node.height += subGraphTitleTotalMargin;
547
- graph.node(node.parentId);
548
- const halfPadding = node?.padding / 2 || 0;
549
- const labelHeight = node?.labelBBox?.height || 0;
550
- const offsetY = labelHeight - halfPadding || 0;
551
- log.debug("OffsetY", offsetY, "labelHeight", labelHeight, "halfPadding", halfPadding);
552
- await insertCluster(clusters, node);
553
- clusterDb.get(node.id).node = node;
554
- } else {
555
- const parent = graph.node(node.parentId);
556
- node.y += subGraphTitleTotalMargin / 2;
557
- log.info(
558
- "A regular node XBX1 - using the padding",
559
- node.id,
560
- "parent",
561
- node.parentId,
562
- node.width,
563
- node.height,
564
- node.x,
565
- node.y,
566
- "offsetY",
567
- node.offsetY,
568
- "parent",
569
- parent,
570
- parent?.offsetY,
571
- node
572
- );
573
- positionNode(node);
574
- }
575
- }
576
- })
577
- );
578
- graph.edges().forEach(function(e) {
579
- const edge = graph.edge(e);
580
- log.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(edge), edge);
581
- edge.points.forEach((point) => point.y += subGraphTitleTotalMargin / 2);
582
- const startNode = graph.node(e.v);
583
- var endNode = graph.node(e.w);
584
- const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id);
585
- positionEdgeLabel(edge, paths);
586
- });
587
- graph.nodes().forEach(function(v) {
588
- const n = graph.node(v);
589
- log.info(v, n.type, n.diff);
590
- if (n.isGroup) {
591
- diff = n.diff;
449
+ return false;
450
+ }, "isNodeInExtractableCluster");
451
+ var findSafeAnchorNode = /* @__PURE__ */ __name((graph, clusterId, excludedCluster) => {
452
+ const children = graph.children(clusterId) ?? [];
453
+ for (const child of children) {
454
+ if (child === excludedCluster || isDescendant(child, excludedCluster)) {
455
+ continue;
592
456
  }
593
- });
594
- log.warn("Returning from recursive render XAX", elem, diff);
595
- return { elem, diff };
596
- }, "recursiveRender");
597
- var render = /* @__PURE__ */ __name(async (data4Layout, svg) => {
598
- const graph = new Graph({
599
- multigraph: true,
600
- compound: true
601
- }).setGraph({
602
- rankdir: data4Layout.direction,
603
- nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing,
604
- ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing,
605
- marginx: 8,
606
- marginy: 8
607
- }).setDefaultEdgeLabel(function() {
608
- return {};
609
- });
610
- const element = svg.select("g");
611
- markers_default(element, data4Layout.markers, data4Layout.type, data4Layout.diagramId);
612
- clear2();
613
- clear();
614
- clear$1();
615
- clear4();
616
- data4Layout.nodes.forEach((node) => {
617
- graph.setNode(node.id, { ...node });
618
- if (node.parentId) {
619
- graph.setParent(node.id, node.parentId);
457
+ const candidate = findNonClusterChild(child, graph, clusterId);
458
+ if (!candidate) {
459
+ continue;
620
460
  }
621
- });
622
- log.debug("Edges:", data4Layout.edges);
623
- data4Layout.edges.forEach((edge) => {
624
- if (edge.start === edge.end) {
625
- const nodeId = edge.start;
626
- const specialId1 = nodeId + "---" + nodeId + "---1";
627
- const specialId2 = nodeId + "---" + nodeId + "---2";
628
- const node = graph.node(nodeId);
629
- graph.setNode(specialId1, {
630
- domId: specialId1,
631
- id: specialId1,
632
- parentId: node.parentId,
633
- labelStyle: "",
634
- label: "",
635
- padding: 0,
636
- shape: "labelRect",
637
- // shape: 'rect',
638
- style: "",
639
- width: 10,
640
- height: 10
641
- });
642
- graph.setParent(specialId1, node.parentId);
643
- graph.setNode(specialId2, {
644
- domId: specialId2,
645
- id: specialId2,
646
- parentId: node.parentId,
647
- labelStyle: "",
648
- padding: 0,
649
- // shape: 'rect',
650
- shape: "labelRect",
651
- label: "",
652
- style: "",
653
- width: 10,
654
- height: 10
655
- });
656
- graph.setParent(specialId2, node.parentId);
657
- const edge1 = structuredClone(edge);
658
- const edgeMid = structuredClone(edge);
659
- const edge2 = structuredClone(edge);
660
- edge1.label = "";
661
- edge1.arrowTypeEnd = "none";
662
- edge1.endLabelLeft = "";
663
- edge1.endLabelRight = "";
664
- edge1.startLabelLeft = "";
665
- edge1.id = nodeId + "-cyclic-special-1";
666
- edgeMid.startLabelRight = "";
667
- edgeMid.startLabelLeft = "";
668
- edgeMid.endLabelLeft = "";
669
- edgeMid.endLabelRight = "";
670
- edgeMid.arrowTypeStart = "none";
671
- edgeMid.arrowTypeEnd = "none";
672
- edgeMid.id = nodeId + "-cyclic-special-mid";
673
- edge2.label = "";
674
- edge2.startLabelRight = "";
675
- edge2.startLabelLeft = "";
676
- edge2.arrowTypeStart = "none";
677
- if (node.isGroup) {
678
- edge1.fromCluster = nodeId;
679
- edge2.toCluster = nodeId;
680
- }
681
- edge2.id = nodeId + "-cyclic-special-2";
682
- edge2.arrowTypeStart = "none";
683
- graph.setEdge(nodeId, specialId1, edge1, nodeId + "-cyclic-special-0");
684
- graph.setEdge(specialId1, specialId2, edgeMid, nodeId + "-cyclic-special-1");
685
- graph.setEdge(specialId2, nodeId, edge2, nodeId + "-cyc<lic-special-2");
686
- } else {
687
- graph.setEdge(edge.start, edge.end, { ...edge }, edge.id);
461
+ if (!isNodeInExtractableCluster(graph, candidate, clusterId)) {
462
+ return candidate;
688
463
  }
689
- });
690
- log.warn("Graph at first:", JSON.stringify(write(graph)));
691
- adjustClustersAndEdges(graph);
692
- log.warn("Graph after XAX:", JSON.stringify(write(graph)));
693
- const siteConfig = getConfig2();
694
- await recursiveRender(
695
- element,
696
- graph,
697
- data4Layout.type,
698
- data4Layout.diagramId,
699
- void 0,
700
- siteConfig
701
- );
702
- }, "render");
464
+ }
465
+ return null;
466
+ }, "findSafeAnchorNode");
703
467
  export {
704
- render
468
+ adjustClustersAndEdges as a,
469
+ clusterDb as b,
470
+ clear as c,
471
+ findNonClusterChild as f,
472
+ sortNodesByHierarchy as s,
473
+ write as w
705
474
  };
@@ -1,4 +1,4 @@
1
- import { _ as __name, N as select } from "./index-Cmn9J2p1.js";
1
+ import { _ as __name, N as select } from "./index-BahRAP01.js";
2
2
  var getDiagramElement = /* @__PURE__ */ __name((id, securityLevel) => {
3
3
  let sandboxElement;
4
4
  if (securityLevel === "sandbox") {
@@ -1,9 +1,9 @@
1
- import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-CPUXDO_8.js";
2
- import { _ as __name } from "./index-Cmn9J2p1.js";
3
- import "./chunk-FMBD7UC4-DIj-DOVN.js";
4
- import "./chunk-ND2GUHAM-BWiS_Ttp.js";
5
- import "./chunk-55IACEB6-MkIW5gHI.js";
6
- import "./chunk-2J33WTMH-YV6ZtOyU.js";
1
+ import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-GF5L2VYU-Ct3zh1DW.js";
2
+ import { _ as __name } from "./index-BahRAP01.js";
3
+ import "./chunk-5VM5RSS4-D731WvT8.js";
4
+ import "./chunk-XXDRQBXY-D_LC4QkV.js";
5
+ import "./chunk-KBJHAD2P-qbM4OnIO.js";
6
+ import "./chunk-2GRJ4B5K-CJI-utiZ.js";
7
7
  var diagram = {
8
8
  parser: classDiagram_default,
9
9
  get db() {
@@ -1,9 +1,9 @@
1
- import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-727SXJPM-CPUXDO_8.js";
2
- import { _ as __name } from "./index-Cmn9J2p1.js";
3
- import "./chunk-FMBD7UC4-DIj-DOVN.js";
4
- import "./chunk-ND2GUHAM-BWiS_Ttp.js";
5
- import "./chunk-55IACEB6-MkIW5gHI.js";
6
- import "./chunk-2J33WTMH-YV6ZtOyU.js";
1
+ import { s as styles_default, c as classRenderer_v3_unified_default, a as classDiagram_default, C as ClassDB } from "./chunk-GF5L2VYU-Ct3zh1DW.js";
2
+ import { _ as __name } from "./index-BahRAP01.js";
3
+ import "./chunk-5VM5RSS4-D731WvT8.js";
4
+ import "./chunk-XXDRQBXY-D_LC4QkV.js";
5
+ import "./chunk-KBJHAD2P-qbM4OnIO.js";
6
+ import "./chunk-2GRJ4B5K-CJI-utiZ.js";
7
7
  var diagram = {
8
8
  parser: classDiagram_default,
9
9
  get db() {
@@ -1,5 +1,5 @@
1
- import { bW as getDefaultExportFromCjs, _ as __name, O as log, N as select } from "./index-Cmn9J2p1.js";
2
- import { c as cytoscape$1 } from "./cytoscape.esm-BNSvh83I.js";
1
+ import { b_ as getDefaultExportFromCjs, _ as __name, O as log, N as select } from "./index-BahRAP01.js";
2
+ import { c as cytoscape$1 } from "./cytoscape.esm-Bx_1tVW-.js";
3
3
  var cytoscapeCoseBilkent$1 = { exports: {} };
4
4
  var coseBase$1 = { exports: {} };
5
5
  var layoutBase$1 = { exports: {} };