@schmitech/chatbot-widget 0.5.3 → 0.5.4
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/Tableau10-D7jGxypv-BNlEL2G_.js +9 -0
- package/dist/arc-D-ZI5fuh-CvDHBzlN.js +84 -0
- package/dist/blockDiagram-c4efeb88-DUnNxfIR-Bhh-x1q6.js +1221 -0
- package/dist/c4Diagram-c83219d4-cC4OxfBG-DRTO_jy5.js +1580 -0
- package/dist/channel-hcYozyrT-BSOc2Hp-.js +6 -0
- package/dist/chatbot-widget.bundle.js +3881 -1586
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +12 -63659
- package/dist/chatbot-widget.umd.js +3880 -1585
- package/dist/classDiagram-beda092f-BLYhf5Mr-vk4Ko58U.js +218 -0
- package/dist/classDiagram-v2-2358418a-VBkbF8mr-Ca0l1fEs.js +201 -0
- package/dist/clone-BZIkCMuw-B9owNq6E.js +9 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/createText-1719965b-UejsQ47k-B1DYw0WW.js +2955 -0
- package/dist/edges-96097737-1M5QvjOd-BpQVVoQN.js +1088 -0
- package/dist/erDiagram-0228fc6a-CjBNxHoC-DXDVlH55.js +929 -0
- package/dist/flowDb-c6c81e3f-Q2aoOxdz-DfrfI3H1.js +1127 -0
- package/dist/flowDiagram-50d868cf-zizL6ppE-BAH-_juu.js +788 -0
- package/dist/flowDiagram-v2-4f6560a1-DVx_vlO5-bkcRE0UW.js +18 -0
- package/dist/flowchart-elk-definition-6af322e1-Eyez36go-B_lk3oHt.js +48132 -0
- package/dist/ganttDiagram-a2739b55-C82Jv-TO-DoS-s1Yu.js +1743 -0
- package/dist/gitGraphDiagram-82fe8481-D9o_9-U8-DJF-ZeR8.js +1265 -0
- package/dist/graph-BjmGDpTe-DgbYS1Ie.js +848 -0
- package/dist/index-5325376f-CJL5w-Sw-BXp44Ej5.js +374 -0
- package/dist/index-s6Yb6o1D.js +116386 -0
- package/dist/infoDiagram-8eee0895-FpS-TLK_-BnvO_wUe.js +320 -0
- package/dist/journeyDiagram-c64418c1-CMj1efQ9-CshcRDhm.js +802 -0
- package/dist/layout-D_6hdlf3-B7guhEBN.js +1470 -0
- package/dist/mindmap-definition-8da855dc-D4SxHjUd-jFZFomnk.js +21924 -0
- package/dist/pieDiagram-a8764435-BF5ZqOjB-Mqzg2J4Q.js +498 -0
- package/dist/quadrantDiagram-1e28029f-GtQb80VU-DCy1QjzW.js +903 -0
- package/dist/requirementDiagram-08caed73-CHtPj3FO-AHEP0cIt.js +767 -0
- package/dist/sankeyDiagram-a04cb91d-CBlXzOgd-CWJTc5AX.js +802 -0
- package/dist/sequenceDiagram-c5b8d532-Cs1iyw97-oayOJE8v.js +2235 -0
- package/dist/shared/styles.d.ts +1 -1
- package/dist/stateDiagram-1ecb1508-CpRKICMQ-C5OFJeRZ.js +266 -0
- package/dist/stateDiagram-v2-c2b004d7-BtkhFyQ5-DxzE8Je5.js +185 -0
- package/dist/styles-b4e223ce-D0oeHeKH-BmNvk4NR.js +1090 -0
- package/dist/styles-ca3715f6-BouNgl-L-_qXsPDP3.js +961 -0
- package/dist/styles-d45a18b0-Cvhb8Ltu-43I3Cd_I.js +437 -0
- package/dist/svgDrawCommon-b86b1483-mg-1NjZY-DrmnILcc.js +65 -0
- package/dist/timeline-definition-faaaa080-3olbep_P-BqKpgsPZ.js +793 -0
- package/dist/ui/Message.d.ts +1 -5
- package/dist/ui/MessagesList.d.ts +1 -5
- package/dist/xychartDiagram-f5964ef8-BN6HXpmW-C-g_F1w2.js +1238 -0
- package/package.json +3 -3
- package/dist/ui/TypingEffect.d.ts +0 -18
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { Y, K as B, z as C } from "./styles-b4e223ce-D0oeHeKH-BmNvk4NR.js";
|
|
2
|
+
import { g as H, O as f, P as v, W, c as D, k as G, i as T, G as J } from "./index-s6Yb6o1D.js";
|
|
3
|
+
import { K as P } from "./graph-BjmGDpTe-DgbYS1Ie.js";
|
|
4
|
+
import { A as X } from "./layout-D_6hdlf3-B7guhEBN.js";
|
|
5
|
+
typeof window < "u" && (window.global = window);
|
|
6
|
+
let O = 0;
|
|
7
|
+
const Z = function(n, a, t, s, l) {
|
|
8
|
+
const c = function(i) {
|
|
9
|
+
switch (i) {
|
|
10
|
+
case l.db.relationType.AGGREGATION:
|
|
11
|
+
return "aggregation";
|
|
12
|
+
case l.db.relationType.EXTENSION:
|
|
13
|
+
return "extension";
|
|
14
|
+
case l.db.relationType.COMPOSITION:
|
|
15
|
+
return "composition";
|
|
16
|
+
case l.db.relationType.DEPENDENCY:
|
|
17
|
+
return "dependency";
|
|
18
|
+
case l.db.relationType.LOLLIPOP:
|
|
19
|
+
return "lollipop";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
a.points = a.points.filter((i) => !Number.isNaN(i.y));
|
|
23
|
+
const o = a.points, g = D().x(function(i) {
|
|
24
|
+
return i.x;
|
|
25
|
+
}).y(function(i) {
|
|
26
|
+
return i.y;
|
|
27
|
+
}).curve(G), d = n.append("path").attr("d", g(o)).attr("id", "edge" + O).attr("class", "relation");
|
|
28
|
+
let r = "";
|
|
29
|
+
s.arrowMarkerAbsolute && (r = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, r = r.replace(/\(/g, "\\("), r = r.replace(/\)/g, "\\)")), t.relation.lineType == 1 && d.attr("class", "relation dashed-line"), t.relation.lineType == 10 && d.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && d.attr(
|
|
30
|
+
"marker-start",
|
|
31
|
+
"url(" + r + "#" + c(t.relation.type1) + "Start)"
|
|
32
|
+
), t.relation.type2 !== "none" && d.attr(
|
|
33
|
+
"marker-end",
|
|
34
|
+
"url(" + r + "#" + c(t.relation.type2) + "End)"
|
|
35
|
+
);
|
|
36
|
+
let y, p;
|
|
37
|
+
const x = a.points.length;
|
|
38
|
+
let m = T.calcLabelPosition(a.points);
|
|
39
|
+
y = m.x, p = m.y;
|
|
40
|
+
let w, b, e, h;
|
|
41
|
+
if (x % 2 !== 0 && x > 1) {
|
|
42
|
+
let i = T.calcCardinalityPosition(
|
|
43
|
+
t.relation.type1 !== "none",
|
|
44
|
+
a.points,
|
|
45
|
+
a.points[0]
|
|
46
|
+
), u = T.calcCardinalityPosition(
|
|
47
|
+
t.relation.type2 !== "none",
|
|
48
|
+
a.points,
|
|
49
|
+
a.points[x - 1]
|
|
50
|
+
);
|
|
51
|
+
f.debug("cardinality_1_point " + JSON.stringify(i)), f.debug("cardinality_2_point " + JSON.stringify(u)), w = i.x, b = i.y, e = u.x, h = u.y;
|
|
52
|
+
}
|
|
53
|
+
if (t.title !== void 0) {
|
|
54
|
+
const i = n.append("g").attr("class", "classLabel"), u = i.append("text").attr("class", "label").attr("x", y).attr("y", p).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
|
|
55
|
+
window.label = u;
|
|
56
|
+
const E = u.node().getBBox();
|
|
57
|
+
i.insert("rect", ":first-child").attr("class", "box").attr("x", E.x - s.padding / 2).attr("y", E.y - s.padding / 2).attr("width", E.width + s.padding).attr("height", E.height + s.padding);
|
|
58
|
+
}
|
|
59
|
+
f.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && n.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", w).attr("y", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && n.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", e).attr("y", h).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), O++;
|
|
60
|
+
}, $ = function(n, a, t, s) {
|
|
61
|
+
f.debug("Rendering class ", a, t);
|
|
62
|
+
const l = a.id, c = {
|
|
63
|
+
id: l,
|
|
64
|
+
label: a.id,
|
|
65
|
+
width: 0,
|
|
66
|
+
height: 0
|
|
67
|
+
}, o = n.append("g").attr("id", s.db.lookUpDomId(l)).attr("class", "classGroup");
|
|
68
|
+
let g;
|
|
69
|
+
a.link ? g = o.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : g = o.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
70
|
+
let d = !0;
|
|
71
|
+
a.annotations.forEach(function(i) {
|
|
72
|
+
const u = g.append("tspan").text("«" + i + "»");
|
|
73
|
+
d || u.attr("dy", t.textHeight), d = !1;
|
|
74
|
+
});
|
|
75
|
+
let r = A(a);
|
|
76
|
+
const y = g.append("tspan").text(r).attr("class", "title");
|
|
77
|
+
d || y.attr("dy", t.textHeight);
|
|
78
|
+
const p = g.node().getBBox().height;
|
|
79
|
+
let x, m, w;
|
|
80
|
+
if (a.members.length > 0) {
|
|
81
|
+
x = o.append("line").attr("x1", 0).attr("y1", t.padding + p + t.dividerMargin / 2).attr("y2", t.padding + p + t.dividerMargin / 2);
|
|
82
|
+
const i = o.append("text").attr("x", t.padding).attr("y", p + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
83
|
+
d = !0, a.members.forEach(function(u) {
|
|
84
|
+
S(i, u, d, t), d = !1;
|
|
85
|
+
}), m = i.node().getBBox();
|
|
86
|
+
}
|
|
87
|
+
if (a.methods.length > 0) {
|
|
88
|
+
w = o.append("line").attr("x1", 0).attr("y1", t.padding + p + t.dividerMargin + m.height).attr("y2", t.padding + p + t.dividerMargin + m.height);
|
|
89
|
+
const i = o.append("text").attr("x", t.padding).attr("y", p + 2 * t.dividerMargin + m.height + t.textHeight).attr("fill", "white").attr("class", "classText");
|
|
90
|
+
d = !0, a.methods.forEach(function(u) {
|
|
91
|
+
S(i, u, d, t), d = !1;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const b = o.node().getBBox();
|
|
95
|
+
var e = " ";
|
|
96
|
+
a.cssClasses.length > 0 && (e = e + a.cssClasses.join(" "));
|
|
97
|
+
const h = o.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", b.width + 2 * t.padding).attr("height", b.height + t.padding + 0.5 * t.dividerMargin).attr("class", e).node().getBBox().width;
|
|
98
|
+
return g.node().childNodes.forEach(function(i) {
|
|
99
|
+
i.setAttribute("x", (h - i.getBBox().width) / 2);
|
|
100
|
+
}), a.tooltip && g.insert("title").text(a.tooltip), x && x.attr("x2", h), w && w.attr("x2", h), c.width = h, c.height = b.height + t.padding + 0.5 * t.dividerMargin, c;
|
|
101
|
+
}, A = function(n) {
|
|
102
|
+
let a = n.id;
|
|
103
|
+
return n.type && (a += "<" + J(n.type) + ">"), a;
|
|
104
|
+
}, R = function(n, a, t, s) {
|
|
105
|
+
f.debug("Rendering note ", a, t);
|
|
106
|
+
const l = a.id, c = {
|
|
107
|
+
id: l,
|
|
108
|
+
text: a.text,
|
|
109
|
+
width: 0,
|
|
110
|
+
height: 0
|
|
111
|
+
}, o = n.append("g").attr("id", l).attr("class", "classGroup");
|
|
112
|
+
let g = o.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
|
|
113
|
+
const d = JSON.parse(`"${a.text}"`).split(`
|
|
114
|
+
`);
|
|
115
|
+
d.forEach(function(p) {
|
|
116
|
+
f.debug(`Adding line: ${p}`), g.append("tspan").text(p).attr("class", "title").attr("dy", t.textHeight);
|
|
117
|
+
});
|
|
118
|
+
const r = o.node().getBBox(), y = o.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr(
|
|
119
|
+
"height",
|
|
120
|
+
r.height + d.length * t.textHeight + t.padding + 0.5 * t.dividerMargin
|
|
121
|
+
).node().getBBox().width;
|
|
122
|
+
return g.node().childNodes.forEach(function(p) {
|
|
123
|
+
p.setAttribute("x", (y - p.getBBox().width) / 2);
|
|
124
|
+
}), c.width = y, c.height = r.height + d.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, c;
|
|
125
|
+
}, S = function(n, a, t, s) {
|
|
126
|
+
const { displayText: l, cssStyle: c } = a.getDisplayDetails(), o = n.append("tspan").attr("x", s.padding).text(l);
|
|
127
|
+
c !== "" && o.attr("style", a.cssStyle), t || o.attr("dy", s.textHeight);
|
|
128
|
+
}, M = {
|
|
129
|
+
getClassTitleString: A,
|
|
130
|
+
drawClass: $,
|
|
131
|
+
drawEdge: Z,
|
|
132
|
+
drawNote: R
|
|
133
|
+
};
|
|
134
|
+
let N = {};
|
|
135
|
+
const L = 20, k = function(n) {
|
|
136
|
+
const a = Object.entries(N).find((t) => t[1].label === n);
|
|
137
|
+
if (a)
|
|
138
|
+
return a[0];
|
|
139
|
+
}, I = function(n) {
|
|
140
|
+
n.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), n.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), n.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), n.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), n.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), n.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), n.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), n.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
141
|
+
}, z = function(n, a, t, s) {
|
|
142
|
+
const l = H().class;
|
|
143
|
+
N = {}, f.info("Rendering diagram " + n);
|
|
144
|
+
const c = H().securityLevel;
|
|
145
|
+
let o;
|
|
146
|
+
c === "sandbox" && (o = v("#i" + a));
|
|
147
|
+
const g = c === "sandbox" ? v(o.nodes()[0].contentDocument.body) : v("body"), d = g.select(`[id='${a}']`);
|
|
148
|
+
I(d);
|
|
149
|
+
const r = new P({
|
|
150
|
+
multigraph: !0
|
|
151
|
+
});
|
|
152
|
+
r.setGraph({
|
|
153
|
+
isMultiGraph: !0
|
|
154
|
+
}), r.setDefaultEdgeLabel(function() {
|
|
155
|
+
return {};
|
|
156
|
+
});
|
|
157
|
+
const y = s.db.getClasses(), p = Object.keys(y);
|
|
158
|
+
for (const e of p) {
|
|
159
|
+
const h = y[e], i = M.drawClass(d, h, l, s);
|
|
160
|
+
N[i.id] = i, r.setNode(i.id, i), f.info("Org height: " + i.height);
|
|
161
|
+
}
|
|
162
|
+
s.db.getRelations().forEach(function(e) {
|
|
163
|
+
f.info(
|
|
164
|
+
// cspell:ignore tjoho
|
|
165
|
+
"tjoho" + k(e.id1) + k(e.id2) + JSON.stringify(e)
|
|
166
|
+
), r.setEdge(
|
|
167
|
+
k(e.id1),
|
|
168
|
+
k(e.id2),
|
|
169
|
+
{
|
|
170
|
+
relation: e
|
|
171
|
+
},
|
|
172
|
+
e.title || "DEFAULT"
|
|
173
|
+
);
|
|
174
|
+
}), s.db.getNotes().forEach(function(e) {
|
|
175
|
+
f.debug(`Adding note: ${JSON.stringify(e)}`);
|
|
176
|
+
const h = M.drawNote(d, e, l, s);
|
|
177
|
+
N[h.id] = h, r.setNode(h.id, h), e.class && e.class in y && r.setEdge(
|
|
178
|
+
e.id,
|
|
179
|
+
k(e.class),
|
|
180
|
+
{
|
|
181
|
+
relation: {
|
|
182
|
+
id1: e.id,
|
|
183
|
+
id2: e.class,
|
|
184
|
+
relation: {
|
|
185
|
+
type1: "none",
|
|
186
|
+
type2: "none",
|
|
187
|
+
lineType: 10
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"DEFAULT"
|
|
192
|
+
);
|
|
193
|
+
}), X(r), r.nodes().forEach(function(e) {
|
|
194
|
+
e !== void 0 && r.node(e) !== void 0 && (f.debug("Node " + e + ": " + JSON.stringify(r.node(e))), g.select("#" + (s.db.lookUpDomId(e) || e)).attr(
|
|
195
|
+
"transform",
|
|
196
|
+
"translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"
|
|
197
|
+
));
|
|
198
|
+
}), r.edges().forEach(function(e) {
|
|
199
|
+
e !== void 0 && r.edge(e) !== void 0 && (f.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), M.drawEdge(d, r.edge(e), r.edge(e).relation, l, s));
|
|
200
|
+
});
|
|
201
|
+
const x = d.node().getBBox(), m = x.width + L * 2, w = x.height + L * 2;
|
|
202
|
+
W(d, w, m, l.useMaxWidth);
|
|
203
|
+
const b = `${x.x - L} ${x.y - L} ${m} ${w}`;
|
|
204
|
+
f.debug(`viewBox ${b}`), d.attr("viewBox", b);
|
|
205
|
+
}, F = {
|
|
206
|
+
draw: z
|
|
207
|
+
}, V = {
|
|
208
|
+
parser: C,
|
|
209
|
+
db: B,
|
|
210
|
+
renderer: F,
|
|
211
|
+
styles: Y,
|
|
212
|
+
init: (n) => {
|
|
213
|
+
n.class || (n.class = {}), n.class.arrowMarkerAbsolute = n.arrowMarkerAbsolute, B.clear();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
export {
|
|
217
|
+
V as diagram
|
|
218
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Y as $, K as L, z as M } from "./styles-b4e223ce-D0oeHeKH-BmNvk4NR.js";
|
|
2
|
+
import { O as c, g as d, P as m, i as P, d as B, l as E, R as D, _ as A, Y as _ } from "./index-s6Yb6o1D.js";
|
|
3
|
+
import { K } from "./graph-BjmGDpTe-DgbYS1Ie.js";
|
|
4
|
+
import { b as O } from "./index-5325376f-CJL5w-Sw-BXp44Ej5.js";
|
|
5
|
+
import "./layout-D_6hdlf3-B7guhEBN.js";
|
|
6
|
+
typeof window < "u" && (window.global = window);
|
|
7
|
+
const k = (a) => E.sanitizeText(a, d());
|
|
8
|
+
let x = {
|
|
9
|
+
dividerMargin: 10,
|
|
10
|
+
padding: 5,
|
|
11
|
+
textHeight: 10,
|
|
12
|
+
curve: void 0
|
|
13
|
+
};
|
|
14
|
+
const Y = function(a, t, b, i) {
|
|
15
|
+
const e = Object.keys(a);
|
|
16
|
+
c.info("keys:", e), c.info(a), e.forEach(function(s) {
|
|
17
|
+
var l, r;
|
|
18
|
+
const o = a[s], n = {
|
|
19
|
+
shape: "rect",
|
|
20
|
+
id: o.id,
|
|
21
|
+
domId: o.domId,
|
|
22
|
+
labelText: k(o.id),
|
|
23
|
+
labelStyle: "",
|
|
24
|
+
style: "fill: none; stroke: black",
|
|
25
|
+
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
26
|
+
padding: ((l = d().flowchart) == null ? void 0 : l.padding) ?? ((r = d().class) == null ? void 0 : r.padding)
|
|
27
|
+
};
|
|
28
|
+
t.setNode(o.id, n), C(o.classes, t, b, i, o.id), c.info("setNode", n);
|
|
29
|
+
});
|
|
30
|
+
}, C = function(a, t, b, i, e) {
|
|
31
|
+
const s = Object.keys(a);
|
|
32
|
+
c.info("keys:", s), c.info(a), s.filter((l) => a[l].parent == e).forEach(function(l) {
|
|
33
|
+
var r, o;
|
|
34
|
+
const n = a[l], g = n.cssClasses.join(" "), f = D(n.styles), u = n.label ?? n.id, p = 0, y = {
|
|
35
|
+
labelStyle: f.labelStyle,
|
|
36
|
+
shape: "class_box",
|
|
37
|
+
labelText: k(u),
|
|
38
|
+
classData: n,
|
|
39
|
+
rx: p,
|
|
40
|
+
ry: p,
|
|
41
|
+
class: g,
|
|
42
|
+
style: f.style,
|
|
43
|
+
id: n.id,
|
|
44
|
+
domId: n.domId,
|
|
45
|
+
tooltip: i.db.getTooltip(n.id, e) || "",
|
|
46
|
+
haveCallback: n.haveCallback,
|
|
47
|
+
link: n.link,
|
|
48
|
+
width: n.type === "group" ? 500 : void 0,
|
|
49
|
+
type: n.type,
|
|
50
|
+
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
51
|
+
padding: ((r = d().flowchart) == null ? void 0 : r.padding) ?? ((o = d().class) == null ? void 0 : o.padding)
|
|
52
|
+
};
|
|
53
|
+
t.setNode(n.id, y), e && t.setParent(n.id, e), c.info("setNode", y);
|
|
54
|
+
});
|
|
55
|
+
}, j = function(a, t, b, i) {
|
|
56
|
+
c.info(a), a.forEach(function(e, s) {
|
|
57
|
+
var l, r;
|
|
58
|
+
const o = e, n = "", g = { labelStyle: "", style: "" }, f = o.text, u = 0, p = {
|
|
59
|
+
labelStyle: g.labelStyle,
|
|
60
|
+
shape: "note",
|
|
61
|
+
labelText: k(f),
|
|
62
|
+
noteData: o,
|
|
63
|
+
rx: u,
|
|
64
|
+
ry: u,
|
|
65
|
+
class: n,
|
|
66
|
+
style: g.style,
|
|
67
|
+
id: o.id,
|
|
68
|
+
domId: o.id,
|
|
69
|
+
tooltip: "",
|
|
70
|
+
type: "note",
|
|
71
|
+
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
72
|
+
padding: ((l = d().flowchart) == null ? void 0 : l.padding) ?? ((r = d().class) == null ? void 0 : r.padding)
|
|
73
|
+
};
|
|
74
|
+
if (t.setNode(o.id, p), c.info("setNode", p), !o.class || !(o.class in i))
|
|
75
|
+
return;
|
|
76
|
+
const y = b + s, v = {
|
|
77
|
+
id: `edgeNote${y}`,
|
|
78
|
+
//Set relationship style and line type
|
|
79
|
+
classes: "relation",
|
|
80
|
+
pattern: "dotted",
|
|
81
|
+
// Set link type for rendering
|
|
82
|
+
arrowhead: "none",
|
|
83
|
+
//Set edge extra labels
|
|
84
|
+
startLabelRight: "",
|
|
85
|
+
endLabelLeft: "",
|
|
86
|
+
//Set relation arrow types
|
|
87
|
+
arrowTypeStart: "none",
|
|
88
|
+
arrowTypeEnd: "none",
|
|
89
|
+
style: "fill:none",
|
|
90
|
+
labelStyle: "",
|
|
91
|
+
curve: A(x.curve, _)
|
|
92
|
+
};
|
|
93
|
+
t.setEdge(o.id, o.class, v, y);
|
|
94
|
+
});
|
|
95
|
+
}, z = function(a, t) {
|
|
96
|
+
const b = d().flowchart;
|
|
97
|
+
let i = 0;
|
|
98
|
+
a.forEach(function(e) {
|
|
99
|
+
var s;
|
|
100
|
+
i++;
|
|
101
|
+
const l = {
|
|
102
|
+
//Set relationship style and line type
|
|
103
|
+
classes: "relation",
|
|
104
|
+
pattern: e.relation.lineType == 1 ? "dashed" : "solid",
|
|
105
|
+
id: `id_${e.id1}_${e.id2}_${i}`,
|
|
106
|
+
// Set link type for rendering
|
|
107
|
+
arrowhead: e.type === "arrow_open" ? "none" : "normal",
|
|
108
|
+
//Set edge extra labels
|
|
109
|
+
startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
|
|
110
|
+
endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
|
|
111
|
+
//Set relation arrow types
|
|
112
|
+
arrowTypeStart: N(e.relation.type1),
|
|
113
|
+
arrowTypeEnd: N(e.relation.type2),
|
|
114
|
+
style: "fill:none",
|
|
115
|
+
labelStyle: "",
|
|
116
|
+
curve: A(b == null ? void 0 : b.curve, _)
|
|
117
|
+
};
|
|
118
|
+
if (c.info(l, e), e.style !== void 0) {
|
|
119
|
+
const r = D(e.style);
|
|
120
|
+
l.style = r.style, l.labelStyle = r.labelStyle;
|
|
121
|
+
}
|
|
122
|
+
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", ((s = d().flowchart) == null ? void 0 : s.htmlLabels) ?? d().htmlLabels ? (l.labelType = "html", l.label = '<span class="edgeLabel">' + e.text + "</span>") : (l.labelType = "text", l.label = e.text.replace(E.lineBreakRegex, `
|
|
123
|
+
`), e.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), t.setEdge(e.id1, e.id2, l, i);
|
|
124
|
+
});
|
|
125
|
+
}, H = function(a) {
|
|
126
|
+
x = {
|
|
127
|
+
...x,
|
|
128
|
+
...a
|
|
129
|
+
};
|
|
130
|
+
}, W = async function(a, t, b, i) {
|
|
131
|
+
c.info("Drawing class - ", t);
|
|
132
|
+
const e = d().flowchart ?? d().class, s = d().securityLevel;
|
|
133
|
+
c.info("config:", e);
|
|
134
|
+
const l = (e == null ? void 0 : e.nodeSpacing) ?? 50, r = (e == null ? void 0 : e.rankSpacing) ?? 50, o = new K({
|
|
135
|
+
multigraph: !0,
|
|
136
|
+
compound: !0
|
|
137
|
+
}).setGraph({
|
|
138
|
+
rankdir: i.db.getDirection(),
|
|
139
|
+
nodesep: l,
|
|
140
|
+
ranksep: r,
|
|
141
|
+
marginx: 8,
|
|
142
|
+
marginy: 8
|
|
143
|
+
}).setDefaultEdgeLabel(function() {
|
|
144
|
+
return {};
|
|
145
|
+
}), n = i.db.getNamespaces(), g = i.db.getClasses(), f = i.db.getRelations(), u = i.db.getNotes();
|
|
146
|
+
c.info(f), Y(n, o, t, i), C(g, o, t, i), z(f, o), j(u, o, f.length + 1, g);
|
|
147
|
+
let p;
|
|
148
|
+
s === "sandbox" && (p = m("#i" + t));
|
|
149
|
+
const y = s === "sandbox" ? m(p.nodes()[0].contentDocument.body) : m("body"), v = y.select(`[id="${t}"]`), I = y.select("#" + t + " g");
|
|
150
|
+
if (await O(
|
|
151
|
+
I,
|
|
152
|
+
o,
|
|
153
|
+
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
154
|
+
"classDiagram",
|
|
155
|
+
t
|
|
156
|
+
), P.insertTitle(v, "classTitleText", (e == null ? void 0 : e.titleTopMargin) ?? 5, i.db.getDiagramTitle()), B(o, v, e == null ? void 0 : e.diagramPadding, e == null ? void 0 : e.useMaxWidth), !(e != null && e.htmlLabels)) {
|
|
157
|
+
const T = s === "sandbox" ? p.nodes()[0].contentDocument : document, R = T.querySelectorAll('[id="' + t + '"] .edgeLabel .label');
|
|
158
|
+
for (const w of R) {
|
|
159
|
+
const S = w.getBBox(), h = T.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
160
|
+
h.setAttribute("rx", 0), h.setAttribute("ry", 0), h.setAttribute("width", S.width), h.setAttribute("height", S.height), w.insertBefore(h, w.firstChild);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
function N(a) {
|
|
165
|
+
let t;
|
|
166
|
+
switch (a) {
|
|
167
|
+
case 0:
|
|
168
|
+
t = "aggregation";
|
|
169
|
+
break;
|
|
170
|
+
case 1:
|
|
171
|
+
t = "extension";
|
|
172
|
+
break;
|
|
173
|
+
case 2:
|
|
174
|
+
t = "composition";
|
|
175
|
+
break;
|
|
176
|
+
case 3:
|
|
177
|
+
t = "dependency";
|
|
178
|
+
break;
|
|
179
|
+
case 4:
|
|
180
|
+
t = "lollipop";
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
t = "none";
|
|
184
|
+
}
|
|
185
|
+
return t;
|
|
186
|
+
}
|
|
187
|
+
const q = {
|
|
188
|
+
setConf: H,
|
|
189
|
+
draw: W
|
|
190
|
+
}, Q = {
|
|
191
|
+
parser: M,
|
|
192
|
+
db: L,
|
|
193
|
+
renderer: q,
|
|
194
|
+
styles: $,
|
|
195
|
+
init: (a) => {
|
|
196
|
+
a.class || (a.class = {}), a.class.arrowMarkerAbsolute = a.arrowMarkerAbsolute, L.clear();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
export {
|
|
200
|
+
Q as diagram
|
|
201
|
+
};
|
package/dist/config/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface ChatConfig {
|
|
|
22
22
|
assistantText?: string;
|
|
23
23
|
};
|
|
24
24
|
suggestedQuestions: {
|
|
25
|
-
|
|
25
|
+
questionsBackground: string;
|
|
26
26
|
text: string;
|
|
27
27
|
highlightedBackground: string;
|
|
28
28
|
};
|
|
@@ -63,7 +63,7 @@ export declare const defaultTheme: {
|
|
|
63
63
|
assistant: string;
|
|
64
64
|
};
|
|
65
65
|
suggestedQuestions: {
|
|
66
|
-
|
|
66
|
+
questionsBackground: string;
|
|
67
67
|
text: string;
|
|
68
68
|
highlightedBackground: string;
|
|
69
69
|
};
|