@webskill/sdk 0.21.0 → 0.22.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/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1012 -130
- package/dist/{approval-DwN2o2QG.js → approval-DWQlDPbY.js} +102 -16
- package/dist/arc-8U_6NQWm.js +130 -0
- package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
- package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
- package/dist/array-DQfpQNY8.js +8 -0
- package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
- package/dist/browser.d.ts +444 -48
- package/dist/browser.js +1771 -91
- package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
- package/dist/channel-CZxxLrG7.js +9 -0
- package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
- package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
- package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
- package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
- package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
- package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
- package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
- package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
- package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
- package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
- package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
- package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
- package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
- package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
- package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
- package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
- package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
- package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
- package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
- package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
- package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
- package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
- package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
- package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
- package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
- package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
- package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
- package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
- package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
- package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
- package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
- package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
- package/dist/defaultLocale-B_EoOkSF.js +249 -0
- package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
- package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
- package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
- package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
- package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
- package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
- package/dist/dist-UajCDt3n.js +92 -0
- package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
- package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
- package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
- package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
- package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
- package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
- package/dist/{toolSource-C9oNuKmr.js → geometry-wx5ZTYzi.js} +162 -12
- package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
- package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
- package/dist/governance.d.ts +3 -3
- package/dist/graphlib-tk9gQYuN.js +4194 -0
- package/dist/{index-B8Tgmpwh.d.ts → index-BiO9_XRk.d.ts} +2 -2
- package/dist/{index-CYLt5u4L.d.ts → index-CjwdZQOS.d.ts} +700 -12
- package/dist/{index-DHopiH_m.d.ts → index-YPd8ZSEa.d.ts} +156 -9
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
- package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
- package/dist/init-CMOIWdg-.js +16 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
- package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
- package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
- package/dist/katex-BcRRvyh_.js +26465 -0
- package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
- package/dist/line-LgV8iVMV.js +48 -0
- package/dist/linear-BWKR0Tqd.js +393 -0
- package/dist/linkedDocument-CIuh_Yp0.js +416 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
- package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
- package/dist/mermaid.core-DMtwGCHy.js +1756 -0
- package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.js +2 -2
- package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
- package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
- package/dist/ordinal-CxA6GHQS.js +84 -0
- package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
- package/dist/path-C27Z2Bjv.js +106 -0
- package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
- package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
- package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
- package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
- package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
- package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
- package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
- package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
- package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
- package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
- package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
- package/dist/rough.cjs-AmDd_NQk.js +1395 -0
- package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
- package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
- package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
- package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
- package/dist/src-NkhI3UMl.js +2653 -0
- package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
- package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
- package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
- package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
- package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
- package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +59 -8
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +3718 -77
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
- package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
- package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
- package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
- package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-Dy-Zjv0y.js} +1 -1
- package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
- package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
- package/package.json +1 -1
- package/dist/linkedDocument-C0gj1sMq.js +0 -245
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
import { o as __toESM } from "./rolldown-runtime-BHkdefai.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
3
|
+
import { m as log, p as select_default } from "./src-NkhI3UMl.js";
|
|
4
|
+
import { T as getEffectiveHtmlLabels, g as evaluate, x as getConfig2 } from "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
5
|
+
import { n as createText } from "./chunk-MBY4JIJT-C34L7a4f.js";
|
|
6
|
+
import { a as userNodeOverrides, i as styles2String, t as compileStyles } from "./chunk-7PRAP22T-BHED6GVs.js";
|
|
7
|
+
import { s as stampColorSlot } from "./chunk-J5ZVWO5B-Bi_Pcobw.js";
|
|
8
|
+
import { t as require_rough_cjs } from "./rough.cjs-AmDd_NQk.js";
|
|
9
|
+
import { i as intersect_rect_default, n as createRoundedRectPathD, t as createLabel_default } from "./chunk-7INBJB4K-C9jq9o66.js";
|
|
10
|
+
import { n as getSubGraphTitleMargins } from "./chunk-5DYCD2WN-Bt97YGTd.js";
|
|
11
|
+
|
|
12
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-UA2S7LBM.mjs
|
|
13
|
+
var import_rough_cjs = /* @__PURE__ */ __toESM(require_rough_cjs(), 1);
|
|
14
|
+
var swimlane = /* @__PURE__ */ __name(async (parent, node) => {
|
|
15
|
+
const siteConfig = getConfig2();
|
|
16
|
+
const { theme, themeVariables, handDrawnSeed } = siteConfig;
|
|
17
|
+
const { clusterBkg, clusterBorder, borderColorArray } = themeVariables;
|
|
18
|
+
const laneStroke = clusterBorder;
|
|
19
|
+
const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);
|
|
20
|
+
const shapeSvg = parent.insert("g").attr("class", "cluster swimlane " + (node.cssClasses || "")).attr("id", node.id).attr("data-id", node.id).attr("data-et", "cluster").attr("data-look", node.look);
|
|
21
|
+
stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);
|
|
22
|
+
const useHtmlLabels = evaluate(siteConfig.flowchart.htmlLabels);
|
|
23
|
+
const isLR = node.direction === "LR";
|
|
24
|
+
const labelEl = shapeSvg.insert("g").attr("class", "cluster-label swimlane-label");
|
|
25
|
+
const text = await createText(labelEl, node.label, {
|
|
26
|
+
style: node.labelStyle,
|
|
27
|
+
useHtmlLabels,
|
|
28
|
+
isNode: true,
|
|
29
|
+
width: node.width
|
|
30
|
+
});
|
|
31
|
+
let bbox = text.getBBox();
|
|
32
|
+
if (useHtmlLabels) {
|
|
33
|
+
const div = text.children[0];
|
|
34
|
+
const dv = select_default(text);
|
|
35
|
+
bbox = div.getBoundingClientRect();
|
|
36
|
+
dv.attr("width", bbox.width);
|
|
37
|
+
dv.attr("height", bbox.height);
|
|
38
|
+
}
|
|
39
|
+
const padding = node.padding ?? 0;
|
|
40
|
+
const width = node.width <= bbox.width + padding ? bbox.width + padding : node.width;
|
|
41
|
+
if (node.width <= bbox.width + padding) node.diff = (width - node.width) / 2 - padding;
|
|
42
|
+
else node.diff = -padding;
|
|
43
|
+
const height = node.height;
|
|
44
|
+
const laneTop = node.y - height / 2;
|
|
45
|
+
const laneBottom = node.y + height / 2;
|
|
46
|
+
const laneLeft = node.x - width / 2;
|
|
47
|
+
const contentTop = node.swimlaneContentTop !== void 0 ? node.swimlaneContentTop : laneTop + height / 3;
|
|
48
|
+
const titlePaddingY = isLR ? 4 : 0;
|
|
49
|
+
const desiredTitleSize = bbox.height + 2 * titlePaddingY;
|
|
50
|
+
let titleRect;
|
|
51
|
+
let bodyRect;
|
|
52
|
+
if (isLR) {
|
|
53
|
+
const titleWidth = Math.max(desiredTitleSize, bbox.height + 2 * titlePaddingY);
|
|
54
|
+
const bodyX = laneLeft + titleWidth;
|
|
55
|
+
const bodyWidth = Math.max(0, width - titleWidth);
|
|
56
|
+
if (node.look === "handDrawn") {
|
|
57
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
58
|
+
const titleOptions = userNodeOverrides(node, {
|
|
59
|
+
roughness: .7,
|
|
60
|
+
fill: clusterBkg,
|
|
61
|
+
stroke: laneStroke,
|
|
62
|
+
seed: handDrawnSeed
|
|
63
|
+
});
|
|
64
|
+
const bodyOptions = userNodeOverrides(node, {
|
|
65
|
+
roughness: .7,
|
|
66
|
+
fill: "none",
|
|
67
|
+
stroke: laneStroke,
|
|
68
|
+
seed: handDrawnSeed
|
|
69
|
+
});
|
|
70
|
+
const roughTitle = rc.rectangle(laneLeft, laneTop, titleWidth, height, titleOptions);
|
|
71
|
+
titleRect = shapeSvg.insert(() => roughTitle, ":first-child").attr("class", "swimlane-title");
|
|
72
|
+
const roughBody = rc.rectangle(bodyX, laneTop, bodyWidth, height, bodyOptions);
|
|
73
|
+
bodyRect = shapeSvg.insert(() => roughBody, ":first-child").attr("class", "swimlane-body");
|
|
74
|
+
titleRect.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
|
|
75
|
+
titleRect.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
|
|
76
|
+
} else {
|
|
77
|
+
titleRect = shapeSvg.insert("rect", ":first-child");
|
|
78
|
+
bodyRect = shapeSvg.insert("rect", ":first-child");
|
|
79
|
+
titleRect.attr("class", "swimlane-title").attr("style", nodeStyles).attr("x", laneLeft).attr("y", laneTop).attr("width", titleWidth).attr("height", height).attr("fill", clusterBkg).attr("stroke", laneStroke);
|
|
80
|
+
bodyRect.attr("class", "swimlane-body").attr("style", nodeStyles).attr("x", bodyX).attr("y", laneTop).attr("width", bodyWidth).attr("height", height).attr("fill", "none").attr("stroke", laneStroke);
|
|
81
|
+
}
|
|
82
|
+
const labelCenterX = laneLeft + titleWidth / 2;
|
|
83
|
+
const labelCenterY = node.y;
|
|
84
|
+
labelEl.attr("transform", `translate(${labelCenterX}, ${labelCenterY}) rotate(-90) translate(${-bbox.width / 2}, ${-bbox.height / 2})`);
|
|
85
|
+
} else {
|
|
86
|
+
const headerMaxHeight = Math.max(0, contentTop - laneTop);
|
|
87
|
+
const titleHeight = Math.min(desiredTitleSize, headerMaxHeight);
|
|
88
|
+
const bodyY = laneTop + titleHeight;
|
|
89
|
+
const contentHeight = Math.max(0, laneBottom - bodyY);
|
|
90
|
+
const x = node.x - width / 2;
|
|
91
|
+
if (node.look === "handDrawn") {
|
|
92
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
93
|
+
const titleOptions = userNodeOverrides(node, {
|
|
94
|
+
roughness: .7,
|
|
95
|
+
fill: clusterBkg,
|
|
96
|
+
stroke: laneStroke,
|
|
97
|
+
fillWeight: 3,
|
|
98
|
+
seed: handDrawnSeed
|
|
99
|
+
});
|
|
100
|
+
const bodyOptions = userNodeOverrides(node, {
|
|
101
|
+
roughness: .7,
|
|
102
|
+
fill: "none",
|
|
103
|
+
stroke: laneStroke,
|
|
104
|
+
seed: handDrawnSeed
|
|
105
|
+
});
|
|
106
|
+
const roughTitle = rc.rectangle(x, laneTop, width, titleHeight, titleOptions);
|
|
107
|
+
titleRect = shapeSvg.insert(() => roughTitle, ":first-child").attr("class", "swimlane-title");
|
|
108
|
+
const roughBody = rc.rectangle(x, bodyY, width, contentHeight, bodyOptions);
|
|
109
|
+
bodyRect = shapeSvg.insert(() => roughBody, ":first-child").attr("class", "swimlane-body");
|
|
110
|
+
titleRect.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
|
|
111
|
+
titleRect.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
|
|
112
|
+
} else {
|
|
113
|
+
titleRect = shapeSvg.insert("rect", ":first-child");
|
|
114
|
+
bodyRect = shapeSvg.insert("rect", ":first-child");
|
|
115
|
+
titleRect.attr("class", "swimlane-title").attr("style", nodeStyles).attr("x", x).attr("y", laneTop).attr("width", width).attr("height", titleHeight).attr("fill", clusterBkg).attr("stroke", laneStroke);
|
|
116
|
+
bodyRect.attr("class", "swimlane-body").attr("style", nodeStyles).attr("x", x).attr("y", bodyY).attr("width", width).attr("height", contentHeight).attr("fill", "none").attr("stroke", laneStroke);
|
|
117
|
+
}
|
|
118
|
+
const labelX = node.x - bbox.width / 2;
|
|
119
|
+
const labelY = laneTop + (titleHeight - bbox.height) / 2;
|
|
120
|
+
labelEl.attr("transform", `translate(${labelX}, ${labelY})`);
|
|
121
|
+
}
|
|
122
|
+
log.trace("Swimlane data ", node, JSON.stringify(node));
|
|
123
|
+
if (labelStyles) {
|
|
124
|
+
const span = labelEl.select("span");
|
|
125
|
+
if (span) span.attr("style", labelStyles);
|
|
126
|
+
}
|
|
127
|
+
node.offsetX = 0;
|
|
128
|
+
node.width = width;
|
|
129
|
+
node.height = height;
|
|
130
|
+
node.offsetY = bbox.height - padding / 2;
|
|
131
|
+
node.intersect = function(point) {
|
|
132
|
+
return intersect_rect_default(node, point);
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
cluster: shapeSvg,
|
|
136
|
+
labelBBox: bbox
|
|
137
|
+
};
|
|
138
|
+
}, "swimlane");
|
|
139
|
+
var rect = /* @__PURE__ */ __name(async (parent, node) => {
|
|
140
|
+
log.info("Creating subgraph rect for ", node.id, node);
|
|
141
|
+
const siteConfig = getConfig2();
|
|
142
|
+
const { theme, themeVariables, handDrawnSeed } = siteConfig;
|
|
143
|
+
const { clusterBkg, clusterBorder, borderColorArray } = themeVariables;
|
|
144
|
+
const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);
|
|
145
|
+
const shapeSvg = parent.insert("g").attr("class", "cluster " + node.cssClasses).attr("id", node.domId).attr("data-look", node.look);
|
|
146
|
+
stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);
|
|
147
|
+
const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);
|
|
148
|
+
const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
|
|
149
|
+
let text;
|
|
150
|
+
if (node.labelType === "markdown") text = await createText(labelEl, node.label, {
|
|
151
|
+
style: node.labelStyle,
|
|
152
|
+
useHtmlLabels,
|
|
153
|
+
isNode: true,
|
|
154
|
+
width: node.width
|
|
155
|
+
});
|
|
156
|
+
else text = await createLabel_default(labelEl, node.label, node.labelStyle || "", false, true);
|
|
157
|
+
let bbox = text.getBBox();
|
|
158
|
+
if (getEffectiveHtmlLabels(siteConfig)) {
|
|
159
|
+
const div = text.children[0];
|
|
160
|
+
const dv = select_default(text);
|
|
161
|
+
bbox = div.getBoundingClientRect();
|
|
162
|
+
dv.attr("width", bbox.width);
|
|
163
|
+
dv.attr("height", bbox.height);
|
|
164
|
+
}
|
|
165
|
+
const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
|
|
166
|
+
if (node.width <= bbox.width + node.padding) node.diff = (width - node.width) / 2 - node.padding;
|
|
167
|
+
else node.diff = -node.padding;
|
|
168
|
+
const height = node.height;
|
|
169
|
+
const x = node.x - width / 2;
|
|
170
|
+
const y = node.y - height / 2;
|
|
171
|
+
log.trace("Data ", node, JSON.stringify(node));
|
|
172
|
+
let rect2;
|
|
173
|
+
if (node.look === "handDrawn") {
|
|
174
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
175
|
+
const options = userNodeOverrides(node, {
|
|
176
|
+
roughness: .7,
|
|
177
|
+
fill: clusterBkg,
|
|
178
|
+
stroke: clusterBorder,
|
|
179
|
+
fillWeight: 3,
|
|
180
|
+
seed: handDrawnSeed
|
|
181
|
+
});
|
|
182
|
+
const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, 0), options);
|
|
183
|
+
rect2 = shapeSvg.insert(() => {
|
|
184
|
+
log.debug("Rough node insert CXC", roughNode);
|
|
185
|
+
return roughNode;
|
|
186
|
+
}, ":first-child");
|
|
187
|
+
rect2.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
|
|
188
|
+
rect2.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
|
|
189
|
+
} else {
|
|
190
|
+
rect2 = shapeSvg.insert("rect", ":first-child");
|
|
191
|
+
rect2.attr("style", nodeStyles).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", width).attr("height", height);
|
|
192
|
+
}
|
|
193
|
+
const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);
|
|
194
|
+
labelEl.attr("transform", `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`);
|
|
195
|
+
if (labelStyles) {
|
|
196
|
+
const span = labelEl.select("span");
|
|
197
|
+
if (span) span.attr("style", labelStyles);
|
|
198
|
+
}
|
|
199
|
+
const rectBox = rect2.node().getBBox();
|
|
200
|
+
node.offsetX = 0;
|
|
201
|
+
node.width = rectBox.width;
|
|
202
|
+
node.height = rectBox.height;
|
|
203
|
+
node.offsetY = bbox.height - node.padding / 2;
|
|
204
|
+
node.intersect = function(point) {
|
|
205
|
+
return intersect_rect_default(node, point);
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
cluster: shapeSvg,
|
|
209
|
+
labelBBox: bbox
|
|
210
|
+
};
|
|
211
|
+
}, "rect");
|
|
212
|
+
var noteGroup = /* @__PURE__ */ __name((parent, node) => {
|
|
213
|
+
const shapeSvg = parent.insert("g").attr("class", "note-cluster").attr("id", node.domId);
|
|
214
|
+
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
215
|
+
const padding = 0 * node.padding;
|
|
216
|
+
const halfPadding = padding / 2;
|
|
217
|
+
rect2.attr("rx", node.rx).attr("ry", node.ry).attr("x", node.x - node.width / 2 - halfPadding).attr("y", node.y - node.height / 2 - halfPadding).attr("width", node.width + padding).attr("height", node.height + padding).attr("fill", "none");
|
|
218
|
+
const rectBox = rect2.node().getBBox();
|
|
219
|
+
node.width = rectBox.width;
|
|
220
|
+
node.height = rectBox.height;
|
|
221
|
+
node.intersect = function(point) {
|
|
222
|
+
return intersect_rect_default(node, point);
|
|
223
|
+
};
|
|
224
|
+
return {
|
|
225
|
+
cluster: shapeSvg,
|
|
226
|
+
labelBBox: {
|
|
227
|
+
width: 0,
|
|
228
|
+
height: 0
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}, "noteGroup");
|
|
232
|
+
var roundedWithTitle = /* @__PURE__ */ __name(async (parent, node) => {
|
|
233
|
+
const siteConfig = getConfig2();
|
|
234
|
+
const { theme, themeVariables, handDrawnSeed } = siteConfig;
|
|
235
|
+
const { altBackground, borderColorArray, compositeBackground, compositeTitleBackground, nodeBorder } = themeVariables;
|
|
236
|
+
const shapeSvg = parent.insert("g").attr("class", node.cssClasses).attr("id", node.domId).attr("data-id", node.id).attr("data-look", node.look);
|
|
237
|
+
stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);
|
|
238
|
+
const outerRectG = shapeSvg.insert("g", ":first-child");
|
|
239
|
+
const label = shapeSvg.insert("g").attr("class", "cluster-label");
|
|
240
|
+
let innerRect = shapeSvg.append("rect");
|
|
241
|
+
const text = await createLabel_default(label, node.label, node.labelStyle, void 0, true);
|
|
242
|
+
let bbox = text.getBBox();
|
|
243
|
+
if (getEffectiveHtmlLabels(siteConfig)) {
|
|
244
|
+
const div = text.children[0];
|
|
245
|
+
const dv = select_default(text);
|
|
246
|
+
bbox = div.getBoundingClientRect();
|
|
247
|
+
dv.attr("width", bbox.width);
|
|
248
|
+
dv.attr("height", bbox.height);
|
|
249
|
+
}
|
|
250
|
+
const padding = 0 * node.padding;
|
|
251
|
+
const halfPadding = padding / 2;
|
|
252
|
+
const width = (node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width) + padding;
|
|
253
|
+
if (node.width <= bbox.width + node.padding) node.diff = (width - node.width) / 2 - node.padding;
|
|
254
|
+
else node.diff = -node.padding;
|
|
255
|
+
const height = node.height + padding;
|
|
256
|
+
const innerHeight = node.height + padding - bbox.height - 6;
|
|
257
|
+
const x = node.x - width / 2;
|
|
258
|
+
const y = node.y - height / 2;
|
|
259
|
+
node.width = width;
|
|
260
|
+
const innerY = node.y - node.height / 2 - halfPadding + bbox.height + 2;
|
|
261
|
+
let rect2;
|
|
262
|
+
if (node.look === "handDrawn") {
|
|
263
|
+
const isAlt = node.cssClasses.includes("statediagram-cluster-alt");
|
|
264
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
265
|
+
const roughOuterNode = node.rx || node.ry ? rc.path(createRoundedRectPathD(x, y, width, height, 10), {
|
|
266
|
+
roughness: .7,
|
|
267
|
+
fill: compositeTitleBackground,
|
|
268
|
+
fillStyle: "solid",
|
|
269
|
+
stroke: nodeBorder,
|
|
270
|
+
seed: handDrawnSeed
|
|
271
|
+
}) : rc.rectangle(x, y, width, height, { seed: handDrawnSeed });
|
|
272
|
+
rect2 = shapeSvg.insert(() => roughOuterNode, ":first-child");
|
|
273
|
+
const roughInnerNode = rc.rectangle(x, innerY, width, innerHeight, {
|
|
274
|
+
fill: isAlt ? altBackground : compositeBackground,
|
|
275
|
+
fillStyle: isAlt ? "hachure" : "solid",
|
|
276
|
+
stroke: nodeBorder,
|
|
277
|
+
seed: handDrawnSeed
|
|
278
|
+
});
|
|
279
|
+
rect2 = shapeSvg.insert(() => roughOuterNode, ":first-child");
|
|
280
|
+
innerRect = shapeSvg.insert(() => roughInnerNode);
|
|
281
|
+
rect2.attr("class", "outer");
|
|
282
|
+
innerRect.attr("class", "inner");
|
|
283
|
+
} else {
|
|
284
|
+
rect2 = outerRectG.insert("rect", ":first-child");
|
|
285
|
+
rect2.attr("class", "outer").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("data-look", node.look);
|
|
286
|
+
innerRect.attr("class", "inner").attr("x", x).attr("y", innerY).attr("width", width).attr("height", innerHeight);
|
|
287
|
+
}
|
|
288
|
+
label.attr("transform", `translate(${node.x - bbox.width / 2}, ${y + 1 - (getEffectiveHtmlLabels(siteConfig) ? 0 : 3)})`);
|
|
289
|
+
node.height = rect2.node().getBBox().height;
|
|
290
|
+
node.offsetX = 0;
|
|
291
|
+
node.offsetY = bbox.height - node.padding / 2;
|
|
292
|
+
node.labelBBox = bbox;
|
|
293
|
+
node.intersect = function(point) {
|
|
294
|
+
return intersect_rect_default(node, point);
|
|
295
|
+
};
|
|
296
|
+
return {
|
|
297
|
+
cluster: shapeSvg,
|
|
298
|
+
labelBBox: bbox
|
|
299
|
+
};
|
|
300
|
+
}, "roundedWithTitle");
|
|
301
|
+
var kanbanSection = /* @__PURE__ */ __name(async (parent, node) => {
|
|
302
|
+
log.info("Creating subgraph rect for ", node.id, node);
|
|
303
|
+
const siteConfig = getConfig2();
|
|
304
|
+
const { themeVariables, handDrawnSeed } = siteConfig;
|
|
305
|
+
const { clusterBkg, clusterBorder } = themeVariables;
|
|
306
|
+
const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);
|
|
307
|
+
const shapeSvg = parent.insert("g").attr("class", "cluster " + node.cssClasses).attr("id", node.domId).attr("data-look", node.look);
|
|
308
|
+
const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);
|
|
309
|
+
const labelEl = shapeSvg.insert("g").attr("class", "cluster-label ");
|
|
310
|
+
const text = await createText(labelEl, node.label, {
|
|
311
|
+
style: node.labelStyle,
|
|
312
|
+
useHtmlLabels,
|
|
313
|
+
isNode: true,
|
|
314
|
+
width: node.width
|
|
315
|
+
});
|
|
316
|
+
let bbox = text.getBBox();
|
|
317
|
+
if (getEffectiveHtmlLabels(siteConfig)) {
|
|
318
|
+
const div = text.children[0];
|
|
319
|
+
const dv = select_default(text);
|
|
320
|
+
bbox = div.getBoundingClientRect();
|
|
321
|
+
dv.attr("width", bbox.width);
|
|
322
|
+
dv.attr("height", bbox.height);
|
|
323
|
+
}
|
|
324
|
+
const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
|
|
325
|
+
if (node.width <= bbox.width + node.padding) node.diff = (width - node.width) / 2 - node.padding;
|
|
326
|
+
else node.diff = -node.padding;
|
|
327
|
+
const height = node.height;
|
|
328
|
+
const x = node.x - width / 2;
|
|
329
|
+
const y = node.y - height / 2;
|
|
330
|
+
log.trace("Data ", node, JSON.stringify(node));
|
|
331
|
+
let rect2;
|
|
332
|
+
if (node.look === "handDrawn") {
|
|
333
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
334
|
+
const options = userNodeOverrides(node, {
|
|
335
|
+
roughness: .7,
|
|
336
|
+
fill: clusterBkg,
|
|
337
|
+
stroke: clusterBorder,
|
|
338
|
+
fillWeight: 4,
|
|
339
|
+
seed: handDrawnSeed
|
|
340
|
+
});
|
|
341
|
+
const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, node.rx), options);
|
|
342
|
+
rect2 = shapeSvg.insert(() => {
|
|
343
|
+
log.debug("Rough node insert CXC", roughNode);
|
|
344
|
+
return roughNode;
|
|
345
|
+
}, ":first-child");
|
|
346
|
+
rect2.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
|
|
347
|
+
rect2.select("path").attr("style", backgroundStyles.join(";").replace("fill", "stroke"));
|
|
348
|
+
} else {
|
|
349
|
+
rect2 = shapeSvg.insert("rect", ":first-child");
|
|
350
|
+
rect2.attr("style", nodeStyles).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", width).attr("height", height);
|
|
351
|
+
}
|
|
352
|
+
const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);
|
|
353
|
+
labelEl.attr("transform", `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`);
|
|
354
|
+
if (labelStyles) {
|
|
355
|
+
const span = labelEl.select("span");
|
|
356
|
+
if (span) span.attr("style", labelStyles);
|
|
357
|
+
}
|
|
358
|
+
const rectBox = rect2.node().getBBox();
|
|
359
|
+
node.offsetX = 0;
|
|
360
|
+
node.width = rectBox.width;
|
|
361
|
+
node.height = rectBox.height;
|
|
362
|
+
node.offsetY = bbox.height - node.padding / 2;
|
|
363
|
+
node.intersect = function(point) {
|
|
364
|
+
return intersect_rect_default(node, point);
|
|
365
|
+
};
|
|
366
|
+
return {
|
|
367
|
+
cluster: shapeSvg,
|
|
368
|
+
labelBBox: bbox
|
|
369
|
+
};
|
|
370
|
+
}, "kanbanSection");
|
|
371
|
+
var divider = /* @__PURE__ */ __name((parent, node) => {
|
|
372
|
+
const { theme, themeVariables, handDrawnSeed } = getConfig2();
|
|
373
|
+
const { altBackground, nodeBorder, borderColorArray } = themeVariables;
|
|
374
|
+
const shapeSvg = parent.insert("g").attr("class", node.cssClasses).attr("id", node.domId).attr("data-look", node.look);
|
|
375
|
+
stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);
|
|
376
|
+
const outerRectG = shapeSvg.insert("g", ":first-child");
|
|
377
|
+
const padding = 0 * node.padding;
|
|
378
|
+
const width = node.width + padding;
|
|
379
|
+
node.diff = -node.padding;
|
|
380
|
+
const height = node.height + padding;
|
|
381
|
+
const x = node.x - width / 2;
|
|
382
|
+
const y = node.y - height / 2;
|
|
383
|
+
node.width = width;
|
|
384
|
+
let rect2;
|
|
385
|
+
if (node.look === "handDrawn") {
|
|
386
|
+
const roughOuterNode = import_rough_cjs.default.svg(shapeSvg).rectangle(x, y, width, height, {
|
|
387
|
+
fill: altBackground ?? "#efefef",
|
|
388
|
+
fillStyle: "solid",
|
|
389
|
+
roughness: .5,
|
|
390
|
+
strokeLineDash: [5],
|
|
391
|
+
stroke: nodeBorder,
|
|
392
|
+
seed: handDrawnSeed
|
|
393
|
+
});
|
|
394
|
+
rect2 = shapeSvg.insert(() => roughOuterNode, ":first-child").attr("class", "divider");
|
|
395
|
+
} else {
|
|
396
|
+
rect2 = outerRectG.insert("rect", ":first-child");
|
|
397
|
+
let outerRectClass = "outer";
|
|
398
|
+
if (node.look === "neo") outerRectClass = "divider";
|
|
399
|
+
else outerRectClass = "divider";
|
|
400
|
+
rect2.attr("class", outerRectClass).attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("data-look", node.look);
|
|
401
|
+
}
|
|
402
|
+
node.height = rect2.node().getBBox().height;
|
|
403
|
+
node.offsetX = 0;
|
|
404
|
+
node.offsetY = 0;
|
|
405
|
+
node.intersect = function(point) {
|
|
406
|
+
return intersect_rect_default(node, point);
|
|
407
|
+
};
|
|
408
|
+
return {
|
|
409
|
+
cluster: shapeSvg,
|
|
410
|
+
labelBBox: {}
|
|
411
|
+
};
|
|
412
|
+
}, "divider");
|
|
413
|
+
var createContainerGroup = /* @__PURE__ */ __name(async (parent, node, opts) => {
|
|
414
|
+
log.info(`Creating ${opts.cssClass} for `, node.id, node);
|
|
415
|
+
const siteConfig = getConfig2();
|
|
416
|
+
const { theme, themeVariables, handDrawnSeed } = siteConfig;
|
|
417
|
+
const { borderColorArray } = themeVariables;
|
|
418
|
+
const { labelStyles, borderStyles } = styles2String(node);
|
|
419
|
+
const shapeSvg = parent.insert("g").attr("class", "cluster " + opts.cssClass + " " + node.cssClasses).attr("id", node.domId ?? node.id).attr("data-look", node.look);
|
|
420
|
+
stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);
|
|
421
|
+
const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);
|
|
422
|
+
const labelEl = shapeSvg.insert("g").attr("class", "cluster-label");
|
|
423
|
+
let bbox = {
|
|
424
|
+
width: 0,
|
|
425
|
+
height: 0
|
|
426
|
+
};
|
|
427
|
+
const hasLabel = node.label?.trim();
|
|
428
|
+
if (hasLabel) {
|
|
429
|
+
let text;
|
|
430
|
+
if (node.labelType === "markdown") text = await createText(labelEl, node.label, {
|
|
431
|
+
style: node.labelStyle,
|
|
432
|
+
useHtmlLabels,
|
|
433
|
+
isNode: true,
|
|
434
|
+
width: node.width
|
|
435
|
+
});
|
|
436
|
+
else text = await createLabel_default(labelEl, node.label, node.labelStyle || "", false, true);
|
|
437
|
+
bbox = text.getBBox();
|
|
438
|
+
if (useHtmlLabels) {
|
|
439
|
+
const div = text.children[0];
|
|
440
|
+
const dv = select_default(text);
|
|
441
|
+
bbox = div.getBoundingClientRect();
|
|
442
|
+
dv.attr("width", bbox.width);
|
|
443
|
+
dv.attr("height", bbox.height);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
|
|
447
|
+
if (node.width <= bbox.width + node.padding) node.diff = (width - node.width) / 2 - node.padding;
|
|
448
|
+
else node.diff = -node.padding;
|
|
449
|
+
const height = node.height;
|
|
450
|
+
const x = node.x - width / 2;
|
|
451
|
+
const y = node.y - height / 2;
|
|
452
|
+
let rectEl;
|
|
453
|
+
if (node.look === "handDrawn") {
|
|
454
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
455
|
+
const roughOpts = userNodeOverrides(node, {
|
|
456
|
+
roughness: opts.roughness,
|
|
457
|
+
fill: opts.fill,
|
|
458
|
+
stroke: opts.stroke,
|
|
459
|
+
strokeWidth: opts.strokeWidth,
|
|
460
|
+
seed: handDrawnSeed,
|
|
461
|
+
...opts.fill === "none" ? { fillWeight: 0 } : { fillStyle: "solid" },
|
|
462
|
+
...opts.strokeDash ? { strokeLineDash: opts.strokeDash } : {}
|
|
463
|
+
});
|
|
464
|
+
const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, opts.rx), roughOpts);
|
|
465
|
+
rectEl = shapeSvg.insert(() => roughNode, ":first-child");
|
|
466
|
+
rectEl.select("path:nth-child(2)").attr("style", borderStyles.join(";"));
|
|
467
|
+
} else {
|
|
468
|
+
rectEl = shapeSvg.insert("rect", ":first-child");
|
|
469
|
+
rectEl.attr("rx", opts.rx).attr("ry", opts.rx).attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("fill", opts.fill).attr("stroke", opts.stroke).attr("stroke-width", opts.strokeWidth + "px");
|
|
470
|
+
if (opts.strokeDash) rectEl.attr("stroke-dasharray", opts.strokeDash.join(", "));
|
|
471
|
+
}
|
|
472
|
+
if (hasLabel) {
|
|
473
|
+
const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);
|
|
474
|
+
labelEl.attr("transform", `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`);
|
|
475
|
+
if (labelStyles) {
|
|
476
|
+
const span = labelEl.select("span");
|
|
477
|
+
if (span) span.attr("style", labelStyles);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const rectBox = rectEl.node().getBBox();
|
|
481
|
+
node.offsetX = 0;
|
|
482
|
+
node.width = rectBox.width;
|
|
483
|
+
node.height = rectBox.height;
|
|
484
|
+
node.offsetY = bbox.height - node.padding / 2;
|
|
485
|
+
node.intersect = function(point) {
|
|
486
|
+
return intersect_rect_default(node, point);
|
|
487
|
+
};
|
|
488
|
+
return {
|
|
489
|
+
cluster: shapeSvg,
|
|
490
|
+
labelBBox: bbox
|
|
491
|
+
};
|
|
492
|
+
}, "createContainerGroup");
|
|
493
|
+
var flowGroup = /* @__PURE__ */ __name(async (parent, node) => {
|
|
494
|
+
const { themeVariables } = getConfig2();
|
|
495
|
+
return createContainerGroup(parent, node, {
|
|
496
|
+
cssClass: "flow-cluster",
|
|
497
|
+
rx: 10,
|
|
498
|
+
fill: "none",
|
|
499
|
+
stroke: themeVariables.flowContainerStroke || themeVariables.secondaryBorderColor,
|
|
500
|
+
strokeWidth: .75,
|
|
501
|
+
roughness: .7
|
|
502
|
+
});
|
|
503
|
+
}, "flowGroup");
|
|
504
|
+
var getUsecaseSystemBoundaryGeometry = /* @__PURE__ */ __name((node, labelBBox) => {
|
|
505
|
+
const boundaryType = node.boundaryType || "rect";
|
|
506
|
+
const horizontalLabelPadding = boundaryType === "package" ? 20 : node.padding;
|
|
507
|
+
const tabHeight = boundaryType === "package" ? labelBBox.height + 10 : 0;
|
|
508
|
+
const width = Math.max(node.width, labelBBox.width + horizontalLabelPadding);
|
|
509
|
+
const height = boundaryType === "package" ? Math.max(node.height, tabHeight + node.padding * 2) : node.height;
|
|
510
|
+
const x = node.x - width / 2;
|
|
511
|
+
const y = node.y - height / 2;
|
|
512
|
+
return {
|
|
513
|
+
boundaryType,
|
|
514
|
+
width,
|
|
515
|
+
height,
|
|
516
|
+
x,
|
|
517
|
+
y,
|
|
518
|
+
bodyY: y + tabHeight,
|
|
519
|
+
bodyHeight: height - tabHeight,
|
|
520
|
+
tabHeight,
|
|
521
|
+
tabWidth: boundaryType === "package" ? Math.min(width, Math.max(80, labelBBox.width + 20)) : 0
|
|
522
|
+
};
|
|
523
|
+
}, "getUsecaseSystemBoundaryGeometry");
|
|
524
|
+
var shapes = {
|
|
525
|
+
rect,
|
|
526
|
+
squareRect: rect,
|
|
527
|
+
roundedWithTitle,
|
|
528
|
+
noteGroup,
|
|
529
|
+
divider,
|
|
530
|
+
kanbanSection,
|
|
531
|
+
flowGroup,
|
|
532
|
+
usecaseSystemBoundary: /* @__PURE__ */ __name(async (parent, node) => {
|
|
533
|
+
log.info("Creating usecase system boundary for ", node.id, node);
|
|
534
|
+
const siteConfig = getConfig2();
|
|
535
|
+
const { theme, themeVariables, handDrawnSeed } = siteConfig;
|
|
536
|
+
const { clusterBkg, clusterBorder, borderColorArray } = themeVariables;
|
|
537
|
+
const { labelStyles, nodeStyles } = styles2String(node);
|
|
538
|
+
const { stylesMap } = compileStyles(node);
|
|
539
|
+
const boundaryType = node.boundaryType || "rect";
|
|
540
|
+
const shapeSvg = parent.insert("g").attr("class", `cluster usecase-system-boundary usecase-system-boundary-${boundaryType} ${node.cssClasses}`).attr("id", typeof node.domId === "string" ? node.domId : node.id).attr("data-boundary-type", boundaryType).attr("data-look", node.look);
|
|
541
|
+
stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);
|
|
542
|
+
const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);
|
|
543
|
+
const labelEl = shapeSvg.insert("g").attr("class", "cluster-label system-boundary-title");
|
|
544
|
+
const text = await createText(labelEl, node.label, {
|
|
545
|
+
style: labelStyles,
|
|
546
|
+
useHtmlLabels,
|
|
547
|
+
isNode: true
|
|
548
|
+
});
|
|
549
|
+
let bbox = text.getBBox();
|
|
550
|
+
if (useHtmlLabels) {
|
|
551
|
+
const div = text.children[0];
|
|
552
|
+
const dv = select_default(text);
|
|
553
|
+
bbox = div.getBoundingClientRect();
|
|
554
|
+
dv.attr("width", bbox.width);
|
|
555
|
+
dv.attr("height", bbox.height);
|
|
556
|
+
}
|
|
557
|
+
const { width, height, x, y, bodyY, bodyHeight, tabHeight, tabWidth } = getUsecaseSystemBoundaryGeometry(node, bbox);
|
|
558
|
+
node.diff = node.width <= bbox.width + node.padding ? (width - node.width) / 2 - node.padding : -node.padding;
|
|
559
|
+
const roughOptions = userNodeOverrides(node, {
|
|
560
|
+
fill: stylesMap.get("fill") || clusterBkg,
|
|
561
|
+
stroke: stylesMap.get("stroke") || clusterBorder,
|
|
562
|
+
strokeWidth: stylesMap.get("stroke-width")?.replace("px", "") || 1,
|
|
563
|
+
seed: handDrawnSeed
|
|
564
|
+
});
|
|
565
|
+
if (node.look === "handDrawn") {
|
|
566
|
+
const rc = import_rough_cjs.default.svg(shapeSvg);
|
|
567
|
+
const roughBody = rc.rectangle(x, bodyY, width, bodyHeight, roughOptions);
|
|
568
|
+
shapeSvg.insert(() => roughBody, ":first-child").attr("class", "boundary-body label-container");
|
|
569
|
+
if (boundaryType === "package") {
|
|
570
|
+
const roughTab = rc.rectangle(x, y, tabWidth, tabHeight, roughOptions);
|
|
571
|
+
shapeSvg.insert(() => roughTab, ":first-child").attr("class", "boundary-tab system-boundary-package-tab label-container");
|
|
572
|
+
}
|
|
573
|
+
} else {
|
|
574
|
+
shapeSvg.insert("rect", ":first-child").attr("class", "boundary-body label-container").attr("style", nodeStyles).attr("x", x).attr("y", bodyY).attr("width", width).attr("height", bodyHeight);
|
|
575
|
+
if (boundaryType === "package") shapeSvg.insert("rect", ":first-child").attr("class", "boundary-tab system-boundary-package-tab label-container").attr("style", nodeStyles).attr("x", x).attr("y", y).attr("width", tabWidth).attr("height", tabHeight);
|
|
576
|
+
}
|
|
577
|
+
const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);
|
|
578
|
+
if (boundaryType === "package") labelEl.attr("transform", `translate(${x + (tabWidth - bbox.width) / 2}, ${y + (tabHeight - bbox.height) / 2})`);
|
|
579
|
+
else labelEl.attr("transform", `translate(${node.x - bbox.width / 2}, ${y + subGraphTitleTopMargin})`);
|
|
580
|
+
if (labelStyles) {
|
|
581
|
+
labelEl.attr("style", labelStyles);
|
|
582
|
+
labelEl.select("span").attr("style", labelStyles);
|
|
583
|
+
}
|
|
584
|
+
node.offsetX = 0;
|
|
585
|
+
node.width = width;
|
|
586
|
+
node.height = height;
|
|
587
|
+
node.offsetY = bbox.height - node.padding / 2;
|
|
588
|
+
node.labelBBox = bbox;
|
|
589
|
+
node.intersect = function(point) {
|
|
590
|
+
return intersect_rect_default(node, point);
|
|
591
|
+
};
|
|
592
|
+
return {
|
|
593
|
+
cluster: shapeSvg,
|
|
594
|
+
labelBBox: bbox
|
|
595
|
+
};
|
|
596
|
+
}, "usecaseSystemBoundary"),
|
|
597
|
+
swimlane
|
|
598
|
+
};
|
|
599
|
+
var UNTITLED_CLUSTER_SHAPES = /* @__PURE__ */ new Set(["noteGroup", "divider"]);
|
|
600
|
+
var clusterPaintsTitle = /* @__PURE__ */ __name((shape) => !UNTITLED_CLUSTER_SHAPES.has(shape ?? "rect"), "clusterPaintsTitle");
|
|
601
|
+
var clusterElems = /* @__PURE__ */ new Map();
|
|
602
|
+
var insertCluster = /* @__PURE__ */ __name(async (elem, node) => {
|
|
603
|
+
const cluster = await shapes[node.shape || "rect"](elem, node);
|
|
604
|
+
clusterElems.set(node.id, cluster);
|
|
605
|
+
return cluster;
|
|
606
|
+
}, "insertCluster");
|
|
607
|
+
var clear = /* @__PURE__ */ __name(() => {
|
|
608
|
+
clusterElems = /* @__PURE__ */ new Map();
|
|
609
|
+
}, "clear");
|
|
610
|
+
|
|
611
|
+
//#endregion
|
|
612
|
+
export { clusterPaintsTitle as n, insertCluster as r, clear as t };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
2
|
+
import { m as log } from "./src-NkhI3UMl.js";
|
|
3
|
+
import { c as configureSvgSize } from "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WEXAMYUT.mjs
|
|
6
|
+
var setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding, cssDiagram, useMaxWidth) => {
|
|
7
|
+
svg.attr("class", cssDiagram);
|
|
8
|
+
const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
|
|
9
|
+
configureSvgSize(svg, height, width, useMaxWidth);
|
|
10
|
+
const viewBox = createViewBox(x, y, width, height, padding);
|
|
11
|
+
svg.attr("viewBox", viewBox);
|
|
12
|
+
log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);
|
|
13
|
+
}, "setupViewPortForSVG");
|
|
14
|
+
var calculateDimensionsWithPadding = /* @__PURE__ */ __name((svg, padding) => {
|
|
15
|
+
const bounds = svg.node()?.getBBox() || {
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0,
|
|
18
|
+
x: 0,
|
|
19
|
+
y: 0
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
width: bounds.width + padding * 2,
|
|
23
|
+
height: bounds.height + padding * 2,
|
|
24
|
+
x: bounds.x,
|
|
25
|
+
y: bounds.y
|
|
26
|
+
};
|
|
27
|
+
}, "calculateDimensionsWithPadding");
|
|
28
|
+
var createViewBox = /* @__PURE__ */ __name((x, y, width, height, padding) => {
|
|
29
|
+
return `${x - padding} ${y - padding} ${width} ${height}`;
|
|
30
|
+
}, "createViewBox");
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { setupViewPortForSVG as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
2
|
+
import { p as select_default } from "./src-NkhI3UMl.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-XXDRQBXY.mjs
|
|
5
|
+
var getDiagramElement = /* @__PURE__ */ __name((id, securityLevel) => {
|
|
6
|
+
let sandboxElement;
|
|
7
|
+
if (securityLevel === "sandbox") sandboxElement = select_default("#i" + id);
|
|
8
|
+
return (securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body")).select(`[id="${id}"]`);
|
|
9
|
+
}, "getDiagramElement");
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getDiagramElement as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
4
|
+
value,
|
|
5
|
+
configurable: true
|
|
6
|
+
});
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { __name as n, __export as t };
|