@digipair/skill-web-chatbot 0.89.0 → 0.91.0-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 (136) hide show
  1. package/.swcrc +28 -0
  2. package/README.md +7 -0
  3. package/eslint.config.mjs +22 -0
  4. package/package.json +22 -7
  5. package/rollup.config.cjs +28 -0
  6. package/src/digipair__engine.d.ts +2 -0
  7. package/src/handlebars.d.ts +1 -0
  8. package/src/index.html +18 -0
  9. package/src/lib/chat.element.ts +603 -0
  10. package/src/lib/common.data.ts +1 -0
  11. package/src/lib/config.ts +30 -0
  12. package/src/lib/digipair-full.data.ts +101 -0
  13. package/src/lib/digipair-full.element.ts +358 -0
  14. package/src/lib/digipair.data.ts +103 -0
  15. package/src/lib/digipair.element.ts +446 -0
  16. package/src/lib/inputs.element.ts +46 -0
  17. package/src/lib/mermaid.d.ts +1 -0
  18. package/src/lib/message.interface.ts +10 -0
  19. package/src/lib/pins/chatbot.actions.ts +32 -0
  20. package/src/lib/tools/css-selector.ts +12 -0
  21. package/tsconfig.json +13 -0
  22. package/tsconfig.lib.json +19 -0
  23. package/SAP-icons.cjs.js +0 -2489
  24. package/SAP-icons.cjs2.js +0 -2489
  25. package/SAP-icons.esm.js +0 -2482
  26. package/SAP-icons.esm2.js +0 -2482
  27. package/Tableau10-558cc280.cjs.js +0 -9
  28. package/Tableau10-558cc280.esm.js +0 -7
  29. package/arc-d1f6357e.cjs.js +0 -88
  30. package/arc-d1f6357e.esm.js +0 -86
  31. package/array-2ff2c7a6.cjs.js +0 -7
  32. package/array-2ff2c7a6.esm.js +0 -5
  33. package/blockDiagram-5dc23a45.cjs.js +0 -2921
  34. package/blockDiagram-5dc23a45.esm.js +0 -2919
  35. package/c4Diagram-1e775db3.cjs.js +0 -4387
  36. package/c4Diagram-1e775db3.esm.js +0 -4385
  37. package/channel-ebbc4130.cjs.js +0 -9
  38. package/channel-ebbc4130.esm.js +0 -7
  39. package/classDiagram-f52caa06.cjs.js +0 -209
  40. package/classDiagram-f52caa06.esm.js +0 -207
  41. package/classDiagram-v2-640c694e.cjs.js +0 -401
  42. package/classDiagram-v2-640c694e.esm.js +0 -399
  43. package/clone-afc2f047.cjs.js +0 -10
  44. package/clone-afc2f047.esm.js +0 -8
  45. package/createText-03b82060.cjs.js +0 -2936
  46. package/createText-03b82060.esm.js +0 -2933
  47. package/edges-16357fde.cjs.js +0 -1998
  48. package/edges-16357fde.esm.js +0 -1981
  49. package/erDiagram-c7ff1bec.cjs.js +0 -1807
  50. package/erDiagram-c7ff1bec.esm.js +0 -1805
  51. package/flowDb-9a89ea33.cjs.js +0 -5542
  52. package/flowDb-9a89ea33.esm.js +0 -5538
  53. package/flowDiagram-aadb13b0.cjs.js +0 -1351
  54. package/flowDiagram-aadb13b0.esm.js +0 -1349
  55. package/flowDiagram-v2-f2119625.cjs.js +0 -31
  56. package/flowDiagram-v2-f2119625.esm.js +0 -29
  57. package/flowchart-elk-definition-cf813a97.cjs.js +0 -50257
  58. package/flowchart-elk-definition-cf813a97.esm.js +0 -50255
  59. package/ganttDiagram-3c2fde2b.cjs.js +0 -3710
  60. package/ganttDiagram-3c2fde2b.esm.js +0 -3708
  61. package/gitGraphDiagram-c3a0619c.cjs.js +0 -3820
  62. package/gitGraphDiagram-c3a0619c.esm.js +0 -3818
  63. package/graph-0ee63739.cjs.js +0 -961
  64. package/graph-0ee63739.esm.js +0 -938
  65. package/index-bb6d8841.cjs.js +0 -648
  66. package/index-bb6d8841.esm.js +0 -646
  67. package/index.cjs.d.ts +0 -1
  68. package/index.cjs.js +0 -17
  69. package/index.cjs2.js +0 -60723
  70. package/index.esm.js +0 -1
  71. package/index.esm2.js +0 -60574
  72. package/infoDiagram-2f5c50c0.cjs.js +0 -460
  73. package/infoDiagram-2f5c50c0.esm.js +0 -458
  74. package/init-f9637058.cjs.js +0 -17
  75. package/init-f9637058.esm.js +0 -15
  76. package/journeyDiagram-14fe341a.cjs.js +0 -1061
  77. package/journeyDiagram-14fe341a.esm.js +0 -1059
  78. package/katex-d90b6d29.cjs.js +0 -25690
  79. package/katex-d90b6d29.esm.js +0 -25688
  80. package/layout-fd473db2.cjs.js +0 -1626
  81. package/layout-fd473db2.esm.js +0 -1619
  82. package/libs/engine/src/index.d.ts +0 -2
  83. package/libs/engine/src/lib/alias.interface.d.ts +0 -9
  84. package/libs/engine/src/lib/engine.d.ts +0 -13
  85. package/libs/engine/src/lib/pins-settings.interface.d.ts +0 -15
  86. package/libs/skill-web-chatbot/src/lib/chat.element.d.ts +0 -28
  87. package/libs/skill-web-chatbot/src/lib/common.data.d.ts +0 -1
  88. package/libs/skill-web-chatbot/src/lib/config.d.ts +0 -9
  89. package/libs/skill-web-chatbot/src/lib/digipair-full.data.d.ts +0 -1
  90. package/libs/skill-web-chatbot/src/lib/digipair-full.element.d.ts +0 -36
  91. package/libs/skill-web-chatbot/src/lib/digipair.data.d.ts +0 -1
  92. package/libs/skill-web-chatbot/src/lib/digipair.element.d.ts +0 -44
  93. package/libs/skill-web-chatbot/src/lib/inputs.element.d.ts +0 -10
  94. package/libs/skill-web-chatbot/src/lib/message.interface.d.ts +0 -10
  95. package/libs/skill-web-chatbot/src/lib/pins/chatbot.actions.d.ts +0 -1
  96. package/libs/skill-web-chatbot/src/lib/tools/css-selector.d.ts +0 -1
  97. package/line-24d93f1b.cjs.js +0 -34
  98. package/line-24d93f1b.esm.js +0 -32
  99. package/linear-9bcf74c4.cjs.js +0 -537
  100. package/linear-9bcf74c4.esm.js +0 -531
  101. package/mindmap-definition-9399c7e6.cjs.js +0 -20489
  102. package/mindmap-definition-9399c7e6.esm.js +0 -20487
  103. package/ordinal-5695958c.cjs.js +0 -331
  104. package/ordinal-5695958c.esm.js +0 -329
  105. package/path-428ebac9.cjs.js +0 -317
  106. package/path-428ebac9.esm.js +0 -314
  107. package/pieDiagram-828dae43.cjs.js +0 -951
  108. package/pieDiagram-828dae43.esm.js +0 -949
  109. package/quadrantDiagram-5fa00455.cjs.js +0 -2410
  110. package/quadrantDiagram-5fa00455.esm.js +0 -2408
  111. package/requirementDiagram-03163dc4.cjs.js +0 -2267
  112. package/requirementDiagram-03163dc4.esm.js +0 -2265
  113. package/sankeyDiagram-52ec8976.cjs.js +0 -1848
  114. package/sankeyDiagram-52ec8976.esm.js +0 -1846
  115. package/sequenceDiagram-b517d154.cjs.js +0 -5949
  116. package/sequenceDiagram-b517d154.esm.js +0 -5947
  117. package/stateDiagram-fca82b5b.cjs.js +0 -283
  118. package/stateDiagram-fca82b5b.esm.js +0 -281
  119. package/stateDiagram-v2-ed04200a.cjs.js +0 -373
  120. package/stateDiagram-v2-ed04200a.esm.js +0 -371
  121. package/styles-11e81fdd.cjs.js +0 -3944
  122. package/styles-11e81fdd.esm.js +0 -3940
  123. package/styles-cacbff60.cjs.js +0 -2120
  124. package/styles-cacbff60.esm.js +0 -2111
  125. package/styles-e75131e4.cjs.js +0 -671
  126. package/styles-e75131e4.esm.js +0 -661
  127. package/svgDrawCommon-ecc5f780.cjs.js +0 -68
  128. package/svgDrawCommon-ecc5f780.esm.js +0 -60
  129. package/timeline-definition-4ee9bff4.cjs.js +0 -1161
  130. package/timeline-definition-4ee9bff4.esm.js +0 -1159
  131. package/xychartDiagram-e5e6b652.cjs.js +0 -3150
  132. package/xychartDiagram-e5e6b652.esm.js +0 -3148
  133. /package/{index.d.ts → src/index.d.ts} +0 -0
  134. /package/{libs/skill-web-chatbot/src/index.d.ts → src/index.ts} +0 -0
  135. /package/{schema.fr.json → src/schema.fr.json} +0 -0
  136. /package/{schema.json → src/schema.json} +0 -0
@@ -1,9 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index.cjs2.js');
4
-
5
- var s = function(a, n) {
6
- return index.$.lang.round(index.Ot.parse(a)[n]);
7
- }, e = s;
8
-
9
- exports.e = e;
@@ -1,7 +0,0 @@
1
- import { am as $, an as Ot } from './index.esm2.js';
2
-
3
- var s = function(a, n) {
4
- return $.lang.round(Ot.parse(a)[n]);
5
- }, e = s;
6
-
7
- export { e };
@@ -1,209 +0,0 @@
1
- 'use strict';
2
-
3
- var styles11e81fdd = require('./styles-11e81fdd.cjs.js');
4
- var index = require('./index.cjs2.js');
5
- var graph0ee63739 = require('./graph-0ee63739.cjs.js');
6
- var layoutFd473db2 = require('./layout-fd473db2.cjs.js');
7
- var line24d93f1b = require('./line-24d93f1b.cjs.js');
8
- require('./array-2ff2c7a6.cjs.js');
9
- require('./path-428ebac9.cjs.js');
10
-
11
- var _ = 0;
12
- var $ = function $(i, a, t, o, p) {
13
- var g = function g(e) {
14
- switch(e){
15
- case p.db.relationType.AGGREGATION:
16
- return "aggregation";
17
- case p.db.relationType.EXTENSION:
18
- return "extension";
19
- case p.db.relationType.COMPOSITION:
20
- return "composition";
21
- case p.db.relationType.DEPENDENCY:
22
- return "dependency";
23
- case p.db.relationType.LOLLIPOP:
24
- return "lollipop";
25
- }
26
- };
27
- a.points = a.points.filter(function(e) {
28
- return !Number.isNaN(e.y);
29
- });
30
- var s = a.points, c = line24d93f1b.P().x(function(e) {
31
- return e.x;
32
- }).y(function(e) {
33
- return e.y;
34
- }).curve(index.Pf), n = i.append("path").attr("d", c(s)).attr("id", "edge" + _).attr("class", "relation");
35
- var r = "";
36
- o.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 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr("marker-start", "url(" + r + "#" + g(t.relation.type1) + "Start)"), t.relation.type2 !== "none" && n.attr("marker-end", "url(" + r + "#" + g(t.relation.type2) + "End)");
37
- var f, h;
38
- var x = a.points.length;
39
- var k = index.ei.calcLabelPosition(a.points);
40
- f = k.x, h = k.y;
41
- var y, m, w, b;
42
- if (x % 2 !== 0 && x > 1) {
43
- var e = index.ei.calcCardinalityPosition(t.relation.type1 !== "none", a.points, a.points[0]), d = index.ei.calcCardinalityPosition(t.relation.type2 !== "none", a.points, a.points[x - 1]);
44
- index.L.debug("cardinality_1_point " + JSON.stringify(e)), index.L.debug("cardinality_2_point " + JSON.stringify(d)), y = e.x, m = e.y, w = d.x, b = d.y;
45
- }
46
- if (t.title !== void 0) {
47
- var e1 = i.append("g").attr("class", "classLabel"), d1 = e1.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
48
- window.label = d1;
49
- var l = d1.node().getBBox();
50
- e1.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
51
- }
52
- index.L.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", y).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), _++;
53
- }, J = function J(i, a, t, o) {
54
- index.L.debug("Rendering class ", a, t);
55
- var p = a.id, g = {
56
- id: p,
57
- label: a.id,
58
- width: 0,
59
- height: 0
60
- }, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
61
- var c;
62
- a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
63
- var n = !0;
64
- a.annotations.forEach(function(d) {
65
- var l = c.append("tspan").text("\xab" + d + "\xbb");
66
- n || l.attr("dy", t.textHeight), n = !1;
67
- });
68
- var r = C(a);
69
- var f = c.append("tspan").text(r).attr("class", "title");
70
- n || f.attr("dy", t.textHeight);
71
- var h = c.node().getBBox().height;
72
- var x, k, y;
73
- if (a.members.length > 0) {
74
- x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
75
- var d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
76
- n = !0, a.members.forEach(function(l) {
77
- v(d, l, n, t), n = !1;
78
- }), k = d.node().getBBox();
79
- }
80
- if (a.methods.length > 0) {
81
- y = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + k.height).attr("y2", t.padding + h + t.dividerMargin + k.height);
82
- var d1 = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + k.height + t.textHeight).attr("fill", "white").attr("class", "classText");
83
- n = !0, a.methods.forEach(function(l) {
84
- v(d1, l, n, t), n = !1;
85
- });
86
- }
87
- var m = s.node().getBBox();
88
- var w = " ";
89
- a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
90
- var e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
91
- return c.node().childNodes.forEach(function(d) {
92
- d.setAttribute("x", (e - d.getBBox().width) / 2);
93
- }), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), y && y.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
94
- }, C = function C(i) {
95
- var a = i.id;
96
- return i.type && (a += "<" + index.C1(i.type) + ">"), a;
97
- }, Z = function Z(i, a, t, o) {
98
- index.L.debug("Rendering note ", a, t);
99
- var p = a.id, g = {
100
- id: p,
101
- text: a.text,
102
- width: 0,
103
- height: 0
104
- }, s = i.append("g").attr("id", p).attr("class", "classGroup");
105
- var c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
106
- var n = JSON.parse('"'.concat(a.text, '"')).split("\n");
107
- n.forEach(function(x) {
108
- index.L.debug("Adding line: ".concat(x)), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
109
- });
110
- var r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr("height", r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin).node().getBBox().width;
111
- return c.node().childNodes.forEach(function(x) {
112
- x.setAttribute("x", (h - x.getBBox().width) / 2);
113
- }), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
114
- }, v = function v(i, a, t, o) {
115
- var _a_getDisplayDetails = a.getDisplayDetails(), p = _a_getDisplayDetails.displayText, g = _a_getDisplayDetails.cssStyle, s = i.append("tspan").attr("x", o.padding).text(p);
116
- g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
117
- }, N = {
118
- getClassTitleString: C,
119
- drawClass: J,
120
- drawEdge: $,
121
- drawNote: Z
122
- };
123
- var T = {};
124
- var E = 20, L = function L(i) {
125
- var a = Object.entries(T).find(function(t) {
126
- return t[1].label === i;
127
- });
128
- if (a) return a[0];
129
- }, R = function R(i) {
130
- i.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"), i.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"), i.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"), i.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"), i.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"), i.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"), i.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"), i.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");
131
- }, F = function F(i, a, t, o) {
132
- var p = index.Vn().class;
133
- T = {}, index.L.info("Rendering diagram " + i);
134
- var g = index.Vn().securityLevel;
135
- var s;
136
- g === "sandbox" && (s = index.bt("#i" + a));
137
- var c = g === "sandbox" ? index.bt(s.nodes()[0].contentDocument.body) : index.bt("body"), n = c.select("[id='".concat(a, "']"));
138
- R(n);
139
- var r = new graph0ee63739.Ze({
140
- multigraph: !0
141
- });
142
- r.setGraph({
143
- isMultiGraph: !0
144
- }), r.setDefaultEdgeLabel(function() {
145
- return {};
146
- });
147
- var f = o.db.getClasses(), h = Object.keys(f);
148
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
149
- try {
150
- for(var _iterator = h[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
151
- var e = _step.value;
152
- var d = f[e], l = N.drawClass(n, d, p, o);
153
- T[l.id] = l, r.setNode(l.id, l), index.L.info("Org height: " + l.height);
154
- }
155
- } catch (err) {
156
- _didIteratorError = true;
157
- _iteratorError = err;
158
- } finally{
159
- try {
160
- if (!_iteratorNormalCompletion && _iterator.return != null) {
161
- _iterator.return();
162
- }
163
- } finally{
164
- if (_didIteratorError) {
165
- throw _iteratorError;
166
- }
167
- }
168
- }
169
- o.db.getRelations().forEach(function(e) {
170
- index.L.info(// cspell:ignore tjoho
171
- "tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)), r.setEdge(L(e.id1), L(e.id2), {
172
- relation: e
173
- }, e.title || "DEFAULT");
174
- }), o.db.getNotes().forEach(function(e) {
175
- index.L.debug("Adding note: ".concat(JSON.stringify(e)));
176
- var d = N.drawNote(n, e, p, o);
177
- T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(e.id, L(e.class), {
178
- relation: {
179
- id1: e.id,
180
- id2: e.class,
181
- relation: {
182
- type1: "none",
183
- type2: "none",
184
- lineType: 10
185
- }
186
- }
187
- }, "DEFAULT");
188
- }), layoutFd473db2.Yt(r), r.nodes().forEach(function(e) {
189
- e !== void 0 && r.node(e) !== void 0 && (index.L.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr("transform", "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"));
190
- }), r.edges().forEach(function(e) {
191
- e !== void 0 && r.edge(e) !== void 0 && (index.L.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
192
- });
193
- var y = n.node().getBBox(), m = y.width + E * 2, w = y.height + E * 2;
194
- index.Ol(n, w, m, p.useMaxWidth);
195
- var b = "".concat(y.x - E, " ").concat(y.y - E, " ").concat(m, " ").concat(w);
196
- index.L.debug("viewBox ".concat(b)), n.attr("viewBox", b);
197
- }, U = {
198
- draw: F
199
- }, tt = {
200
- parser: styles11e81fdd.zt,
201
- db: styles11e81fdd.Kt,
202
- renderer: U,
203
- styles: styles11e81fdd.Yt,
204
- init: function(i) {
205
- i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, styles11e81fdd.Kt.clear();
206
- }
207
- };
208
-
209
- exports.diagram = tt;
@@ -1,207 +0,0 @@
1
- import { z as zt, K as Kt, Y as Yt } from './styles-11e81fdd.esm.js';
2
- import { V as Vn, c as L$1, b as bt, O as Ol, ao as Pf, i as ei, as as C1 } from './index.esm2.js';
3
- import { Z as Ze } from './graph-0ee63739.esm.js';
4
- import { Y as Yt$1 } from './layout-fd473db2.esm.js';
5
- import { P } from './line-24d93f1b.esm.js';
6
- import './array-2ff2c7a6.esm.js';
7
- import './path-428ebac9.esm.js';
8
-
9
- var _ = 0;
10
- var $ = function $(i, a, t, o, p) {
11
- var g = function g(e) {
12
- switch(e){
13
- case p.db.relationType.AGGREGATION:
14
- return "aggregation";
15
- case p.db.relationType.EXTENSION:
16
- return "extension";
17
- case p.db.relationType.COMPOSITION:
18
- return "composition";
19
- case p.db.relationType.DEPENDENCY:
20
- return "dependency";
21
- case p.db.relationType.LOLLIPOP:
22
- return "lollipop";
23
- }
24
- };
25
- a.points = a.points.filter(function(e) {
26
- return !Number.isNaN(e.y);
27
- });
28
- var s = a.points, c = P().x(function(e) {
29
- return e.x;
30
- }).y(function(e) {
31
- return e.y;
32
- }).curve(Pf), n = i.append("path").attr("d", c(s)).attr("id", "edge" + _).attr("class", "relation");
33
- var r = "";
34
- o.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 && n.attr("class", "relation dashed-line"), t.relation.lineType == 10 && n.attr("class", "relation dotted-line"), t.relation.type1 !== "none" && n.attr("marker-start", "url(" + r + "#" + g(t.relation.type1) + "Start)"), t.relation.type2 !== "none" && n.attr("marker-end", "url(" + r + "#" + g(t.relation.type2) + "End)");
35
- var f, h;
36
- var x = a.points.length;
37
- var k = ei.calcLabelPosition(a.points);
38
- f = k.x, h = k.y;
39
- var y, m, w, b;
40
- if (x % 2 !== 0 && x > 1) {
41
- var e = ei.calcCardinalityPosition(t.relation.type1 !== "none", a.points, a.points[0]), d = ei.calcCardinalityPosition(t.relation.type2 !== "none", a.points, a.points[x - 1]);
42
- L$1.debug("cardinality_1_point " + JSON.stringify(e)), L$1.debug("cardinality_2_point " + JSON.stringify(d)), y = e.x, m = e.y, w = d.x, b = d.y;
43
- }
44
- if (t.title !== void 0) {
45
- var e1 = i.append("g").attr("class", "classLabel"), d1 = e1.append("text").attr("class", "label").attr("x", f).attr("y", h).attr("fill", "red").attr("text-anchor", "middle").text(t.title);
46
- window.label = d1;
47
- var l = d1.node().getBBox();
48
- e1.insert("rect", ":first-child").attr("class", "box").attr("x", l.x - o.padding / 2).attr("y", l.y - o.padding / 2).attr("width", l.width + o.padding).attr("height", l.height + o.padding);
49
- }
50
- L$1.info("Rendering relation " + JSON.stringify(t)), t.relationTitle1 !== void 0 && t.relationTitle1 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type1").attr("x", y).attr("y", m).attr("fill", "black").attr("font-size", "6").text(t.relationTitle1), t.relationTitle2 !== void 0 && t.relationTitle2 !== "none" && i.append("g").attr("class", "cardinality").append("text").attr("class", "type2").attr("x", w).attr("y", b).attr("fill", "black").attr("font-size", "6").text(t.relationTitle2), _++;
51
- }, J = function J(i, a, t, o) {
52
- L$1.debug("Rendering class ", a, t);
53
- var p = a.id, g = {
54
- id: p,
55
- label: a.id,
56
- width: 0,
57
- height: 0
58
- }, s = i.append("g").attr("id", o.db.lookUpDomId(p)).attr("class", "classGroup");
59
- var c;
60
- a.link ? c = s.append("svg:a").attr("xlink:href", a.link).attr("target", a.linkTarget).append("text").attr("y", t.textHeight + t.padding).attr("x", 0) : c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
61
- var n = !0;
62
- a.annotations.forEach(function(d) {
63
- var l = c.append("tspan").text("\xab" + d + "\xbb");
64
- n || l.attr("dy", t.textHeight), n = !1;
65
- });
66
- var r = C(a);
67
- var f = c.append("tspan").text(r).attr("class", "title");
68
- n || f.attr("dy", t.textHeight);
69
- var h = c.node().getBBox().height;
70
- var x, k, y;
71
- if (a.members.length > 0) {
72
- x = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin / 2).attr("y2", t.padding + h + t.dividerMargin / 2);
73
- var d = s.append("text").attr("x", t.padding).attr("y", h + t.dividerMargin + t.textHeight).attr("fill", "white").attr("class", "classText");
74
- n = !0, a.members.forEach(function(l) {
75
- v(d, l, n, t), n = !1;
76
- }), k = d.node().getBBox();
77
- }
78
- if (a.methods.length > 0) {
79
- y = s.append("line").attr("x1", 0).attr("y1", t.padding + h + t.dividerMargin + k.height).attr("y2", t.padding + h + t.dividerMargin + k.height);
80
- var d1 = s.append("text").attr("x", t.padding).attr("y", h + 2 * t.dividerMargin + k.height + t.textHeight).attr("fill", "white").attr("class", "classText");
81
- n = !0, a.methods.forEach(function(l) {
82
- v(d1, l, n, t), n = !1;
83
- });
84
- }
85
- var m = s.node().getBBox();
86
- var w = " ";
87
- a.cssClasses.length > 0 && (w = w + a.cssClasses.join(" "));
88
- var e = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", m.width + 2 * t.padding).attr("height", m.height + t.padding + 0.5 * t.dividerMargin).attr("class", w).node().getBBox().width;
89
- return c.node().childNodes.forEach(function(d) {
90
- d.setAttribute("x", (e - d.getBBox().width) / 2);
91
- }), a.tooltip && c.insert("title").text(a.tooltip), x && x.attr("x2", e), y && y.attr("x2", e), g.width = e, g.height = m.height + t.padding + 0.5 * t.dividerMargin, g;
92
- }, C = function C(i) {
93
- var a = i.id;
94
- return i.type && (a += "<" + C1(i.type) + ">"), a;
95
- }, Z = function Z(i, a, t, o) {
96
- L$1.debug("Rendering note ", a, t);
97
- var p = a.id, g = {
98
- id: p,
99
- text: a.text,
100
- width: 0,
101
- height: 0
102
- }, s = i.append("g").attr("id", p).attr("class", "classGroup");
103
- var c = s.append("text").attr("y", t.textHeight + t.padding).attr("x", 0);
104
- var n = JSON.parse('"'.concat(a.text, '"')).split("\n");
105
- n.forEach(function(x) {
106
- L$1.debug("Adding line: ".concat(x)), c.append("tspan").text(x).attr("class", "title").attr("dy", t.textHeight);
107
- });
108
- var r = s.node().getBBox(), h = s.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", r.width + 2 * t.padding).attr("height", r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin).node().getBBox().width;
109
- return c.node().childNodes.forEach(function(x) {
110
- x.setAttribute("x", (h - x.getBBox().width) / 2);
111
- }), g.width = h, g.height = r.height + n.length * t.textHeight + t.padding + 0.5 * t.dividerMargin, g;
112
- }, v = function v(i, a, t, o) {
113
- var _a_getDisplayDetails = a.getDisplayDetails(), p = _a_getDisplayDetails.displayText, g = _a_getDisplayDetails.cssStyle, s = i.append("tspan").attr("x", o.padding).text(p);
114
- g !== "" && s.attr("style", a.cssStyle), t || s.attr("dy", o.textHeight);
115
- }, N = {
116
- getClassTitleString: C,
117
- drawClass: J,
118
- drawEdge: $,
119
- drawNote: Z
120
- };
121
- var T = {};
122
- var E = 20, L = function L(i) {
123
- var a = Object.entries(T).find(function(t) {
124
- return t[1].label === i;
125
- });
126
- if (a) return a[0];
127
- }, R = function R(i) {
128
- i.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"), i.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"), i.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"), i.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"), i.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"), i.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"), i.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"), i.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");
129
- }, F = function F(i, a, t, o) {
130
- var p = Vn().class;
131
- T = {}, L$1.info("Rendering diagram " + i);
132
- var g = Vn().securityLevel;
133
- var s;
134
- g === "sandbox" && (s = bt("#i" + a));
135
- var c = g === "sandbox" ? bt(s.nodes()[0].contentDocument.body) : bt("body"), n = c.select("[id='".concat(a, "']"));
136
- R(n);
137
- var r = new Ze({
138
- multigraph: !0
139
- });
140
- r.setGraph({
141
- isMultiGraph: !0
142
- }), r.setDefaultEdgeLabel(function() {
143
- return {};
144
- });
145
- var f = o.db.getClasses(), h = Object.keys(f);
146
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
147
- try {
148
- for(var _iterator = h[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
149
- var e = _step.value;
150
- var d = f[e], l = N.drawClass(n, d, p, o);
151
- T[l.id] = l, r.setNode(l.id, l), L$1.info("Org height: " + l.height);
152
- }
153
- } catch (err) {
154
- _didIteratorError = true;
155
- _iteratorError = err;
156
- } finally{
157
- try {
158
- if (!_iteratorNormalCompletion && _iterator.return != null) {
159
- _iterator.return();
160
- }
161
- } finally{
162
- if (_didIteratorError) {
163
- throw _iteratorError;
164
- }
165
- }
166
- }
167
- o.db.getRelations().forEach(function(e) {
168
- L$1.info(// cspell:ignore tjoho
169
- "tjoho" + L(e.id1) + L(e.id2) + JSON.stringify(e)), r.setEdge(L(e.id1), L(e.id2), {
170
- relation: e
171
- }, e.title || "DEFAULT");
172
- }), o.db.getNotes().forEach(function(e) {
173
- L$1.debug("Adding note: ".concat(JSON.stringify(e)));
174
- var d = N.drawNote(n, e, p, o);
175
- T[d.id] = d, r.setNode(d.id, d), e.class && e.class in f && r.setEdge(e.id, L(e.class), {
176
- relation: {
177
- id1: e.id,
178
- id2: e.class,
179
- relation: {
180
- type1: "none",
181
- type2: "none",
182
- lineType: 10
183
- }
184
- }
185
- }, "DEFAULT");
186
- }), Yt$1(r), r.nodes().forEach(function(e) {
187
- e !== void 0 && r.node(e) !== void 0 && (L$1.debug("Node " + e + ": " + JSON.stringify(r.node(e))), c.select("#" + (o.db.lookUpDomId(e) || e)).attr("transform", "translate(" + (r.node(e).x - r.node(e).width / 2) + "," + (r.node(e).y - r.node(e).height / 2) + " )"));
188
- }), r.edges().forEach(function(e) {
189
- e !== void 0 && r.edge(e) !== void 0 && (L$1.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(r.edge(e))), N.drawEdge(n, r.edge(e), r.edge(e).relation, p, o));
190
- });
191
- var y = n.node().getBBox(), m = y.width + E * 2, w = y.height + E * 2;
192
- Ol(n, w, m, p.useMaxWidth);
193
- var b = "".concat(y.x - E, " ").concat(y.y - E, " ").concat(m, " ").concat(w);
194
- L$1.debug("viewBox ".concat(b)), n.attr("viewBox", b);
195
- }, U = {
196
- draw: F
197
- }, tt = {
198
- parser: zt,
199
- db: Kt,
200
- renderer: U,
201
- styles: Yt,
202
- init: function(i) {
203
- i.class || (i.class = {}), i.class.arrowMarkerAbsolute = i.arrowMarkerAbsolute, Kt.clear();
204
- }
205
- };
206
-
207
- export { tt as diagram };