@yiyi_zhang/reactflow-ui 0.5.0-beta.0 → 1.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/README.md +150 -117
- package/dist/AiWorkflowIDE.d.ts +2 -0
- package/dist/WorkflowIDE.d.ts +14 -2
- package/dist/actions/builtin/common.d.ts +8 -0
- package/dist/actions/builtin/ecs.d.ts +12 -0
- package/dist/actions/registry.d.ts +23 -0
- package/dist/actions/types.d.ts +45 -0
- package/dist/ai.d.ts +5 -1
- package/dist/components/AICopilot/ParameterSuggester.d.ts +9 -0
- package/dist/components/AiNative/AgentTimeline.d.ts +11 -6
- package/dist/components/AiNative/InlineCanvasCopilot.d.ts +7 -0
- package/dist/components/AiNative/ProposalPreviewCard.d.ts +3 -3
- package/dist/components/BrandLogo.d.ts +13 -0
- package/dist/components/ExecutionWaterfallPanel.d.ts +3 -0
- package/dist/components/SandboxConfigModal.d.ts +7 -0
- package/dist/components/StructuredJsonViewer.d.ts +11 -0
- package/dist/components/business/ActionForm.d.ts +12 -0
- package/dist/components/business/DataPillInput.d.ts +14 -0
- package/dist/components/business/DecisionBranchCard.d.ts +13 -0
- package/dist/components/business/ForkJoinCard.d.ts +13 -0
- package/dist/components/business/FriendlyErrorCard.d.ts +8 -0
- package/dist/components/business/LoopDoWhileCard.d.ts +13 -0
- package/dist/components/business/PillPicker.d.ts +11 -0
- package/dist/components/business/RunStoryTimeline.d.ts +9 -0
- package/dist/components/business/StepFlowEditor.d.ts +11 -0
- package/dist/components/nodes/NodeLayout.d.ts +3 -1
- package/dist/components/template/TemplateExtractor.d.ts +10 -0
- package/dist/components/template/TemplateGallery.d.ts +10 -0
- package/dist/components/template/TemplateSetupWizard.d.ts +9 -0
- package/dist/hooks/useNodeExecution.d.ts +5 -2
- package/dist/index.d.ts +33 -0
- package/dist/logo.svg +37 -0
- package/dist/product-launch.html +1400 -0
- package/dist/reactflow-ui-ai.es.js +21392 -10
- package/dist/reactflow-ui.css +1 -1
- package/dist/reactflow-ui.es.js +20314 -9020
- package/dist/reactflow-ui.umd.js +31 -21
- package/dist/sample-workflows/ecs-lifecycle-automation.json +74 -0
- package/dist/services/ai/agentRunner.d.ts +23 -19
- package/dist/services/ai/draftPersistence.d.ts +3 -2
- package/dist/services/ai/systemPrompt.d.ts +1 -1
- package/dist/services/ai/toolExecutor.d.ts +15 -2
- package/dist/services/ai/workflowSynthesizer.d.ts +118 -0
- package/dist/services/wlsp/workflowLsp.d.ts +101 -0
- package/dist/stepmodel/compile.d.ts +5 -0
- package/dist/stepmodel/decompile.d.ts +5 -0
- package/dist/stepmodel/types.d.ts +61 -0
- package/dist/store/aiStore.d.ts +34 -3
- package/dist/template/applyTemplate.d.ts +10 -0
- package/dist/template/builtin/templates.d.ts +37 -0
- package/dist/template/sanitizer/anonymize.d.ts +5 -0
- package/dist/template/sanitizer/prune.d.ts +10 -0
- package/dist/template/sanitizer/rules.d.ts +10 -0
- package/dist/template/sanitizer/types.d.ts +55 -0
- package/dist/template/templateStore.d.ts +32 -0
- package/dist/template/types.d.ts +99 -0
- package/dist/types/aiEvents.d.ts +3 -1
- package/dist/types/conductor.d.ts +6 -1
- package/dist/types/workflow.d.ts +32 -0
- package/dist/utils/friendlyErrorTranslator.d.ts +26 -0
- package/dist/utils/localSandboxEngine.d.ts +49 -0
- package/package.json +7 -4
- package/dist/ai-BJwQZcGK.js +0 -15168
- package/dist/arc-BUGZGgtu.js +0 -83
- package/dist/architectureDiagram-3BPJPVTR-ZcgvTwSO.js +0 -4692
- package/dist/blockDiagram-GPEHLZMM-DtVtOBbH.js +0 -2418
- package/dist/c4Diagram-AAUBKEIU-tBS5Rcvm.js +0 -1577
- package/dist/channel-CURI9jmI.js +0 -5
- package/dist/chunk-2J33WTMH-D7gashNz.js +0 -19
- package/dist/chunk-4BX2VUAB-DE3VjyiZ.js +0 -8
- package/dist/chunk-55IACEB6-GYZ_m2MY.js +0 -8
- package/dist/chunk-727SXJPM-D4WVyvOg.js +0 -1528
- package/dist/chunk-AQP2D5EJ-Os2Uwqya.js +0 -1387
- package/dist/chunk-FMBD7UC4-B3CSVzS4.js +0 -19
- package/dist/chunk-ND2GUHAM-CNj_s1aK.js +0 -68
- package/dist/chunk-QZHKN3VN-DoV8iUKo.js +0 -15
- package/dist/classDiagram-4FO5ZUOK-Dr9C18x4.js +0 -16
- package/dist/classDiagram-v2-Q7XG4LA2-Dr9C18x4.js +0 -16
- package/dist/components/Controls/ModeSlider.d.ts +0 -2
- package/dist/cose-bilkent-S5V4N54A-CgQlI-io.js +0 -2609
- package/dist/cytoscape.esm-kVAWcYoG.js +0 -18755
- package/dist/dagre-BM42HDAG-CFMIuOmS.js +0 -445
- package/dist/defaultLocale-BgPVtth8.js +0 -171
- package/dist/diagram-2AECGRRQ-C5jZp2YX.js +0 -217
- package/dist/diagram-5GNKFQAL-DRUVcHpp.js +0 -123
- package/dist/diagram-KO2AKTUF-BOl4aaej.js +0 -461
- package/dist/diagram-LMA3HP47-ZeckPR2Q.js +0 -142
- package/dist/diagram-OG6HWLK6-qUWeLfa-.js +0 -528
- package/dist/erDiagram-TEJ5UH35-Bw_CWS13.js +0 -899
- package/dist/flowDiagram-I6XJVG4X-D3xEvQA-.js +0 -1628
- package/dist/ganttDiagram-6RSMTGT7-D8GvenY3.js +0 -2707
- package/dist/gitGraphDiagram-PVQCEYII-BWrN_HOm.js +0 -815
- package/dist/graph-BRoPeNF3.js +0 -1545
- package/dist/infoDiagram-5YYISTIA-Da8FG5tB.js +0 -24
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/ishikawaDiagram-YF4QCWOH-Bg2_mKEc.js +0 -621
- package/dist/journeyDiagram-JHISSGLW-sFIxGfua.js +0 -834
- package/dist/kanban-definition-UN3LZRKU-CGmopzHd.js +0 -724
- package/dist/katex-DoRnZ_sp.js +0 -11682
- package/dist/layout-D9EpM4Fg.js +0 -1728
- package/dist/linear-BA49eco4.js +0 -259
- package/dist/mermaid.core-XSpZEAKP.js +0 -16137
- package/dist/mindmap-definition-RKZ34NQL-Bqf76QGB.js +0 -827
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/pieDiagram-4H26LBE5-hHiP8HzL.js +0 -163
- package/dist/quadrantDiagram-W4KKPZXB-DSccwH8B.js +0 -1024
- package/dist/requirementDiagram-4Y6WPE33-DIpyoYZ_.js +0 -882
- package/dist/sankeyDiagram-5OEKKPKP-DsaPqq8D.js +0 -847
- package/dist/sequenceDiagram-3UESZ5HK-BNg7orie.js +0 -2891
- package/dist/stateDiagram-AJRCARHV-Rv1mSmnJ.js +0 -263
- package/dist/stateDiagram-v2-BHNVJYJU-BME16k02.js +0 -16
- package/dist/timeline-definition-PNZ67QCA-CmmzdVk-.js +0 -1055
- package/dist/vennDiagram-CIIHVFJN-BQt00w9Q.js +0 -1557
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +0 -22512
- package/dist/wardleyDiagram-YWT4CUSO-LZpiODGN.js +0 -675
- package/dist/xychartDiagram-2RQKCTM6-BpJlv_mc.js +0 -1342
|
@@ -1,461 +0,0 @@
|
|
|
1
|
-
import { p as re } from "./chunk-4BX2VUAB-DE3VjyiZ.js";
|
|
2
|
-
import { _ as o, q as oe, p as se, s as de, g as le, a as ce, b as me, l as g, c as D, d as ue, E as xe, z as fe, F as ge, D as M, G as he, i as y, w as P, ak as pe } from "./mermaid.core-XSpZEAKP.js";
|
|
3
|
-
import { p as be, i as ve } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
4
|
-
var T = "position frame", $ = "frame positioned", S = "position relation", N = "relation positioned", we = /* @__PURE__ */ o(function(e) {
|
|
5
|
-
g.debug("options str", e);
|
|
6
|
-
}, "setOptions"), ye = /* @__PURE__ */ o(function() {
|
|
7
|
-
return {};
|
|
8
|
-
}, "getOptions"), Pe = /* @__PURE__ */ o(function() {
|
|
9
|
-
C(), fe();
|
|
10
|
-
}, "clear");
|
|
11
|
-
function C() {
|
|
12
|
-
B = {};
|
|
13
|
-
}
|
|
14
|
-
o(C, "reset");
|
|
15
|
-
var Se = he.eventmodeling, ke = /* @__PURE__ */ o(() => ge({
|
|
16
|
-
...Se,
|
|
17
|
-
...M().eventmodeling
|
|
18
|
-
}), "getConfig"), B = {};
|
|
19
|
-
function O() {
|
|
20
|
-
let e = Fe;
|
|
21
|
-
const { ast: n } = B, t = E();
|
|
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 = v(e, {
|
|
27
|
-
$kind: T,
|
|
28
|
-
index: a,
|
|
29
|
-
frame: i,
|
|
30
|
-
textProps: r
|
|
31
|
-
});
|
|
32
|
-
let d;
|
|
33
|
-
K(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 = v(e, {
|
|
35
|
-
$kind: S,
|
|
36
|
-
index: a,
|
|
37
|
-
frame: i,
|
|
38
|
-
sourceFrame: l
|
|
39
|
-
});
|
|
40
|
-
})) : e = v(e, {
|
|
41
|
-
$kind: S,
|
|
42
|
-
index: a,
|
|
43
|
-
frame: i
|
|
44
|
-
});
|
|
45
|
-
}), e = {
|
|
46
|
-
...e,
|
|
47
|
-
sortedSwimlanesArray: A(e.swimlanes)
|
|
48
|
-
}, e;
|
|
49
|
-
}
|
|
50
|
-
o(O, "getState");
|
|
51
|
-
function I(e) {
|
|
52
|
-
B.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 E() {
|
|
79
|
-
return s;
|
|
80
|
-
}
|
|
81
|
-
o(E, "getDiagramProps");
|
|
82
|
-
var Fe = {
|
|
83
|
-
boxes: [],
|
|
84
|
-
swimlanes: {},
|
|
85
|
-
relations: [],
|
|
86
|
-
maxR: 0,
|
|
87
|
-
sortedSwimlanesArray: []
|
|
88
|
-
};
|
|
89
|
-
function W(e) {
|
|
90
|
-
const n = e.split(".");
|
|
91
|
-
if (n.length === 2)
|
|
92
|
-
return n[0];
|
|
93
|
-
}
|
|
94
|
-
o(W, "extractNamespace");
|
|
95
|
-
function H(e) {
|
|
96
|
-
const n = e.split(".");
|
|
97
|
-
return n.length === 2 ? n[1] : e;
|
|
98
|
-
}
|
|
99
|
-
o(H, "extractName");
|
|
100
|
-
function U(e, n) {
|
|
101
|
-
if (!(!n || n.length === 0))
|
|
102
|
-
return Object.values(e).find((t) => t.namespace === n);
|
|
103
|
-
}
|
|
104
|
-
o(U, "findSwimlaneByNamespace");
|
|
105
|
-
function b(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(b, "findNextAvailableIndex");
|
|
115
|
-
function _(e, n) {
|
|
116
|
-
const t = W(e.entityIdentifier), i = U(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: b(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: b(n, 100, 200),
|
|
137
|
-
label: s.labelCommandReadModelPrefix + t
|
|
138
|
-
} : { index: 100, label: s.labelCommandReadModel };
|
|
139
|
-
default:
|
|
140
|
-
return i ? {
|
|
141
|
-
index: i.index,
|
|
142
|
-
label: i.namespace || s.labelEvents
|
|
143
|
-
} : t ? {
|
|
144
|
-
index: b(n, 200, 300),
|
|
145
|
-
label: s.labelEventsPrefix + t
|
|
146
|
-
} : { index: 200, label: s.labelEvents };
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
o(_, "calculateSwimlaneProps");
|
|
150
|
-
function G(e) {
|
|
151
|
-
const { themeVariables: n } = M();
|
|
152
|
-
switch (e.modelEntityType) {
|
|
153
|
-
case "ui":
|
|
154
|
-
return {
|
|
155
|
-
fill: n.emUiFill ?? "white",
|
|
156
|
-
stroke: n.emUiStroke ?? "#dbdada"
|
|
157
|
-
};
|
|
158
|
-
case "pcr":
|
|
159
|
-
case "processor":
|
|
160
|
-
return {
|
|
161
|
-
fill: n.emProcessorFill ?? "#edb3f6",
|
|
162
|
-
stroke: n.emProcessorStroke ?? "#b88cbf"
|
|
163
|
-
};
|
|
164
|
-
case "rmo":
|
|
165
|
-
case "readmodel":
|
|
166
|
-
return {
|
|
167
|
-
fill: n.emReadModelFill ?? "#d3f1a2",
|
|
168
|
-
stroke: n.emReadModelStroke ?? "#a3b732"
|
|
169
|
-
};
|
|
170
|
-
case "cmd":
|
|
171
|
-
case "command":
|
|
172
|
-
return {
|
|
173
|
-
fill: n.emCommandFill ?? "#bcd6fe",
|
|
174
|
-
stroke: n.emCommandStroke ?? "#679ac3"
|
|
175
|
-
};
|
|
176
|
-
case "evt":
|
|
177
|
-
case "event":
|
|
178
|
-
return {
|
|
179
|
-
fill: n.emEventFill ?? "#ffb778",
|
|
180
|
-
stroke: n.emEventStroke ?? "#c19a0f"
|
|
181
|
-
};
|
|
182
|
-
default:
|
|
183
|
-
return {
|
|
184
|
-
fill: "red",
|
|
185
|
-
stroke: "black"
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
o(G, "calculateEntityVisualProps");
|
|
190
|
-
function L(e, n, t) {
|
|
191
|
-
const i = M(), a = y(H(e.entityIdentifier) ?? "", i);
|
|
192
|
-
let r;
|
|
193
|
-
const d = {
|
|
194
|
-
fontSize: 16,
|
|
195
|
-
fontWeight: 700,
|
|
196
|
-
fontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
|
197
|
-
joinWith: "<br/>"
|
|
198
|
-
};
|
|
199
|
-
let c = `<b>${P(a, t.textMaxWidth, d)}</b>`;
|
|
200
|
-
if (e.dataInlineValue && (r = e.dataInlineValue, r = r.substring(r.indexOf("{") + 1), r = r.substring(0, r.lastIndexOf("}") - 1), r = y(r, i), r = P(r, t.textMaxWidth, d), r = r.replaceAll(" ", " ")), e.dataReference) {
|
|
201
|
-
const p = n.find(
|
|
202
|
-
(w) => w.name === e.dataReference?.$refText
|
|
203
|
-
);
|
|
204
|
-
p && (r = p.dataBlockValue, r = r.substring(r.indexOf(`{
|
|
205
|
-
`) + 2), r = r.substring(0, r.lastIndexOf("}") - 1), r = y(r, i), r = P(r, t.textMaxWidth, d), r = r.replaceAll(" ", " "), r += "<br/>");
|
|
206
|
-
}
|
|
207
|
-
const m = r !== void 0;
|
|
208
|
-
m && (c += `<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);
|
|
209
|
-
const x = {
|
|
210
|
-
fontSize: d.fontSize,
|
|
211
|
-
fontWeight: d.fontWeight,
|
|
212
|
-
fontFamily: d.fontFamily
|
|
213
|
-
}, u = pe(c, x), h = m ? u.width / 3 : u.width, f = {
|
|
214
|
-
content: c,
|
|
215
|
-
width: h,
|
|
216
|
-
height: u.height
|
|
217
|
-
};
|
|
218
|
-
return g.debug(`[${e.name}] ${e.entityIdentifier} text`, f), f;
|
|
219
|
-
}
|
|
220
|
-
o(L, "calculateTextProps");
|
|
221
|
-
function V(e, n) {
|
|
222
|
-
const t = n, i = G(t.frame), a = {
|
|
223
|
-
width: t.textProps.width + 2 * s.boxTextPadding,
|
|
224
|
-
height: t.textProps.height + 2 * s.boxTextPadding
|
|
225
|
-
};
|
|
226
|
-
return [{
|
|
227
|
-
$kind: $,
|
|
228
|
-
frame: t.frame,
|
|
229
|
-
index: t.index,
|
|
230
|
-
visual: i,
|
|
231
|
-
dimension: a,
|
|
232
|
-
textProps: t.textProps
|
|
233
|
-
}];
|
|
234
|
-
}
|
|
235
|
-
o(V, "decidePositionFrame");
|
|
236
|
-
function X(e, n, t) {
|
|
237
|
-
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;
|
|
238
|
-
}
|
|
239
|
-
o(X, "calculateX");
|
|
240
|
-
function j(e, n) {
|
|
241
|
-
const t = [...e.map((i) => i.r), n];
|
|
242
|
-
return Math.max(...t);
|
|
243
|
-
}
|
|
244
|
-
o(j, "calculateMaxRight");
|
|
245
|
-
function A(e) {
|
|
246
|
-
return Object.values(e).sort((n, t) => n.index - t.index);
|
|
247
|
-
}
|
|
248
|
-
o(A, "sortedSwimlanesArray");
|
|
249
|
-
function Y(e, n) {
|
|
250
|
-
const t = n, i = _(t.frame, e.swimlanes);
|
|
251
|
-
let a;
|
|
252
|
-
i.index in e.swimlanes ? a = e.swimlanes[i.index] : a = {
|
|
253
|
-
index: i.index,
|
|
254
|
-
label: i.label,
|
|
255
|
-
r: 0,
|
|
256
|
-
y: i.index * s.swimlaneMinHeight + s.swimlaneGap,
|
|
257
|
-
height: s.swimlaneMinHeight,
|
|
258
|
-
maxHeight: s.swimlaneMinHeight
|
|
259
|
-
};
|
|
260
|
-
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 = {
|
|
261
|
-
width: Math.max(
|
|
262
|
-
s.boxMinWidth,
|
|
263
|
-
Math.min(s.boxMaxWidth, t.dimension.width)
|
|
264
|
-
) + 2 * s.boxPadding,
|
|
265
|
-
height: Math.max(
|
|
266
|
-
s.boxMinHeight,
|
|
267
|
-
Math.min(s.boxMaxHeight, t.dimension.height)
|
|
268
|
-
) + 2 * s.boxPadding
|
|
269
|
-
}, c = X(a, d, r), m = c + l.width + s.boxPadding, x = j(Object.values(e.swimlanes), m);
|
|
270
|
-
a.r = c + l.width, a.maxHeight = Math.max(a.maxHeight, l.height), a.height = Math.max(s.swimlaneMinHeight, a.maxHeight) + 2 * s.swimlanePadding;
|
|
271
|
-
const u = {
|
|
272
|
-
x: c,
|
|
273
|
-
y: s.swimlanePadding + a.y,
|
|
274
|
-
// y: diagramProps.swimlanePadding + (swimlane.y || diagramProps.boxDefaultY),
|
|
275
|
-
r: m,
|
|
276
|
-
dimension: l,
|
|
277
|
-
leftSibling: !1,
|
|
278
|
-
swimlane: a,
|
|
279
|
-
visual: t.visual,
|
|
280
|
-
text: t.textProps.content,
|
|
281
|
-
frame: t.frame,
|
|
282
|
-
index: t.index
|
|
283
|
-
}, h = {
|
|
284
|
-
...e,
|
|
285
|
-
boxes: [...e.boxes, u],
|
|
286
|
-
swimlanes: {
|
|
287
|
-
...e.swimlanes,
|
|
288
|
-
[`${a.index}`]: a
|
|
289
|
-
},
|
|
290
|
-
previousSwimlaneNumber: i.index,
|
|
291
|
-
previousFrame: t.frame,
|
|
292
|
-
maxR: x
|
|
293
|
-
}, f = A(h.swimlanes);
|
|
294
|
-
f.length > 0 && (f[0].y = 0);
|
|
295
|
-
for (let p = 1; p < f.length; p++) {
|
|
296
|
-
const w = f[p], R = f[p - 1];
|
|
297
|
-
w.y = R.y + R.height + s.swimlaneGap;
|
|
298
|
-
}
|
|
299
|
-
return h;
|
|
300
|
-
}
|
|
301
|
-
o(Y, "evolveFramePositioned");
|
|
302
|
-
function z(e, n) {
|
|
303
|
-
return e === 0 && n.sourceFrames.length === 0;
|
|
304
|
-
}
|
|
305
|
-
o(z, "isFirstFrame");
|
|
306
|
-
function K(e) {
|
|
307
|
-
return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
|
|
308
|
-
}
|
|
309
|
-
o(K, "hasSourceFrame");
|
|
310
|
-
function k(e, n) {
|
|
311
|
-
if (n != null)
|
|
312
|
-
return e.find((t) => t.frame.name === n.name);
|
|
313
|
-
}
|
|
314
|
-
o(k, "findBoxByFrame");
|
|
315
|
-
function q(e, n, t) {
|
|
316
|
-
if (!(t < 0))
|
|
317
|
-
for (let i = t; i >= 0; i--) {
|
|
318
|
-
const a = e[i];
|
|
319
|
-
if (a.swimlane.index !== n)
|
|
320
|
-
return a;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
o(q, "findBoxByLineIndex");
|
|
324
|
-
function J(e, n) {
|
|
325
|
-
const t = n;
|
|
326
|
-
if (ve(t.frame) || z(t.index, t.frame))
|
|
327
|
-
return [];
|
|
328
|
-
const i = k(e.boxes, t.frame);
|
|
329
|
-
if (i === void 0)
|
|
330
|
-
throw new Error(`Target box not found for frame ${t.frame.name}`);
|
|
331
|
-
let a;
|
|
332
|
-
return t.sourceFrame ? a = k(e.boxes, t.sourceFrame) : a = q(e.boxes, i.swimlane.index, t.index - 1), a === void 0 ? [] : [{
|
|
333
|
-
$kind: N,
|
|
334
|
-
frame: t.frame,
|
|
335
|
-
index: t.index,
|
|
336
|
-
sourceBox: a,
|
|
337
|
-
targetBox: i
|
|
338
|
-
}];
|
|
339
|
-
}
|
|
340
|
-
o(J, "decidePositionRelation");
|
|
341
|
-
function Q(e, n) {
|
|
342
|
-
const t = n, i = {
|
|
343
|
-
visual: {
|
|
344
|
-
fill: "none",
|
|
345
|
-
stroke: "#000"
|
|
346
|
-
},
|
|
347
|
-
source: {
|
|
348
|
-
x: t.sourceBox.x,
|
|
349
|
-
y: t.sourceBox.y
|
|
350
|
-
},
|
|
351
|
-
target: {
|
|
352
|
-
x: t.targetBox.x,
|
|
353
|
-
y: t.targetBox.y
|
|
354
|
-
},
|
|
355
|
-
sourceBox: t.sourceBox,
|
|
356
|
-
targetBox: t.targetBox
|
|
357
|
-
};
|
|
358
|
-
return {
|
|
359
|
-
...e,
|
|
360
|
-
relations: [...e.relations, i]
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
o(Q, "evolveRelationPositioned");
|
|
364
|
-
var Me = {
|
|
365
|
-
[T]: V,
|
|
366
|
-
[S]: J
|
|
367
|
-
}, Be = {
|
|
368
|
-
[$]: Y,
|
|
369
|
-
[N]: Q
|
|
370
|
-
};
|
|
371
|
-
function Z(e, n) {
|
|
372
|
-
const t = Me[n.$kind];
|
|
373
|
-
if (t == null)
|
|
374
|
-
return [];
|
|
375
|
-
const i = t(e, n);
|
|
376
|
-
return g.debug("decided events", i), i;
|
|
377
|
-
}
|
|
378
|
-
o(Z, "decide");
|
|
379
|
-
function ee(e, n) {
|
|
380
|
-
const t = n.reduce((i, a) => {
|
|
381
|
-
const r = Be[a.$kind];
|
|
382
|
-
return r == null ? i : r(i, a);
|
|
383
|
-
}, e);
|
|
384
|
-
return g.debug("evolve events", { state: e, newState: t, events: n }), t;
|
|
385
|
-
}
|
|
386
|
-
o(ee, "evolve");
|
|
387
|
-
function v(e, n) {
|
|
388
|
-
const t = Z(e, n);
|
|
389
|
-
return ee(e, t);
|
|
390
|
-
}
|
|
391
|
-
o(v, "dispatch");
|
|
392
|
-
var F = {
|
|
393
|
-
getConfig: ke,
|
|
394
|
-
setOptions: we,
|
|
395
|
-
getOptions: ye,
|
|
396
|
-
clear: Pe,
|
|
397
|
-
setAccTitle: me,
|
|
398
|
-
getAccTitle: ce,
|
|
399
|
-
getAccDescription: le,
|
|
400
|
-
setAccDescription: de,
|
|
401
|
-
setDiagramTitle: se,
|
|
402
|
-
getDiagramTitle: oe,
|
|
403
|
-
setAst: I,
|
|
404
|
-
getDiagramProps: E,
|
|
405
|
-
getState: O
|
|
406
|
-
}, Ee = {
|
|
407
|
-
parse: /* @__PURE__ */ o(async (e) => {
|
|
408
|
-
const n = await be("eventmodeling", e);
|
|
409
|
-
g.debug(n), F.setAst(n), re(n, F);
|
|
410
|
-
}, "parse")
|
|
411
|
-
}, Ae = D(), Re = Ae?.eventmodeling;
|
|
412
|
-
function te(e, n) {
|
|
413
|
-
return (t) => {
|
|
414
|
-
const i = t.swimlane.y + n.swimlanePadding, a = e.append("g").attr("class", "em-box");
|
|
415
|
-
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);
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
o(te, "renderD3Box");
|
|
419
|
-
function ne(e, n) {
|
|
420
|
-
return e > n;
|
|
421
|
-
}
|
|
422
|
-
o(ne, "dirUpwards");
|
|
423
|
-
function ie(e, n, t, i) {
|
|
424
|
-
return (a) => {
|
|
425
|
-
const r = a.sourceBox.swimlane.y + n.swimlanePadding, d = a.targetBox.swimlane.y + n.swimlanePadding, l = ne(r, d), c = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, m = a.targetBox.x + a.targetBox.dimension.width / 3;
|
|
426
|
-
let x, u;
|
|
427
|
-
g.debug(`rendering relation up=${l} for `, {
|
|
428
|
-
sourceBox: a.sourceBox,
|
|
429
|
-
targetBox: a.targetBox
|
|
430
|
-
}), l ? (x = r, u = d + a.targetBox.dimension.height) : (x = r + a.sourceBox.dimension.height, u = d);
|
|
431
|
-
const h = i.emRelationStroke ?? a.visual.stroke;
|
|
432
|
-
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}`);
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
o(ie, "renderD3Relation");
|
|
436
|
-
function ae(e, n, t, i) {
|
|
437
|
-
return (a) => {
|
|
438
|
-
const r = e.append("g").attr("class", "em-swimlane"), d = i.emSwimlaneBackgroundOdd ?? "rgb(250,250,250)", l = i.emSwimlaneBackgroundStroke ?? "rgb(240,240,240)";
|
|
439
|
-
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);
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
o(ae, "renderD3Swimlane");
|
|
443
|
-
var De = /* @__PURE__ */ o(function(e, n, t, i) {
|
|
444
|
-
if (g.debug("in eventmodeling renderer", e + `
|
|
445
|
-
`, "id:", n, t), !Re)
|
|
446
|
-
throw new Error("EventModeling config not found");
|
|
447
|
-
const a = i.db, { themeVariables: r, eventmodeling: d } = D(), l = ue(`[id="${n}"]`), c = a.getDiagramProps(), m = a.getState(), x = `em-arrowhead-${n}`, u = r.emArrowhead ?? "#000000";
|
|
448
|
-
m.sortedSwimlanesArray.forEach(
|
|
449
|
-
ae(l, m.maxR, c, r)
|
|
450
|
-
), m.boxes.forEach(te(l, c)), m.relations.forEach(ie(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), xe(void 0, l, d?.padding ?? 30, d?.useMaxWidth);
|
|
451
|
-
}, "draw"), Te = {
|
|
452
|
-
draw: De
|
|
453
|
-
}, $e = /* @__PURE__ */ o((e) => "", "getStyles"), Ne = $e, We = {
|
|
454
|
-
parser: Ee,
|
|
455
|
-
db: F,
|
|
456
|
-
renderer: Te,
|
|
457
|
-
styles: Ne
|
|
458
|
-
};
|
|
459
|
-
export {
|
|
460
|
-
We as diagram
|
|
461
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { _ as b, F as m, I as B, e as C, l as w, b as S, a as D, p as T, q as z, g as F, s as P, D as E, G as A, z as W } from "./mermaid.core-XSpZEAKP.js";
|
|
2
|
-
import { p as _ } from "./chunk-4BX2VUAB-DE3VjyiZ.js";
|
|
3
|
-
import { p as N } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
4
|
-
var I = A.packet, u, v = (u = class {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.packet = [], this.setAccTitle = S, this.getAccTitle = D, this.setDiagramTitle = T, this.getDiagramTitle = z, this.getAccDescription = F, this.setAccDescription = P;
|
|
7
|
-
}
|
|
8
|
-
getConfig() {
|
|
9
|
-
const t = m({
|
|
10
|
-
...I,
|
|
11
|
-
...E().packet
|
|
12
|
-
});
|
|
13
|
-
return t.showBits && (t.paddingY += 10), t;
|
|
14
|
-
}
|
|
15
|
-
getPacket() {
|
|
16
|
-
return this.packet;
|
|
17
|
-
}
|
|
18
|
-
pushWord(t) {
|
|
19
|
-
t.length > 0 && this.packet.push(t);
|
|
20
|
-
}
|
|
21
|
-
clear() {
|
|
22
|
-
W(), this.packet = [];
|
|
23
|
-
}
|
|
24
|
-
}, b(u, "PacketDB"), u), L = 1e4, M = /* @__PURE__ */ b((e, t) => {
|
|
25
|
-
_(e, t);
|
|
26
|
-
let r = -1, s = [], n = 1;
|
|
27
|
-
const { bitsPerRow: l } = t.getConfig();
|
|
28
|
-
for (let { start: a, end: i, bits: d, label: c } of e.blocks) {
|
|
29
|
-
if (a !== void 0 && i !== void 0 && i < a)
|
|
30
|
-
throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);
|
|
31
|
-
if (a ??= r + 1, a !== r + 1)
|
|
32
|
-
throw new Error(
|
|
33
|
-
`Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${r + 1}.`
|
|
34
|
-
);
|
|
35
|
-
if (d === 0)
|
|
36
|
-
throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
|
|
37
|
-
for (i ??= a + (d ?? 1) - 1, d ??= i - a + 1, r = i, w.debug(`Packet block ${a} - ${r} with label ${c}`); s.length <= l + 1 && t.getPacket().length < L; ) {
|
|
38
|
-
const [p, o] = Y({ start: a, end: i, bits: d, label: c }, n, l);
|
|
39
|
-
if (s.push(p), p.end + 1 === n * l && (t.pushWord(s), s = [], n++), !o)
|
|
40
|
-
break;
|
|
41
|
-
({ start: a, end: i, bits: d, label: c } = o);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
t.pushWord(s);
|
|
45
|
-
}, "populate"), Y = /* @__PURE__ */ b((e, t, r) => {
|
|
46
|
-
if (e.start === void 0)
|
|
47
|
-
throw new Error("start should have been set during first phase");
|
|
48
|
-
if (e.end === void 0)
|
|
49
|
-
throw new Error("end should have been set during first phase");
|
|
50
|
-
if (e.start > e.end)
|
|
51
|
-
throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
|
|
52
|
-
if (e.end + 1 <= t * r)
|
|
53
|
-
return [e, void 0];
|
|
54
|
-
const s = t * r - 1, n = t * r;
|
|
55
|
-
return [
|
|
56
|
-
{
|
|
57
|
-
start: e.start,
|
|
58
|
-
end: s,
|
|
59
|
-
label: e.label,
|
|
60
|
-
bits: s - e.start
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
start: n,
|
|
64
|
-
end: e.end,
|
|
65
|
-
label: e.label,
|
|
66
|
-
bits: e.end - n
|
|
67
|
-
}
|
|
68
|
-
];
|
|
69
|
-
}, "getNextFittingBlock"), x = {
|
|
70
|
-
// @ts-expect-error - PacketDB is not assignable to DiagramDB
|
|
71
|
-
parser: { yy: void 0 },
|
|
72
|
-
parse: /* @__PURE__ */ b(async (e) => {
|
|
73
|
-
const t = await N("packet", e), r = x.parser?.yy;
|
|
74
|
-
if (!(r instanceof v))
|
|
75
|
-
throw new Error(
|
|
76
|
-
"parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
|
|
77
|
-
);
|
|
78
|
-
w.debug(t), M(t, r);
|
|
79
|
-
}, "parse")
|
|
80
|
-
}, G = /* @__PURE__ */ b((e, t, r, s) => {
|
|
81
|
-
const n = s.db, l = n.getConfig(), { rowHeight: a, paddingY: i, bitWidth: d, bitsPerRow: c } = l, p = n.getPacket(), o = n.getDiagramTitle(), h = a + i, g = h * (p.length + 1) - (o ? 0 : a), k = d * c + 2, f = B(t);
|
|
82
|
-
f.attr("viewBox", `0 0 ${k} ${g}`), C(f, g, k, l.useMaxWidth);
|
|
83
|
-
for (const [y, $] of p.entries())
|
|
84
|
-
O(f, $, y, l);
|
|
85
|
-
f.append("text").text(o).attr("x", k / 2).attr("y", g - h / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
86
|
-
}, "draw"), O = /* @__PURE__ */ b((e, t, r, { rowHeight: s, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
|
|
87
|
-
const c = e.append("g"), p = r * (s + l) + l;
|
|
88
|
-
for (const o of t) {
|
|
89
|
-
const h = o.start % i * a + 1, g = (o.end - o.start + 1) * a - n;
|
|
90
|
-
if (c.append("rect").attr("x", h).attr("y", p).attr("width", g).attr("height", s).attr("class", "packetBlock"), c.append("text").attr("x", h + g / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(o.label), !d)
|
|
91
|
-
continue;
|
|
92
|
-
const k = o.end === o.start, f = p - 2;
|
|
93
|
-
c.append("text").attr("x", h + (k ? g / 2 : 0)).attr("y", f).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", k ? "middle" : "start").text(o.start), k || c.append("text").attr("x", h + g).attr("y", f).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(o.end);
|
|
94
|
-
}
|
|
95
|
-
}, "drawWord"), j = { draw: G }, q = {
|
|
96
|
-
byteFontSize: "10px",
|
|
97
|
-
startByteColor: "black",
|
|
98
|
-
endByteColor: "black",
|
|
99
|
-
labelColor: "black",
|
|
100
|
-
labelFontSize: "12px",
|
|
101
|
-
titleColor: "black",
|
|
102
|
-
titleFontSize: "14px",
|
|
103
|
-
blockStrokeColor: "black",
|
|
104
|
-
blockStrokeWidth: "1",
|
|
105
|
-
blockFillColor: "#efefef"
|
|
106
|
-
}, H = /* @__PURE__ */ b(({ packet: e } = {}) => {
|
|
107
|
-
const t = m(q, e);
|
|
108
|
-
return `
|
|
109
|
-
.packetByte {
|
|
110
|
-
font-size: ${t.byteFontSize};
|
|
111
|
-
}
|
|
112
|
-
.packetByte.start {
|
|
113
|
-
fill: ${t.startByteColor};
|
|
114
|
-
}
|
|
115
|
-
.packetByte.end {
|
|
116
|
-
fill: ${t.endByteColor};
|
|
117
|
-
}
|
|
118
|
-
.packetLabel {
|
|
119
|
-
fill: ${t.labelColor};
|
|
120
|
-
font-size: ${t.labelFontSize};
|
|
121
|
-
}
|
|
122
|
-
.packetTitle {
|
|
123
|
-
fill: ${t.titleColor};
|
|
124
|
-
font-size: ${t.titleFontSize};
|
|
125
|
-
}
|
|
126
|
-
.packetBlock {
|
|
127
|
-
stroke: ${t.blockStrokeColor};
|
|
128
|
-
stroke-width: ${t.blockStrokeWidth};
|
|
129
|
-
fill: ${t.blockFillColor};
|
|
130
|
-
}
|
|
131
|
-
`;
|
|
132
|
-
}, "styles"), X = {
|
|
133
|
-
parser: x,
|
|
134
|
-
get db() {
|
|
135
|
-
return new v();
|
|
136
|
-
},
|
|
137
|
-
renderer: j,
|
|
138
|
-
styles: H
|
|
139
|
-
};
|
|
140
|
-
export {
|
|
141
|
-
X as diagram
|
|
142
|
-
};
|