@life-exe/wiki-engine 0.1.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/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/analytics/index.d.ts +10 -0
- package/dist/chunks/abnfDiagram-VCTEODGH-DyAP6Aua.js +87 -0
- package/dist/chunks/arc-OroUeRL_.js +83 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7-FjmrDCl4.js +4784 -0
- package/dist/chunks/blockDiagram-I7D4REHJ-BF3oIDlI.js +1416 -0
- package/dist/chunks/c4Diagram-7LVT6UL2-Cmdq0LZr.js +1511 -0
- package/dist/chunks/channel-Bdy1QZHo.js +5 -0
- package/dist/chunks/chunk-2Q5K7J3B-BwxRSEKd.js +15 -0
- package/dist/chunks/chunk-5VM5RSS4-BtHwUU4T.js +19 -0
- package/dist/chunks/chunk-F27PBJKO-DF4TGftR.js +68 -0
- package/dist/chunks/chunk-IMKFNOWR-DkBQ-1aV.js +1421 -0
- package/dist/chunks/chunk-JWPE2WC7-BIokdAUW.js +9 -0
- package/dist/chunks/chunk-POPQ4Y6H-CcjOsf9X.js +20 -0
- package/dist/chunks/chunk-SHT3W25Y-lYp5BdEg.js +1695 -0
- package/dist/chunks/chunk-SVP7TREG-DN-ravNt.js +664 -0
- package/dist/chunks/chunk-TICWLB2K-CtTJ0xaY.js +1534 -0
- package/dist/chunks/chunk-XXDRQBXY-BovkWFC0.js +8 -0
- package/dist/chunks/classDiagram-ZZMXUADV-CMYS0pHw.js +16 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY-CMYS0pHw.js +16 -0
- package/dist/chunks/common-BJ4q25wy.js +12633 -0
- package/dist/chunks/cose-bilkent-JH36ORCC-CaMqpJY7.js +2608 -0
- package/dist/chunks/cynefin-OW5HDTMX-Bzjecpt-.js +23853 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ-C0NuKLt0.js +299 -0
- package/dist/chunks/cytoscape.esm-DmPrb1GM.js +18787 -0
- package/dist/chunks/dagre-GXQ25YYZ-Ds09_NdN.js +461 -0
- package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
- package/dist/chunks/diagram-S7CK7UJ4-IvSazk1O.js +349 -0
- package/dist/chunks/diagram-UQ7AKVKN-58epdx5V.js +223 -0
- package/dist/chunks/diagram-VSXAHHWV-BrzRGMeV.js +466 -0
- package/dist/chunks/diagram-VX7I27RA-DPL0Nw6d.js +530 -0
- package/dist/chunks/diagram-Z3DM3KII-8VWVu0I5.js +143 -0
- package/dist/chunks/ebnfDiagram-PWID7BFC-DeByR_ze.js +109 -0
- package/dist/chunks/erDiagram-RLTQ6QDP-C9uo9iE1.js +1060 -0
- package/dist/chunks/flowDiagram-HODETNUW-BpoY3OMp.js +7 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY-psdwnC-T.js +2711 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX-vsDfkn_Q.js +828 -0
- package/dist/chunks/index-f7Uzykhj.js +38262 -0
- package/dist/chunks/infoDiagram-27XIBGKW-8K-eQZiU.js +24 -0
- package/dist/chunks/init-DjUOC4st.js +16 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U-CuqR1k5i.js +622 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE-BPW1nmwZ.js +834 -0
- package/dist/chunks/kanban-definition-UXKFOSKX-iY6-d6jO.js +726 -0
- package/dist/chunks/katex-jHfnQmlp.js +11682 -0
- package/dist/chunks/layout-CgV9vOdp.js +1704 -0
- package/dist/chunks/linear-BzcaSMTS.js +259 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX-CaLfHyv0.js +831 -0
- package/dist/chunks/ordinal-DfAQgscy.js +61 -0
- package/dist/chunks/pegDiagram-XKGWAZYB-6Y28VvVh.js +95 -0
- package/dist/chunks/pieDiagram-E7YTZNPT-OrjeRxhs.js +209 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC-rgw2lV2J.js +1025 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU-D6QNO5r1.js +77 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE-a8tNRSuE.js +884 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB-CdaC8rLw.js +847 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4-CGLi38Hj.js +2898 -0
- package/dist/chunks/sizeCapture-INFHLROL-g5RJXnik.js +47 -0
- package/dist/chunks/stateDiagram-D77RDMKH-Cou0eVl1.js +262 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH-BHQspnUg.js +16 -0
- package/dist/chunks/swimlanes-42K2YHIH-BU7S1WgJ.js +5239 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N-BsEplbno.js +13 -0
- package/dist/chunks/timeline-definition-24CTP7MA-BB-IyxWL.js +1066 -0
- package/dist/chunks/vennDiagram-4TSXK5OY-BToYolPI.js +1585 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4-BgoueOw_.js +684 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z-CF0fWv-W.js +1492 -0
- package/dist/components/CodeBlock.d.ts +5 -0
- package/dist/components/CommunityLinks.d.ts +21 -0
- package/dist/components/CookieConsent.d.ts +2 -0
- package/dist/components/DocLinkCard.d.ts +6 -0
- package/dist/components/LecturePageView.d.ts +3 -0
- package/dist/components/MermaidDiagram.d.ts +3 -0
- package/dist/components/SearchPopup.d.ts +6 -0
- package/dist/components/WikiApp.d.ts +9 -0
- package/dist/components/WikiLayout.d.ts +2 -0
- package/dist/components/WikiPageView.d.ts +6 -0
- package/dist/components/ZoomableImage.d.ts +2 -0
- package/dist/context/LangContext.d.ts +2 -0
- package/dist/context/WikiContext.d.ts +18 -0
- package/dist/data.d.ts +8 -0
- package/dist/hooks/useLanguage.d.ts +4 -0
- package/dist/hooks/useTheme.d.ts +5 -0
- package/dist/hooks/useWiki.d.ts +2 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +45 -0
- package/dist/languages/ue-cpp.d.ts +7 -0
- package/dist/languages/ue-cpp.js +21 -0
- package/dist/types.d.ts +119 -0
- package/dist/wiki-engine.css +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { p as oe } from "./chunk-JWPE2WC7-BIokdAUW.js";
|
|
2
|
+
import { t as se, q as de, s as le, g as ce, a as me, b as ue, _ as o, l as g, c as T, j as xe, F as fe, A as ge, G as he, E, H as pe, i as P, w as S, ap as be } from "./index-f7Uzykhj.js";
|
|
3
|
+
import { p as ve, i as we } from "./cynefin-OW5HDTMX-Bzjecpt-.js";
|
|
4
|
+
var D = "position frame", N = "frame positioned", M = "position relation", C = "relation positioned", ye = /* @__PURE__ */ o(function(e) {
|
|
5
|
+
g.debug("options str", e);
|
|
6
|
+
}, "setOptions"), Pe = /* @__PURE__ */ o(function() {
|
|
7
|
+
return {};
|
|
8
|
+
}, "getOptions"), Se = /* @__PURE__ */ o(function() {
|
|
9
|
+
O(), ge();
|
|
10
|
+
}, "clear");
|
|
11
|
+
function O() {
|
|
12
|
+
A = {};
|
|
13
|
+
}
|
|
14
|
+
o(O, "reset");
|
|
15
|
+
var ke = pe.eventmodeling, Me = /* @__PURE__ */ o(() => he({
|
|
16
|
+
...ke,
|
|
17
|
+
...E().eventmodeling
|
|
18
|
+
}), "getConfig"), A = {};
|
|
19
|
+
function W() {
|
|
20
|
+
let e = Be;
|
|
21
|
+
const { ast: n } = A, t = R();
|
|
22
|
+
if (!n)
|
|
23
|
+
throw new Error("No data for EventModel");
|
|
24
|
+
return n.frames.forEach((i, a) => {
|
|
25
|
+
const r = L(i, n.dataEntities, t);
|
|
26
|
+
e = w(e, {
|
|
27
|
+
$kind: D,
|
|
28
|
+
index: a,
|
|
29
|
+
frame: i,
|
|
30
|
+
textProps: r
|
|
31
|
+
});
|
|
32
|
+
let d;
|
|
33
|
+
q(i) ? (g.debug("source frame", i.sourceFrames), d = n.frames.filter((l) => i.sourceFrames.some((c) => c.$refText === l.name)), d.forEach((l) => {
|
|
34
|
+
e = w(e, {
|
|
35
|
+
$kind: M,
|
|
36
|
+
index: a,
|
|
37
|
+
frame: i,
|
|
38
|
+
sourceFrame: l
|
|
39
|
+
});
|
|
40
|
+
})) : e = w(e, {
|
|
41
|
+
$kind: M,
|
|
42
|
+
index: a,
|
|
43
|
+
frame: i
|
|
44
|
+
});
|
|
45
|
+
}), e = {
|
|
46
|
+
...e,
|
|
47
|
+
sortedSwimlanesArray: $(e.swimlanes)
|
|
48
|
+
}, e;
|
|
49
|
+
}
|
|
50
|
+
o(W, "getState");
|
|
51
|
+
function I(e) {
|
|
52
|
+
A.ast = e;
|
|
53
|
+
}
|
|
54
|
+
o(I, "setAst");
|
|
55
|
+
var s = {
|
|
56
|
+
swimlaneMinHeight: 70,
|
|
57
|
+
swimlanePadding: 15,
|
|
58
|
+
swimlaneGap: 10,
|
|
59
|
+
boxPadding: 10,
|
|
60
|
+
boxOverlap: 90,
|
|
61
|
+
boxDefaultY: 0,
|
|
62
|
+
boxMinWidth: 80,
|
|
63
|
+
boxMaxWidth: 450,
|
|
64
|
+
boxMinHeight: 80,
|
|
65
|
+
boxMaxHeight: 750,
|
|
66
|
+
contentStartX: 250,
|
|
67
|
+
textMaxWidth: 430,
|
|
68
|
+
boxTextFontWeight: "bold",
|
|
69
|
+
boxTextPadding: 10,
|
|
70
|
+
swimlaneTextFontWeight: "bold",
|
|
71
|
+
labelUiAutomation: "UI/Automation",
|
|
72
|
+
labelUiAutomationPrefix: "UI/A: ",
|
|
73
|
+
labelCommandReadModel: "Command/Read Model",
|
|
74
|
+
labelCommandReadModelPrefix: "C/RM: ",
|
|
75
|
+
labelEvents: "Events",
|
|
76
|
+
labelEventsPrefix: "Stream: "
|
|
77
|
+
};
|
|
78
|
+
function R() {
|
|
79
|
+
return s;
|
|
80
|
+
}
|
|
81
|
+
o(R, "getDiagramProps");
|
|
82
|
+
var Be = {
|
|
83
|
+
boxes: [],
|
|
84
|
+
swimlanes: {},
|
|
85
|
+
relations: [],
|
|
86
|
+
maxR: 0,
|
|
87
|
+
sortedSwimlanesArray: []
|
|
88
|
+
};
|
|
89
|
+
function H(e) {
|
|
90
|
+
const n = e.split(".");
|
|
91
|
+
if (n.length === 2)
|
|
92
|
+
return n[0];
|
|
93
|
+
}
|
|
94
|
+
o(H, "extractNamespace");
|
|
95
|
+
function U(e) {
|
|
96
|
+
const n = e.split(".");
|
|
97
|
+
return n.length === 2 ? n[1] : e;
|
|
98
|
+
}
|
|
99
|
+
o(U, "extractName");
|
|
100
|
+
function _(e, n) {
|
|
101
|
+
if (!(!n || n.length === 0))
|
|
102
|
+
return Object.values(e).find((t) => t.namespace === n);
|
|
103
|
+
}
|
|
104
|
+
o(_, "findSwimlaneByNamespace");
|
|
105
|
+
function v(e, n, t) {
|
|
106
|
+
return Math.max(
|
|
107
|
+
n,
|
|
108
|
+
...Object.keys(e).filter((i) => {
|
|
109
|
+
const a = Number.parseInt(i);
|
|
110
|
+
return a > n && a < t;
|
|
111
|
+
}).map((i) => Number.parseInt(i))
|
|
112
|
+
) + 1;
|
|
113
|
+
}
|
|
114
|
+
o(v, "findNextAvailableIndex");
|
|
115
|
+
function V(e, n) {
|
|
116
|
+
const t = H(e.entityIdentifier), i = _(n, t);
|
|
117
|
+
switch (e.modelEntityType) {
|
|
118
|
+
case "ui":
|
|
119
|
+
case "pcr":
|
|
120
|
+
case "processor":
|
|
121
|
+
return i ? {
|
|
122
|
+
index: i.index,
|
|
123
|
+
label: i.namespace || s.labelUiAutomation
|
|
124
|
+
} : t ? {
|
|
125
|
+
index: v(n, 0, 100),
|
|
126
|
+
label: s.labelUiAutomationPrefix + t
|
|
127
|
+
} : { index: 0, label: s.labelUiAutomation };
|
|
128
|
+
case "rmo":
|
|
129
|
+
case "readmodel":
|
|
130
|
+
case "cmd":
|
|
131
|
+
case "command":
|
|
132
|
+
return i ? {
|
|
133
|
+
index: i.index,
|
|
134
|
+
label: i.namespace || s.labelCommandReadModel
|
|
135
|
+
} : t ? {
|
|
136
|
+
index: v(n, 100, 200),
|
|
137
|
+
label: s.labelCommandReadModelPrefix + t
|
|
138
|
+
} : { index: 100, label: s.labelCommandReadModel };
|
|
139
|
+
case "evt":
|
|
140
|
+
case "event":
|
|
141
|
+
default:
|
|
142
|
+
return i ? {
|
|
143
|
+
index: i.index,
|
|
144
|
+
label: i.namespace || s.labelEvents
|
|
145
|
+
} : t ? {
|
|
146
|
+
index: v(n, 200, 300),
|
|
147
|
+
label: s.labelEventsPrefix + t
|
|
148
|
+
} : { index: 200, label: s.labelEvents };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
o(V, "calculateSwimlaneProps");
|
|
152
|
+
function G(e) {
|
|
153
|
+
const { themeVariables: n } = E();
|
|
154
|
+
switch (e.modelEntityType) {
|
|
155
|
+
case "ui":
|
|
156
|
+
return {
|
|
157
|
+
fill: n.emUiFill ?? "white",
|
|
158
|
+
stroke: n.emUiStroke ?? "#dbdada"
|
|
159
|
+
};
|
|
160
|
+
case "pcr":
|
|
161
|
+
case "processor":
|
|
162
|
+
return {
|
|
163
|
+
fill: n.emProcessorFill ?? "#edb3f6",
|
|
164
|
+
stroke: n.emProcessorStroke ?? "#b88cbf"
|
|
165
|
+
};
|
|
166
|
+
case "rmo":
|
|
167
|
+
case "readmodel":
|
|
168
|
+
return {
|
|
169
|
+
fill: n.emReadModelFill ?? "#d3f1a2",
|
|
170
|
+
stroke: n.emReadModelStroke ?? "#a3b732"
|
|
171
|
+
};
|
|
172
|
+
case "cmd":
|
|
173
|
+
case "command":
|
|
174
|
+
return {
|
|
175
|
+
fill: n.emCommandFill ?? "#bcd6fe",
|
|
176
|
+
stroke: n.emCommandStroke ?? "#679ac3"
|
|
177
|
+
};
|
|
178
|
+
case "evt":
|
|
179
|
+
case "event":
|
|
180
|
+
return {
|
|
181
|
+
fill: n.emEventFill ?? "#ffb778",
|
|
182
|
+
stroke: n.emEventStroke ?? "#c19a0f"
|
|
183
|
+
};
|
|
184
|
+
default:
|
|
185
|
+
return {
|
|
186
|
+
fill: "red",
|
|
187
|
+
stroke: "black"
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
o(G, "calculateEntityVisualProps");
|
|
192
|
+
function L(e, n, t) {
|
|
193
|
+
const i = E(), a = P(U(e.entityIdentifier) ?? "", i);
|
|
194
|
+
let r;
|
|
195
|
+
const d = {
|
|
196
|
+
fontSize: 16,
|
|
197
|
+
fontWeight: 700,
|
|
198
|
+
fontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
|
199
|
+
joinWith: "<br/>"
|
|
200
|
+
};
|
|
201
|
+
let c = `<b>${S(a, t.textMaxWidth, d)}</b>`;
|
|
202
|
+
if (e.dataInlineValue && (r = e.dataInlineValue, r = r.substring(r.indexOf("{") + 1), r = r.substring(0, r.lastIndexOf("}") - 1), r = P(r, i), r = S(r, t.textMaxWidth, d), r = r.replaceAll(" ", " ")), e.dataReference) {
|
|
203
|
+
const p = n.find(
|
|
204
|
+
(y) => {
|
|
205
|
+
var b;
|
|
206
|
+
return y.name === ((b = e.dataReference) == null ? void 0 : b.$refText);
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
p && (r = p.dataBlockValue, r = r.substring(r.indexOf(`{
|
|
210
|
+
`) + 2), r = r.substring(0, r.lastIndexOf("}") - 1), r = P(r, i), r = S(r, t.textMaxWidth, d), r = r.replaceAll(" ", " "), r += "<br/>");
|
|
211
|
+
}
|
|
212
|
+
const m = r !== void 0;
|
|
213
|
+
m && (c += `<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);
|
|
214
|
+
const x = {
|
|
215
|
+
fontSize: d.fontSize,
|
|
216
|
+
fontWeight: d.fontWeight,
|
|
217
|
+
fontFamily: d.fontFamily
|
|
218
|
+
}, u = be(c, x), h = m ? u.width / 3 : u.width, f = {
|
|
219
|
+
content: c,
|
|
220
|
+
width: h,
|
|
221
|
+
height: u.height
|
|
222
|
+
};
|
|
223
|
+
return g.debug(`[${e.name}] ${e.entityIdentifier} text`, f), f;
|
|
224
|
+
}
|
|
225
|
+
o(L, "calculateTextProps");
|
|
226
|
+
function X(e, n) {
|
|
227
|
+
const t = n, i = G(t.frame), a = {
|
|
228
|
+
width: t.textProps.width + 2 * s.boxTextPadding,
|
|
229
|
+
height: t.textProps.height + 2 * s.boxTextPadding
|
|
230
|
+
};
|
|
231
|
+
return [{
|
|
232
|
+
$kind: N,
|
|
233
|
+
frame: t.frame,
|
|
234
|
+
index: t.index,
|
|
235
|
+
visual: i,
|
|
236
|
+
dimension: a,
|
|
237
|
+
textProps: t.textProps
|
|
238
|
+
}];
|
|
239
|
+
}
|
|
240
|
+
o(X, "decidePositionFrame");
|
|
241
|
+
function j(e, n, t) {
|
|
242
|
+
return n === void 0 ? s.contentStartX : n.index === e.index && e.r ? e.r + s.boxPadding : t === void 0 ? s.contentStartX : t.r - s.boxOverlap + s.boxPadding;
|
|
243
|
+
}
|
|
244
|
+
o(j, "calculateX");
|
|
245
|
+
function Y(e, n) {
|
|
246
|
+
const t = [...e.map((i) => i.r), n];
|
|
247
|
+
return Math.max(...t);
|
|
248
|
+
}
|
|
249
|
+
o(Y, "calculateMaxRight");
|
|
250
|
+
function $(e) {
|
|
251
|
+
return Object.values(e).sort((n, t) => n.index - t.index);
|
|
252
|
+
}
|
|
253
|
+
o($, "sortedSwimlanesArray");
|
|
254
|
+
function z(e, n) {
|
|
255
|
+
const t = n, i = V(t.frame, e.swimlanes);
|
|
256
|
+
let a;
|
|
257
|
+
i.index in e.swimlanes ? a = e.swimlanes[i.index] : a = {
|
|
258
|
+
index: i.index,
|
|
259
|
+
label: i.label,
|
|
260
|
+
r: 0,
|
|
261
|
+
y: i.index * s.swimlaneMinHeight + s.swimlaneGap,
|
|
262
|
+
height: s.swimlaneMinHeight,
|
|
263
|
+
maxHeight: s.swimlaneMinHeight
|
|
264
|
+
};
|
|
265
|
+
const r = e.boxes.length > 0 ? e.boxes[e.boxes.length - 1] : void 0, d = e.previousSwimlaneNumber !== void 0 ? e.swimlanes[e.previousSwimlaneNumber] : void 0, l = {
|
|
266
|
+
width: Math.max(
|
|
267
|
+
s.boxMinWidth,
|
|
268
|
+
Math.min(s.boxMaxWidth, t.dimension.width)
|
|
269
|
+
) + 2 * s.boxPadding,
|
|
270
|
+
height: Math.max(
|
|
271
|
+
s.boxMinHeight,
|
|
272
|
+
Math.min(s.boxMaxHeight, t.dimension.height)
|
|
273
|
+
) + 2 * s.boxPadding
|
|
274
|
+
}, c = j(a, d, r), m = c + l.width + s.boxPadding, x = Y(Object.values(e.swimlanes), m);
|
|
275
|
+
a.r = c + l.width, a.maxHeight = Math.max(a.maxHeight, l.height), a.height = Math.max(s.swimlaneMinHeight, a.maxHeight) + 2 * s.swimlanePadding;
|
|
276
|
+
const u = {
|
|
277
|
+
x: c,
|
|
278
|
+
y: s.swimlanePadding + a.y,
|
|
279
|
+
// y: diagramProps.swimlanePadding + (swimlane.y || diagramProps.boxDefaultY),
|
|
280
|
+
r: m,
|
|
281
|
+
dimension: l,
|
|
282
|
+
leftSibling: !1,
|
|
283
|
+
swimlane: a,
|
|
284
|
+
visual: t.visual,
|
|
285
|
+
text: t.textProps.content,
|
|
286
|
+
frame: t.frame,
|
|
287
|
+
index: t.index
|
|
288
|
+
}, h = {
|
|
289
|
+
...e,
|
|
290
|
+
boxes: [...e.boxes, u],
|
|
291
|
+
swimlanes: {
|
|
292
|
+
...e.swimlanes,
|
|
293
|
+
[`${a.index}`]: a
|
|
294
|
+
},
|
|
295
|
+
previousSwimlaneNumber: i.index,
|
|
296
|
+
previousFrame: t.frame,
|
|
297
|
+
maxR: x
|
|
298
|
+
}, f = $(h.swimlanes);
|
|
299
|
+
f.length > 0 && (f[0].y = 0);
|
|
300
|
+
for (let p = 1; p < f.length; p++) {
|
|
301
|
+
const y = f[p], b = f[p - 1];
|
|
302
|
+
y.y = b.y + b.height + s.swimlaneGap;
|
|
303
|
+
}
|
|
304
|
+
return h;
|
|
305
|
+
}
|
|
306
|
+
o(z, "evolveFramePositioned");
|
|
307
|
+
function K(e, n) {
|
|
308
|
+
return e === 0 && n.sourceFrames.length === 0;
|
|
309
|
+
}
|
|
310
|
+
o(K, "isFirstFrame");
|
|
311
|
+
function q(e) {
|
|
312
|
+
return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
|
|
313
|
+
}
|
|
314
|
+
o(q, "hasSourceFrame");
|
|
315
|
+
function B(e, n) {
|
|
316
|
+
if (n != null)
|
|
317
|
+
return e.find((t) => t.frame.name === n.name);
|
|
318
|
+
}
|
|
319
|
+
o(B, "findBoxByFrame");
|
|
320
|
+
function J(e, n, t) {
|
|
321
|
+
if (!(t < 0))
|
|
322
|
+
for (let i = t; i >= 0; i--) {
|
|
323
|
+
const a = e[i];
|
|
324
|
+
if (a.swimlane.index !== n)
|
|
325
|
+
return a;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
o(J, "findBoxByLineIndex");
|
|
329
|
+
function Q(e, n) {
|
|
330
|
+
const t = n;
|
|
331
|
+
if (we(t.frame) || K(t.index, t.frame))
|
|
332
|
+
return [];
|
|
333
|
+
const i = B(e.boxes, t.frame);
|
|
334
|
+
if (i === void 0)
|
|
335
|
+
throw new Error(`Target box not found for frame ${t.frame.name}`);
|
|
336
|
+
let a;
|
|
337
|
+
return t.sourceFrame ? a = B(e.boxes, t.sourceFrame) : a = J(e.boxes, i.swimlane.index, t.index - 1), a === void 0 ? [] : [{
|
|
338
|
+
$kind: C,
|
|
339
|
+
frame: t.frame,
|
|
340
|
+
index: t.index,
|
|
341
|
+
sourceBox: a,
|
|
342
|
+
targetBox: i
|
|
343
|
+
}];
|
|
344
|
+
}
|
|
345
|
+
o(Q, "decidePositionRelation");
|
|
346
|
+
function Z(e, n) {
|
|
347
|
+
const t = n, i = {
|
|
348
|
+
visual: {
|
|
349
|
+
fill: "none",
|
|
350
|
+
stroke: "#000"
|
|
351
|
+
},
|
|
352
|
+
source: {
|
|
353
|
+
x: t.sourceBox.x,
|
|
354
|
+
y: t.sourceBox.y
|
|
355
|
+
},
|
|
356
|
+
target: {
|
|
357
|
+
x: t.targetBox.x,
|
|
358
|
+
y: t.targetBox.y
|
|
359
|
+
},
|
|
360
|
+
sourceBox: t.sourceBox,
|
|
361
|
+
targetBox: t.targetBox
|
|
362
|
+
};
|
|
363
|
+
return {
|
|
364
|
+
...e,
|
|
365
|
+
relations: [...e.relations, i]
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
o(Z, "evolveRelationPositioned");
|
|
369
|
+
var Fe = {
|
|
370
|
+
[D]: X,
|
|
371
|
+
[M]: Q
|
|
372
|
+
}, Ee = {
|
|
373
|
+
[N]: z,
|
|
374
|
+
[C]: Z
|
|
375
|
+
};
|
|
376
|
+
function ee(e, n) {
|
|
377
|
+
const t = Fe[n.$kind];
|
|
378
|
+
if (t == null)
|
|
379
|
+
return [];
|
|
380
|
+
const i = t(e, n);
|
|
381
|
+
return g.debug("decided events", i), i;
|
|
382
|
+
}
|
|
383
|
+
o(ee, "decide");
|
|
384
|
+
function te(e, n) {
|
|
385
|
+
const t = n.reduce((i, a) => {
|
|
386
|
+
const r = Ee[a.$kind];
|
|
387
|
+
return r == null ? i : r(i, a);
|
|
388
|
+
}, e);
|
|
389
|
+
return g.debug("evolve events", { state: e, newState: t, events: n }), t;
|
|
390
|
+
}
|
|
391
|
+
o(te, "evolve");
|
|
392
|
+
function w(e, n) {
|
|
393
|
+
const t = ee(e, n);
|
|
394
|
+
return te(e, t);
|
|
395
|
+
}
|
|
396
|
+
o(w, "dispatch");
|
|
397
|
+
var F = {
|
|
398
|
+
getConfig: Me,
|
|
399
|
+
setOptions: ye,
|
|
400
|
+
getOptions: Pe,
|
|
401
|
+
clear: Se,
|
|
402
|
+
setAccTitle: ue,
|
|
403
|
+
getAccTitle: me,
|
|
404
|
+
getAccDescription: ce,
|
|
405
|
+
setAccDescription: le,
|
|
406
|
+
setDiagramTitle: de,
|
|
407
|
+
getDiagramTitle: se,
|
|
408
|
+
setAst: I,
|
|
409
|
+
getDiagramProps: R,
|
|
410
|
+
getState: W
|
|
411
|
+
}, Ae = {
|
|
412
|
+
parse: /* @__PURE__ */ o(async (e) => {
|
|
413
|
+
const n = await ve("eventmodeling", e);
|
|
414
|
+
g.debug(n), F.setAst(n), oe(n, F);
|
|
415
|
+
}, "parse")
|
|
416
|
+
}, k = T(), Re = k == null ? void 0 : k.eventmodeling;
|
|
417
|
+
function ne(e, n) {
|
|
418
|
+
return (t) => {
|
|
419
|
+
const i = t.swimlane.y + n.swimlanePadding, a = e.append("g").attr("class", "em-box");
|
|
420
|
+
a.append("rect").attr("x", t.x).attr("y", i).attr("rx", "3").attr("width", t.dimension.width).attr("height", t.dimension.height).attr("stroke", t.visual.stroke).attr("fill", t.visual.fill), a.append("foreignObject").attr("x", t.x + n.boxPadding).attr("y", i + 10).attr("width", t.dimension.width - 2 * n.boxPadding).attr("height", t.dimension.height - 2 * n.boxPadding).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%").append("span").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").html(t.text);
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
o(ne, "renderD3Box");
|
|
424
|
+
function ie(e, n) {
|
|
425
|
+
return e > n;
|
|
426
|
+
}
|
|
427
|
+
o(ie, "dirUpwards");
|
|
428
|
+
function ae(e, n, t, i) {
|
|
429
|
+
return (a) => {
|
|
430
|
+
const r = a.sourceBox.swimlane.y + n.swimlanePadding, d = a.targetBox.swimlane.y + n.swimlanePadding, l = ie(r, d), c = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, m = a.targetBox.x + a.targetBox.dimension.width / 3;
|
|
431
|
+
let x, u;
|
|
432
|
+
g.debug(`rendering relation up=${l} for `, {
|
|
433
|
+
sourceBox: a.sourceBox,
|
|
434
|
+
targetBox: a.targetBox
|
|
435
|
+
}), l ? (x = r, u = d + a.targetBox.dimension.height) : (x = r + a.sourceBox.dimension.height, u = d);
|
|
436
|
+
const h = i.emRelationStroke ?? a.visual.stroke;
|
|
437
|
+
e.append("path").attr("class", "em-relation").attr("fill", a.visual.fill).attr("stroke", h).attr("stroke-width", "1").attr("marker-end", `url(#${t})`).attr("d", `M${c} ${x} L${m} ${u}`);
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
o(ae, "renderD3Relation");
|
|
441
|
+
function re(e, n, t, i) {
|
|
442
|
+
return (a) => {
|
|
443
|
+
const r = e.append("g").attr("class", "em-swimlane"), d = i.emSwimlaneBackgroundOdd ?? "rgb(250,250,250)", l = i.emSwimlaneBackgroundStroke ?? "rgb(240,240,240)";
|
|
444
|
+
r.append("rect").attr("x", 0).attr("y", a.y).attr("rx", "3").attr("width", n + t.swimlanePadding).attr("height", a.height).attr("fill", d).attr("stroke", l), r.append("text").attr("font-weight", t.swimlaneTextFontWeight).attr("x", 30).attr("y", a.y + 30).text(a.label);
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
o(re, "renderD3Swimlane");
|
|
448
|
+
var $e = /* @__PURE__ */ o(function(e, n, t, i) {
|
|
449
|
+
if (g.debug("in eventmodeling renderer", e + `
|
|
450
|
+
`, "id:", n, t), !Re)
|
|
451
|
+
throw new Error("EventModeling config not found");
|
|
452
|
+
const a = i.db, { themeVariables: r, eventmodeling: d } = T(), l = xe(`[id="${n}"]`), c = a.getDiagramProps(), m = a.getState(), x = `em-arrowhead-${n}`, u = r.emArrowhead ?? "#000000";
|
|
453
|
+
m.sortedSwimlanesArray.forEach(
|
|
454
|
+
re(l, m.maxR, c, r)
|
|
455
|
+
), m.boxes.forEach(ne(l, c)), m.relations.forEach(ae(l, c, x, r)), l.append("defs").append("marker").attr("id", x).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", u), fe(void 0, l, (d == null ? void 0 : d.padding) ?? 30, d == null ? void 0 : d.useMaxWidth);
|
|
456
|
+
}, "draw"), Te = {
|
|
457
|
+
draw: $e
|
|
458
|
+
}, De = /* @__PURE__ */ o((e) => "", "getStyles"), Ne = De, Ie = {
|
|
459
|
+
parser: Ae,
|
|
460
|
+
db: F,
|
|
461
|
+
renderer: Te,
|
|
462
|
+
styles: Ne
|
|
463
|
+
};
|
|
464
|
+
export {
|
|
465
|
+
Ie as diagram
|
|
466
|
+
};
|