@loopstack/loopstack-studio 0.29.5 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +3 -1
- package/dist/api/config.js +5 -4
- package/dist/api/environments.js +5 -1
- package/dist/api/processor.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -30
- package/dist/components/ai-elements/code-block.js +4 -4
- package/dist/components/dynamic-form/CodeContent.js +1 -1
- package/dist/components/dynamic-form/FormBody.js +1 -1
- package/dist/components/motion/FadeIn.js +72 -0
- package/dist/components/motion/StreamingText.js +49 -0
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui-widgets/UiWidget.js +11 -10
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
- package/dist/events/sse-client-events.js +7 -1
- package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
- package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
- package/dist/features/documents/DocumentRenderer.js +18 -17
- package/dist/features/documents/components/DocumentItem.js +42 -20
- package/dist/features/documents/components/DocumentList.js +34 -36
- package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
- package/dist/features/documents/document-details/DocumentDetails.js +577 -377
- package/dist/features/documents/document-details/PromptDetails.js +118 -130
- package/dist/features/documents/document-details/document-debug-utils.js +100 -0
- package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
- package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
- package/dist/features/documents/renderers/LlmMessage.js +52 -47
- package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
- package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
- package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
- package/dist/features/feature-registry/available-features.js +12 -0
- package/dist/features/feature-registry/index.js +2 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
- package/dist/features/git/components/GitBranchBadge.js +31 -0
- package/dist/features/git/components/GitCommitList.js +46 -0
- package/dist/features/git/components/GitRemoteStatus.js +84 -0
- package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
- package/dist/features/git/git-feature.js +12 -0
- package/dist/features/git/hooks/useGit.js +78 -0
- package/dist/features/git/index.js +1 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
- package/dist/features/runs/Runs.js +4 -4
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
- package/dist/features/workbench/Workbench.js +25 -33
- package/dist/features/workbench/WorkflowItem.js +9 -9
- package/dist/features/workbench/WorkflowList.js +61 -62
- package/dist/features/workbench/components/NewRunDialog.js +237 -209
- package/dist/features/workbench/components/RecentRunItem.js +3 -3
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +11 -10
- package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
- package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
- package/dist/features/workbench/index.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
- package/dist/features/workspaces/Workspaces.js +134 -125
- package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
- package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
- package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
- package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
- package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +43 -30
- package/dist/hooks/useConfig.js +28 -22
- package/dist/hooks/useEnvironments.js +27 -2
- package/dist/hooks/useProcessor.js +14 -1
- package/dist/hooks/useWorkflows.js +4 -4
- package/dist/index.d.ts +116 -15
- package/dist/index.js +9 -8
- package/dist/node_modules/d3/src/index.js +13 -13
- package/dist/node_modules/d3-scale/src/continuous.js +16 -16
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
- package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
- package/dist/node_modules/motion/dist/es/react.js +9 -2
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +76 -106
- package/dist/pages/EmbedWorkbenchPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +6 -6
- package/dist/pages/WorkbenchPage.js +43 -47
- package/dist/pages/WorkflowDebugPage.js +6 -12
- package/dist/pages/WorkspacePage.js +40 -66
- package/dist/pages/WorkspaceRunsPage.js +24 -31
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import select_default from "../../../../d3-selection/src/select.js";
|
|
1
2
|
import { __name, log } from "./chunk-AGHRB4JF.js";
|
|
2
3
|
import { assignWithDepth_default, calculateMathMLDimensions, clear, common_default, configureSvgSize, getAccDescription, getAccTitle, getConfig, getConfig2, getDiagramTitle, getUrl, hasKatex, renderKatexSanitized, sanitizeText, setAccDescription, setAccTitle, setConfig2, setDiagramTitle } from "./chunk-CSCIHK7Q.js";
|
|
3
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
4
4
|
import "../../../../d3/src/index.js";
|
|
5
5
|
import { JSON_SCHEMA, load } from "./chunk-XPW4576I.js";
|
|
6
6
|
import { require_dist } from "../../../../@braintree/sanitize-url/dist/index.js";
|
|
@@ -8,7 +8,7 @@ import { ZERO_WIDTH_SPACE, parseFontSize, utils_default } from "./chunk-5ZQYHXKU
|
|
|
8
8
|
import { drawBackgroundRect, drawEmbeddedImage, drawImage, drawRect, getNoteRect, getTextObj } from "./chunk-ND2GUHAM.js";
|
|
9
9
|
import { ImperativeState } from "./chunk-QZHKN3VN.js";
|
|
10
10
|
var import_dist = require_dist(), parser = (function() {
|
|
11
|
-
var
|
|
11
|
+
var e = /* @__PURE__ */ __name(function(e, t, n, r) {
|
|
12
12
|
for (n ||= {}, r = e.length; r--; n[e[r]] = t);
|
|
13
13
|
return n;
|
|
14
14
|
}, "o"), n = [1, 2], r = [1, 3], i = [1, 4], a = [2, 4], o = [1, 9], s = [1, 11], c = [1, 12], l = [1, 14], u = [1, 15], d = [1, 17], f = [1, 18], p = [1, 19], m = [1, 25], h = [1, 26], g = [1, 27], _ = [1, 28], v = [1, 29], y = [1, 30], b = [1, 31], x = [1, 32], S = [1, 33], C = [1, 34], w = [1, 35], T = [1, 36], E = [1, 37], D = [1, 38], O = [1, 39], k = [1, 40], A = [1, 42], j = [1, 43], M = [1, 44], N = [1, 45], P = [1, 46], F = [1, 47], I = [
|
|
@@ -1003,7 +1003,7 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1003
1003
|
5: r,
|
|
1004
1004
|
6: i
|
|
1005
1005
|
},
|
|
1006
|
-
|
|
1006
|
+
e([
|
|
1007
1007
|
1,
|
|
1008
1008
|
4,
|
|
1009
1009
|
5,
|
|
@@ -1081,7 +1081,7 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1081
1081
|
64: P,
|
|
1082
1082
|
73: F
|
|
1083
1083
|
},
|
|
1084
|
-
|
|
1084
|
+
e(I, [2, 5]),
|
|
1085
1085
|
{
|
|
1086
1086
|
9: 48,
|
|
1087
1087
|
13: 13,
|
|
@@ -1120,10 +1120,10 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1120
1120
|
64: P,
|
|
1121
1121
|
73: F
|
|
1122
1122
|
},
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1123
|
+
e(I, [2, 7]),
|
|
1124
|
+
e(I, [2, 8]),
|
|
1125
|
+
e(I, [2, 9]),
|
|
1126
|
+
e(I, [2, 15]),
|
|
1127
1127
|
{
|
|
1128
1128
|
13: 49,
|
|
1129
1129
|
51: D,
|
|
@@ -1150,11 +1150,11 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1150
1150
|
{ 5: [1, 59] },
|
|
1151
1151
|
{ 5: [1, 60] },
|
|
1152
1152
|
{ 5: [1, 61] },
|
|
1153
|
-
|
|
1154
|
-
|
|
1153
|
+
e(I, [2, 30]),
|
|
1154
|
+
e(I, [2, 31]),
|
|
1155
1155
|
{ 33: [1, 62] },
|
|
1156
1156
|
{ 35: [1, 63] },
|
|
1157
|
-
|
|
1157
|
+
e(I, [2, 34]),
|
|
1158
1158
|
{ 16: [1, 64] },
|
|
1159
1159
|
{ 16: [1, 65] },
|
|
1160
1160
|
{ 16: [1, 66] },
|
|
@@ -1229,7 +1229,7 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1229
1229
|
23: 113,
|
|
1230
1230
|
73: F
|
|
1231
1231
|
},
|
|
1232
|
-
|
|
1232
|
+
e([
|
|
1233
1233
|
5,
|
|
1234
1234
|
66,
|
|
1235
1235
|
72,
|
|
@@ -1261,45 +1261,45 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1261
1261
|
103,
|
|
1262
1262
|
104
|
|
1263
1263
|
], it),
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1264
|
+
e(I, [2, 6]),
|
|
1265
|
+
e(I, [2, 16]),
|
|
1266
|
+
e(K, [2, 10], { 11: 114 }),
|
|
1267
|
+
e(I, [2, 18]),
|
|
1268
1268
|
{
|
|
1269
1269
|
5: [1, 116],
|
|
1270
1270
|
20: [1, 115]
|
|
1271
1271
|
},
|
|
1272
1272
|
{ 5: [1, 117] },
|
|
1273
|
-
|
|
1273
|
+
e(I, [2, 22]),
|
|
1274
1274
|
{ 5: [1, 118] },
|
|
1275
1275
|
{ 5: [1, 119] },
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1276
|
+
e(I, [2, 25]),
|
|
1277
|
+
e(I, [2, 26]),
|
|
1278
|
+
e(I, [2, 27]),
|
|
1279
|
+
e(I, [2, 28]),
|
|
1280
|
+
e(I, [2, 29]),
|
|
1281
|
+
e(I, [2, 32]),
|
|
1282
|
+
e(I, [2, 33]),
|
|
1283
|
+
e(q, a, { 7: 120 }),
|
|
1284
|
+
e(q, a, { 7: 121 }),
|
|
1285
|
+
e(q, a, { 7: 122 }),
|
|
1286
|
+
e(at, a, {
|
|
1287
1287
|
41: 123,
|
|
1288
1288
|
7: 124
|
|
1289
1289
|
}),
|
|
1290
|
-
|
|
1290
|
+
e(J, a, {
|
|
1291
1291
|
43: 125,
|
|
1292
1292
|
7: 126
|
|
1293
1293
|
}),
|
|
1294
|
-
|
|
1294
|
+
e(J, a, {
|
|
1295
1295
|
7: 126,
|
|
1296
1296
|
43: 127
|
|
1297
1297
|
}),
|
|
1298
|
-
|
|
1298
|
+
e(ot, a, {
|
|
1299
1299
|
46: 128,
|
|
1300
1300
|
7: 129
|
|
1301
1301
|
}),
|
|
1302
|
-
|
|
1302
|
+
e(q, a, { 7: 130 }),
|
|
1303
1303
|
{
|
|
1304
1304
|
5: [1, 132],
|
|
1305
1305
|
52: [1, 131]
|
|
@@ -1308,7 +1308,7 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1308
1308
|
5: [1, 134],
|
|
1309
1309
|
52: [1, 133]
|
|
1310
1310
|
},
|
|
1311
|
-
|
|
1311
|
+
e(Y, it, {
|
|
1312
1312
|
74: 135,
|
|
1313
1313
|
75: [1, 136]
|
|
1314
1314
|
}),
|
|
@@ -1357,32 +1357,32 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1357
1357
|
102: nt,
|
|
1358
1358
|
103: rt
|
|
1359
1359
|
},
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1360
|
+
e(X, [2, 79]),
|
|
1361
|
+
e(X, [2, 80]),
|
|
1362
|
+
e(X, [2, 81]),
|
|
1363
|
+
e(X, [2, 82]),
|
|
1364
|
+
e(X, [2, 83]),
|
|
1365
|
+
e(X, [2, 84]),
|
|
1366
|
+
e(X, [2, 85]),
|
|
1367
|
+
e(X, [2, 86]),
|
|
1368
|
+
e(X, [2, 87]),
|
|
1369
|
+
e(X, [2, 88]),
|
|
1370
|
+
e(X, [2, 89]),
|
|
1371
|
+
e(X, [2, 90]),
|
|
1372
|
+
e(X, [2, 91]),
|
|
1373
|
+
e(X, [2, 92]),
|
|
1374
|
+
e(X, [2, 93]),
|
|
1375
|
+
e(X, [2, 94]),
|
|
1376
|
+
e(X, [2, 95]),
|
|
1377
|
+
e(X, [2, 96]),
|
|
1378
|
+
e(X, [2, 97]),
|
|
1379
|
+
e(X, [2, 98]),
|
|
1380
|
+
e(X, [2, 99]),
|
|
1381
|
+
e(X, [2, 100]),
|
|
1382
|
+
e(X, [2, 101]),
|
|
1383
|
+
e(X, [2, 102]),
|
|
1384
|
+
e(X, [2, 103]),
|
|
1385
|
+
e(X, [2, 104]),
|
|
1386
1386
|
{
|
|
1387
1387
|
23: 147,
|
|
1388
1388
|
73: F
|
|
@@ -1421,10 +1421,10 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1421
1421
|
54: k
|
|
1422
1422
|
},
|
|
1423
1423
|
{ 5: [1, 160] },
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1424
|
+
e(I, [2, 20]),
|
|
1425
|
+
e(I, [2, 21]),
|
|
1426
|
+
e(I, [2, 23]),
|
|
1427
|
+
e(I, [2, 24]),
|
|
1428
1428
|
{
|
|
1429
1429
|
4: o,
|
|
1430
1430
|
5: s,
|
|
@@ -1734,16 +1734,16 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1734
1734
|
73: F
|
|
1735
1735
|
},
|
|
1736
1736
|
{ 16: [1, 172] },
|
|
1737
|
-
|
|
1737
|
+
e(I, [2, 50]),
|
|
1738
1738
|
{ 16: [1, 173] },
|
|
1739
|
-
|
|
1740
|
-
|
|
1739
|
+
e(I, [2, 55]),
|
|
1740
|
+
e(Y, [2, 76]),
|
|
1741
1741
|
{ 76: [1, 174] },
|
|
1742
1742
|
{ 16: [1, 175] },
|
|
1743
|
-
|
|
1743
|
+
e(I, [2, 52]),
|
|
1744
1744
|
{ 16: [1, 176] },
|
|
1745
|
-
|
|
1746
|
-
|
|
1745
|
+
e(I, [2, 57]),
|
|
1746
|
+
e(I, [2, 53]),
|
|
1747
1747
|
{
|
|
1748
1748
|
23: 177,
|
|
1749
1749
|
73: F
|
|
@@ -1782,28 +1782,28 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1782
1782
|
{ 5: [2, 61] },
|
|
1783
1783
|
{ 5: [2, 62] },
|
|
1784
1784
|
{ 5: [2, 63] },
|
|
1785
|
-
|
|
1786
|
-
|
|
1785
|
+
e(I, [2, 17]),
|
|
1786
|
+
e(K, [2, 11]),
|
|
1787
1787
|
{
|
|
1788
1788
|
13: 186,
|
|
1789
1789
|
51: D,
|
|
1790
1790
|
53: O,
|
|
1791
1791
|
54: k
|
|
1792
1792
|
},
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1793
|
+
e(K, [2, 13]),
|
|
1794
|
+
e(K, [2, 14]),
|
|
1795
|
+
e(I, [2, 19]),
|
|
1796
|
+
e(I, [2, 35]),
|
|
1797
|
+
e(I, [2, 36]),
|
|
1798
|
+
e(I, [2, 37]),
|
|
1799
|
+
e(I, [2, 38]),
|
|
1800
1800
|
{ 16: [1, 187] },
|
|
1801
|
-
|
|
1801
|
+
e(I, [2, 39]),
|
|
1802
1802
|
{ 16: [1, 188] },
|
|
1803
|
-
|
|
1804
|
-
|
|
1803
|
+
e(I, [2, 40]),
|
|
1804
|
+
e(I, [2, 41]),
|
|
1805
1805
|
{ 16: [1, 189] },
|
|
1806
|
-
|
|
1806
|
+
e(I, [2, 42]),
|
|
1807
1807
|
{ 5: [1, 190] },
|
|
1808
1808
|
{ 5: [1, 191] },
|
|
1809
1809
|
{ 77: [1, 192] },
|
|
@@ -1836,24 +1836,24 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1836
1836
|
23: 200,
|
|
1837
1837
|
73: F
|
|
1838
1838
|
},
|
|
1839
|
-
|
|
1840
|
-
|
|
1839
|
+
e(K, [2, 12]),
|
|
1840
|
+
e(at, a, {
|
|
1841
1841
|
7: 124,
|
|
1842
1842
|
41: 201
|
|
1843
1843
|
}),
|
|
1844
|
-
|
|
1844
|
+
e(J, a, {
|
|
1845
1845
|
7: 126,
|
|
1846
1846
|
43: 202
|
|
1847
1847
|
}),
|
|
1848
|
-
|
|
1848
|
+
e(ot, a, {
|
|
1849
1849
|
7: 129,
|
|
1850
1850
|
46: 203
|
|
1851
1851
|
}),
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1852
|
+
e(I, [2, 49]),
|
|
1853
|
+
e(I, [2, 54]),
|
|
1854
|
+
e(Y, [2, 77]),
|
|
1855
|
+
e(I, [2, 51]),
|
|
1856
|
+
e(I, [2, 56]),
|
|
1857
1857
|
{ 5: [2, 70] },
|
|
1858
1858
|
{ 5: [2, 71] },
|
|
1859
1859
|
{ 5: [2, 72] },
|
|
@@ -1898,10 +1898,10 @@ var import_dist = require_dist(), parser = (function() {
|
|
|
1898
1898
|
throw n.hash = t, n;
|
|
1899
1899
|
}
|
|
1900
1900
|
}, "parseError"),
|
|
1901
|
-
parse: /* @__PURE__ */ __name(function(
|
|
1901
|
+
parse: /* @__PURE__ */ __name(function(e) {
|
|
1902
1902
|
var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
|
|
1903
1903
|
for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
|
|
1904
|
-
h.setInput(
|
|
1904
|
+
h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
|
|
1905
1905
|
var v = h.yylloc;
|
|
1906
1906
|
o.push(v);
|
|
1907
1907
|
var y = h.options && h.options.ranges;
|
|
@@ -2664,7 +2664,7 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
2664
2664
|
this.state.reset(), clear();
|
|
2665
2665
|
}
|
|
2666
2666
|
parseMessage(e) {
|
|
2667
|
-
let
|
|
2667
|
+
let t = e.trim(), { wrap: r, cleanedText: i } = this.extractWrap(t), a = {
|
|
2668
2668
|
text: i,
|
|
2669
2669
|
wrap: r
|
|
2670
2670
|
};
|
|
@@ -2701,24 +2701,24 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
2701
2701
|
placement: t
|
|
2702
2702
|
});
|
|
2703
2703
|
}
|
|
2704
|
-
addLinks(e,
|
|
2704
|
+
addLinks(e, t) {
|
|
2705
2705
|
let r = this.getActor(e);
|
|
2706
2706
|
try {
|
|
2707
|
-
let e = sanitizeText(
|
|
2707
|
+
let e = sanitizeText(t.text, getConfig2());
|
|
2708
2708
|
e = e.replace(/=/g, "="), e = e.replace(/&/g, "&");
|
|
2709
|
-
let
|
|
2710
|
-
this.insertLinks(r,
|
|
2709
|
+
let n = JSON.parse(e);
|
|
2710
|
+
this.insertLinks(r, n);
|
|
2711
2711
|
} catch (e) {
|
|
2712
2712
|
log.error("error while parsing actor link text", e);
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
addALink(e,
|
|
2715
|
+
addALink(e, t) {
|
|
2716
2716
|
let r = this.getActor(e);
|
|
2717
2717
|
try {
|
|
2718
|
-
let e = {},
|
|
2719
|
-
|
|
2720
|
-
let a =
|
|
2721
|
-
e[a] =
|
|
2718
|
+
let e = {}, n = sanitizeText(t.text, getConfig2()), i = n.indexOf("@");
|
|
2719
|
+
n = n.replace(/=/g, "="), n = n.replace(/&/g, "&");
|
|
2720
|
+
let a = n.slice(0, i - 1).trim();
|
|
2721
|
+
e[a] = n.slice(i + 1).trim(), this.insertLinks(r, e);
|
|
2722
2722
|
} catch (e) {
|
|
2723
2723
|
log.error("error while parsing actor link text", e);
|
|
2724
2724
|
}
|
|
@@ -2727,11 +2727,11 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
2727
2727
|
if (e.links == null) e.links = t;
|
|
2728
2728
|
else for (let n in t) e.links[n] = t[n];
|
|
2729
2729
|
}
|
|
2730
|
-
addProperties(e,
|
|
2730
|
+
addProperties(e, t) {
|
|
2731
2731
|
let r = this.getActor(e);
|
|
2732
2732
|
try {
|
|
2733
|
-
let e = sanitizeText(
|
|
2734
|
-
this.insertProperties(r,
|
|
2733
|
+
let e = sanitizeText(t.text, getConfig2()), n = JSON.parse(e);
|
|
2734
|
+
this.insertProperties(r, n);
|
|
2735
2735
|
} catch (e) {
|
|
2736
2736
|
log.error("error while parsing actor properties text", e);
|
|
2737
2737
|
}
|
|
@@ -2743,8 +2743,8 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
2743
2743
|
boxEnd() {
|
|
2744
2744
|
this.state.records.currentBox = void 0;
|
|
2745
2745
|
}
|
|
2746
|
-
addDetails(e,
|
|
2747
|
-
let r = this.getActor(e), i = document.getElementById(
|
|
2746
|
+
addDetails(e, t) {
|
|
2747
|
+
let r = this.getActor(e), i = document.getElementById(t.text);
|
|
2748
2748
|
try {
|
|
2749
2749
|
let e = i.innerHTML, t = JSON.parse(e);
|
|
2750
2750
|
t.properties && this.insertProperties(r, t.properties), t.links && this.insertLinks(r, t.links);
|
|
@@ -3073,8 +3073,8 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3073
3073
|
r.attr("x", Math.round(e + Math.abs(e - i) / 2 - a.width / 2)), t.class === "loopText" ? r.attr("y", Math.round(o)) : r.attr("y", Math.round(o - a.height));
|
|
3074
3074
|
}
|
|
3075
3075
|
return [r];
|
|
3076
|
-
}, "drawKatex"), drawText = /* @__PURE__ */ __name(function(
|
|
3077
|
-
let r = 0, i = 0,
|
|
3076
|
+
}, "drawKatex"), drawText = /* @__PURE__ */ __name(function(e, n) {
|
|
3077
|
+
let r = 0, i = 0, a = n.text.split(common_default.lineBreakRegex), [s, c] = parseFontSize(n.fontSize), l = [], u = 0, d = /* @__PURE__ */ __name(() => n.y, "yfunc");
|
|
3078
3078
|
if (n.valign !== void 0 && n.textMargin !== void 0 && n.textMargin > 0) switch (n.valign) {
|
|
3079
3079
|
case "top":
|
|
3080
3080
|
case "start":
|
|
@@ -3103,34 +3103,34 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3103
3103
|
n.x = Math.round(n.x + n.width - n.textMargin), n.anchor = "end", n.dominantBaseline = "middle", n.alignmentBaseline = "middle";
|
|
3104
3104
|
break;
|
|
3105
3105
|
}
|
|
3106
|
-
for (let [
|
|
3107
|
-
n.textMargin !== void 0 && n.textMargin === 0 && s !== void 0 && (u =
|
|
3108
|
-
let
|
|
3109
|
-
|
|
3110
|
-
let f =
|
|
3106
|
+
for (let [t, o] of a.entries()) {
|
|
3107
|
+
n.textMargin !== void 0 && n.textMargin === 0 && s !== void 0 && (u = t * s);
|
|
3108
|
+
let a = e.append("text");
|
|
3109
|
+
a.attr("x", n.x), a.attr("y", d()), n.anchor !== void 0 && a.attr("text-anchor", n.anchor).attr("dominant-baseline", n.dominantBaseline).attr("alignment-baseline", n.alignmentBaseline), n.fontFamily !== void 0 && a.style("font-family", n.fontFamily), c !== void 0 && a.style("font-size", c), n.fontWeight !== void 0 && a.style("font-weight", n.fontWeight), n.fill !== void 0 && a.attr("fill", n.fill), n.class !== void 0 && a.attr("class", n.class), n.dy === void 0 ? u !== 0 && a.attr("dy", u) : a.attr("dy", n.dy);
|
|
3110
|
+
let f = o || "";
|
|
3111
3111
|
if (n.tspan) {
|
|
3112
|
-
let e =
|
|
3112
|
+
let e = a.append("tspan");
|
|
3113
3113
|
e.attr("x", n.x), n.fill !== void 0 && e.attr("fill", n.fill), e.text(f);
|
|
3114
|
-
} else
|
|
3115
|
-
n.valign !== void 0 && n.textMargin !== void 0 && n.textMargin > 0 && (i += (
|
|
3114
|
+
} else a.text(f);
|
|
3115
|
+
n.valign !== void 0 && n.textMargin !== void 0 && n.textMargin > 0 && (i += (a._groups || a)[0][0].getBBox().height, r = i), l.push(a);
|
|
3116
3116
|
}
|
|
3117
3117
|
return l;
|
|
3118
|
-
}, "drawText"), drawLabel = /* @__PURE__ */ __name(function(
|
|
3118
|
+
}, "drawText"), drawLabel = /* @__PURE__ */ __name(function(e, n) {
|
|
3119
3119
|
function r(e, t, n, r, i) {
|
|
3120
3120
|
return e + "," + t + " " + (e + n) + "," + t + " " + (e + n) + "," + (t + r - i) + " " + (e + n - i * 1.2) + "," + (t + r) + " " + e + "," + (t + r);
|
|
3121
3121
|
}
|
|
3122
3122
|
__name(r, "genPoints");
|
|
3123
|
-
let i =
|
|
3124
|
-
return i.attr("points", r(n.x, n.y, n.width, n.height, 7)), i.attr("class", "labelBox"), n.y += n.height / 2, drawText(
|
|
3123
|
+
let i = e.append("polygon");
|
|
3124
|
+
return i.attr("points", r(n.x, n.y, n.width, n.height, 7)), i.attr("class", "labelBox"), n.y += n.height / 2, drawText(e, n), i;
|
|
3125
3125
|
}, "drawLabel"), actorCnt = -1, fixLifeLineHeights = /* @__PURE__ */ __name((e, t, n, r) => {
|
|
3126
3126
|
e.select && n.forEach((n) => {
|
|
3127
3127
|
let i = t.get(n), a = e.select("#actor" + i.actorCnt);
|
|
3128
3128
|
!r.mirrorActors && i.stopy ? a.attr("y2", i.stopy + i.height / 2) : r.mirrorActors && a.attr("y2", i.stopy);
|
|
3129
3129
|
});
|
|
3130
3130
|
}, "fixLifeLineHeights"), drawActorTypeParticipant = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3131
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u,
|
|
3132
|
-
var h =
|
|
3133
|
-
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h =
|
|
3131
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, p = e.append("g").lower();
|
|
3132
|
+
var h = p;
|
|
3133
|
+
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h = p.append("g"), t.actorCnt = actorCnt, t.links != null && h.attr("id", "root-" + actorCnt), c === "neo" && h.attr("data-look", "neo"));
|
|
3134
3134
|
let g = getNoteRect();
|
|
3135
3135
|
var _ = "actor";
|
|
3136
3136
|
t.properties?.class ? _ = t.properties.class : g.fill = "#eaeaea", r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.x = t.x, g.y = a, g.width = t.width, g.height = t.height, g.class = _, g.rx = 3, g.ry = 3, g.name = t.name, c === "neo" && (g.rx = 6, g.ry = 6);
|
|
@@ -3147,9 +3147,9 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3147
3147
|
}
|
|
3148
3148
|
return b;
|
|
3149
3149
|
}, "drawActorTypeParticipant"), drawActorTypeCollections = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3150
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u,
|
|
3151
|
-
var h =
|
|
3152
|
-
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h =
|
|
3150
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, p = e.append("g").lower();
|
|
3151
|
+
var h = p;
|
|
3152
|
+
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h = p.append("g"), t.actorCnt = actorCnt, t.links != null && h.attr("id", "root-" + actorCnt), c === "neo" && h.attr("data-look", "neo"));
|
|
3153
3153
|
let g = getNoteRect();
|
|
3154
3154
|
var _ = "actor";
|
|
3155
3155
|
t.properties?.class ? _ = t.properties.class : g.fill = "#eaeaea", r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.x = t.x, g.y = a, g.width = t.width, g.height = t.height, g.class = _, g.name = t.name;
|
|
@@ -3173,8 +3173,8 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3173
3173
|
}
|
|
3174
3174
|
return r || (h.attr("data-et", "participant"), h.attr("data-type", "collections"), h.attr("data-id", t.name)), S;
|
|
3175
3175
|
}, "drawActorTypeCollections"), drawActorTypeQueue = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3176
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u,
|
|
3177
|
-
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h =
|
|
3176
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, p = e.append("g").lower(), h = p;
|
|
3177
|
+
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h = p.append("g"), t.actorCnt = actorCnt, t.links != null && h.attr("id", "root-" + actorCnt), c === "neo" && h.attr("data-look", "neo"));
|
|
3178
3178
|
let g = getNoteRect(), _ = "actor";
|
|
3179
3179
|
t.properties?.class ? _ = t.properties.class : g.fill = "#eaeaea", r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, h.attr("class", _), g.x = t.x, g.y = a, g.width = t.width, g.height = t.height, g.name = t.name;
|
|
3180
3180
|
let v = g.height / 2, y = v / (2.5 + g.height / 50), b = h.append("g"), x = h.append("g"), S = `M ${g.x},${g.y + v}
|
|
@@ -3198,7 +3198,7 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
return r || (h.attr("data-et", "participant"), h.attr("data-type", "queue"), h.attr("data-id", t.name)), w;
|
|
3200
3200
|
}, "drawActorTypeQueue"), drawActorTypeControl = /* @__PURE__ */ __name(function(e, t, n, r, i, a) {
|
|
3201
|
-
let o = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = o + 75, { look: l, theme: u, themeVariables: d } = n, { bkgColorArray: f, borderColorArray:
|
|
3201
|
+
let o = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = o + 75, { look: l, theme: u, themeVariables: d } = n, { bkgColorArray: f, borderColorArray: p, actorBorder: h, actorBkg: g } = d, _ = e.append("g").lower();
|
|
3202
3202
|
r || (actorCnt++, _.append("line").attr("id", "actor" + actorCnt).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt);
|
|
3203
3203
|
let v = e.append("g"), y = ACTOR_MAN_FIGURE_CLASS;
|
|
3204
3204
|
r ? y += ` ${BOTTOM_ACTOR_CLASS}` : y += ` ${TOP_ACTOR_CLASS}`, v.attr("class", y), v.attr("name", t.name);
|
|
@@ -3207,18 +3207,18 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3207
3207
|
let x = t.x + t.width / 2, S = o + 32;
|
|
3208
3208
|
v.append("defs").append("marker").attr("id", i + "-filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").attr("stroke-width", 1.2).append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), v.append("circle").attr("cx", x).attr("cy", S).attr("r", 22).attr("filter", `${l === "neo" ? "url(#drop-shadow)" : ""}`), v.append("line").attr("marker-end", "url(#" + i + "-filled-head-control)").attr("transform", `translate(${x}, ${S - 22})`);
|
|
3209
3209
|
let C = a.get(t.name) ?? 0;
|
|
3210
|
-
return COLOR_THEMES.has(u) ? (v.style("stroke",
|
|
3210
|
+
return COLOR_THEMES.has(u) ? (v.style("stroke", p[C % p.length]), v.style("fill", f[C % p.length])) : (v.style("stroke", h), v.style("fill", g)), t.height = v.node().getBBox().height + 2 * (n?.sequence?.labelBoxHeight ?? 0), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, v, b.x, b.y + 22 + (r ? 5 : 12), b.width, b.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), r || (v.attr("data-et", "participant"), v.attr("data-type", "control"), v.attr("data-id", t.name)), t.height;
|
|
3211
3211
|
}, "drawActorTypeControl"), drawActorTypeEntity = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3212
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 75, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u,
|
|
3212
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 75, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, p = e.append("g").lower(), h = e.append("g"), g = "actor";
|
|
3213
3213
|
r ? g += ` ${BOTTOM_ACTOR_CLASS}` : g += ` ${TOP_ACTOR_CLASS}`, h.attr("class", g), h.attr("name", t.name);
|
|
3214
3214
|
let _ = getNoteRect();
|
|
3215
3215
|
_.x = t.x, _.y = a, _.fill = "#eaeaea", _.width = t.width, _.height = t.height, _.class = "actor";
|
|
3216
3216
|
let v = t.x + t.width / 2, y = a + (r ? 10 : 25);
|
|
3217
3217
|
h.append("circle").attr("cx", v).attr("cy", y).attr("r", 22).attr("width", t.width).attr("height", t.height), h.append("line").attr("x1", v - 22).attr("x2", v + 22).attr("y1", y + 22).attr("y2", y + 22).attr("stroke-width", 2), c === "neo" && h.attr("filter", "url(#drop-shadow)");
|
|
3218
3218
|
let b = i.get(t.name) ?? 0;
|
|
3219
|
-
return COLOR_THEMES.has(l) && (h.style("stroke", f[b % f.length]), h.style("fill", d[b % f.length])), t.height = h.node().getBBox().height + (n?.sequence?.labelBoxHeight ?? 0), r || (actorCnt++,
|
|
3219
|
+
return COLOR_THEMES.has(l) && (h.style("stroke", f[b % f.length]), h.style("fill", d[b % f.length])), t.height = h.node().getBBox().height + (n?.sequence?.labelBoxHeight ?? 0), r || (actorCnt++, p.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, h, _.x, _.y + (r ? 15 : 30), _.width, _.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), r ? h.attr("transform", "translate(0, 22)") : (h.attr("transform", `translate(0, ${22 / 2 - 5})`), h.attr("data-et", "participant"), h.attr("data-type", "entity"), h.attr("data-id", t.name)), t.height;
|
|
3220
3220
|
}, "drawActorTypeEntity"), drawActorTypeDatabase = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3221
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height + 2 * n.boxTextMargin, { theme: c, themeVariables: l, look: u } = n, { bkgColorArray: d, borderColorArray: f, actorBorder:
|
|
3221
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height + 2 * n.boxTextMargin, { theme: c, themeVariables: l, look: u } = n, { bkgColorArray: d, borderColorArray: f, actorBorder: p } = l, h = e.append("g").lower(), g = h;
|
|
3222
3222
|
r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), g = h.append("g"), t.actorCnt = actorCnt, t.links != null && g.attr("id", "root-" + actorCnt), u === "neo" && g.attr("data-look", "neo"));
|
|
3223
3223
|
let _ = getNoteRect(), v = "actor";
|
|
3224
3224
|
t.properties?.class ? v = t.properties.class : _.fill = "#eaeaea", r ? v += ` ${BOTTOM_ACTOR_CLASS}` : v += ` ${TOP_ACTOR_CLASS}`, _.x = t.x, _.y = a, _.width = t.width, _.height = t.height, _.class = v, _.name = t.name, _.x = t.x, _.y = a;
|
|
@@ -3234,20 +3234,20 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3234
3234
|
`;
|
|
3235
3235
|
C.append("path").attr("d", w), u === "neo" && C.attr("filter", "url(#drop-shadow)");
|
|
3236
3236
|
let T = i.get(t.name) ?? 0;
|
|
3237
|
-
COLOR_THEMES.has(c) ? (C.style("stroke", f[T % f.length]), C.style("fill", d[T % f.length])) : C.style("stroke",
|
|
3237
|
+
COLOR_THEMES.has(c) ? (C.style("stroke", f[T % f.length]), C.style("fill", d[T % f.length])) : C.style("stroke", p), C.attr("transform", `translate(${y}, ${S})`), t.rectData = _, _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, g, _.x, _.y + 35, _.width, _.height, { class: `actor ${ACTOR_BOX_CLASS}` }, n);
|
|
3238
3238
|
let E = C.select("path:last-child");
|
|
3239
3239
|
return E.node() && (t.height = E.node().getBBox().height + (n.sequence.labelBoxHeight ?? 0)), r || (g.attr("data-et", "participant"), g.attr("data-type", "database"), g.attr("data-id", t.name)), t.height;
|
|
3240
3240
|
}, "drawActorTypeDatabase"), drawActorTypeBoundary = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3241
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 80, c = e.append("g").lower(), { look: l, theme: u, themeVariables: d } = n, { bkgColorArray: f, borderColorArray:
|
|
3241
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 80, c = e.append("g").lower(), { look: l, theme: u, themeVariables: d } = n, { bkgColorArray: f, borderColorArray: p, actorBorder: h } = d;
|
|
3242
3242
|
r || (actorCnt++, c.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt);
|
|
3243
3243
|
let g = e.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
|
|
3244
3244
|
r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", t.name);
|
|
3245
3245
|
let v = getNoteRect();
|
|
3246
3246
|
v.x = t.x, v.y = a, v.fill = "#eaeaea", v.width = t.width, v.height = t.height, v.class = "actor", g.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", t.x + t.width / 2 - 22 * 2.5).attr("y1", a + 12).attr("x2", t.x + t.width / 2 - 15).attr("y2", a + 12), g.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", t.x + t.width / 2 - 22 * 2.5).attr("y1", a + 2).attr("x2", t.x + t.width / 2 - 22 * 2.5).attr("y2", a + 22), g.append("circle").attr("cx", t.x + t.width / 2).attr("cy", a + 12).attr("r", 22), l === "neo" && g.attr("filter", "url(#drop-shadow)");
|
|
3247
3247
|
let y = i.get(t.name) ?? 0;
|
|
3248
|
-
return COLOR_THEMES.has(u) ? (g.style("stroke",
|
|
3248
|
+
return COLOR_THEMES.has(u) ? (g.style("stroke", p[y % p.length]), g.style("fill", f[y % p.length])) : g.style("stroke", h), t.height = g.node().getBBox().height + (n.sequence.labelBoxHeight ?? 0), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, g, v.x, v.y + 15, v.width, v.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), g.attr("transform", "translate(0,21)"), r || (g.attr("data-et", "participant"), g.attr("data-type", "boundary"), g.attr("data-id", t.name)), t.height;
|
|
3249
3249
|
}, "drawActorTypeBoundary"), drawActorTypeActor = /* @__PURE__ */ __name(function(e, t, n, r, i) {
|
|
3250
|
-
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 80, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f, actorBorder:
|
|
3250
|
+
let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 80, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f, actorBorder: p } = u, h = e.append("g").lower();
|
|
3251
3251
|
r || (actorCnt++, h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt);
|
|
3252
3252
|
let g = e.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
|
|
3253
3253
|
r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", t.name), r || g.attr("data-et", "participant").attr("data-type", "actor").attr("data-id", t.name);
|
|
@@ -3258,7 +3258,7 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3258
3258
|
let x = getNoteRect();
|
|
3259
3259
|
x.x = t.x, x.y = y, x.fill = "#eaeaea", x.width = t.width, x.height = t.height / v, x.class = "actor", x.rx = 3, x.ry = 3;
|
|
3260
3260
|
let S = i.get(t.name) ?? 0;
|
|
3261
|
-
return COLOR_THEMES.has(l) ? (g.style("stroke", f[S % f.length]), g.style("fill", d[S % f.length])) : g.style("stroke",
|
|
3261
|
+
return COLOR_THEMES.has(l) ? (g.style("stroke", f[S % f.length]), g.style("fill", d[S % f.length])) : g.style("stroke", p), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, g, x.x, y + 35 * v - (c === "neo" ? 10 : 0), x.width, x.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), t.height;
|
|
3262
3262
|
}, "drawActorTypeActor"), drawActor = /* @__PURE__ */ __name(async function(e, t, n, r, i, a, o) {
|
|
3263
3263
|
let s = o ?? new Map([...a.db.getActors().values()].map((e, t) => [e.name, t]));
|
|
3264
3264
|
switch (t.type) {
|
|
@@ -3281,24 +3281,24 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3281
3281
|
f.x = t.startx, f.y = t.starty, f.class = "activation" + i % 3, f.width = t.stopx - t.startx, f.height = n - t.starty;
|
|
3282
3282
|
let h = drawRect2(p, f), g = (o ?? new Map([...a.db.getActors().values()].map((e, t) => [e.name, t]))).get(m) ?? 0;
|
|
3283
3283
|
COLOR_THEMES.has(s) && (h.style("stroke", u[g % u.length]), h.style("fill", l[g % u.length] ?? d));
|
|
3284
|
-
}, "drawActivation"), drawLoop = /* @__PURE__ */ __name(async function(
|
|
3285
|
-
let { boxMargin: o, boxTextMargin: s, labelBoxHeight: c, labelBoxWidth: l, messageFontFamily: u, messageFontSize: d, messageFontWeight: f } = i,
|
|
3286
|
-
return
|
|
3284
|
+
}, "drawActivation"), drawLoop = /* @__PURE__ */ __name(async function(e, n, r, i, a) {
|
|
3285
|
+
let { boxMargin: o, boxTextMargin: s, labelBoxHeight: c, labelBoxWidth: l, messageFontFamily: u, messageFontSize: d, messageFontWeight: f } = i, p = e.append("g").attr("data-et", "control-structure").attr("data-id", "i" + a.id), h = /* @__PURE__ */ __name(function(e, t, n, r) {
|
|
3286
|
+
return p.append("line").attr("x1", e).attr("y1", t).attr("x2", n).attr("y2", r).attr("class", "loopLine");
|
|
3287
3287
|
}, "drawLoopLine");
|
|
3288
3288
|
h(n.startx, n.starty, n.stopx, n.starty), h(n.stopx, n.starty, n.stopx, n.stopy), h(n.startx, n.stopy, n.stopx, n.stopy), h(n.startx, n.starty, n.startx, n.stopy), n.sections !== void 0 && n.sections.forEach(function(e) {
|
|
3289
3289
|
h(n.startx, e.y, n.stopx, e.y).style("stroke-dasharray", "3, 3");
|
|
3290
3290
|
});
|
|
3291
3291
|
let g = getTextObj();
|
|
3292
|
-
g.text = r, g.x = n.startx, g.y = n.starty, g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = Math.max(l ?? 0, 50), g.height = c + (i.look === "neo" ? 15 : 0) || 20, g.textMargin = s, g.class = "labelText", drawLabel(
|
|
3293
|
-
let _ = hasKatex(g.text) ? await drawKatex(
|
|
3292
|
+
g.text = r, g.x = n.startx, g.y = n.starty, g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = Math.max(l ?? 0, 50), g.height = c + (i.look === "neo" ? 15 : 0) || 20, g.textMargin = s, g.class = "labelText", drawLabel(p, g), g = getTextObj2(), g.text = n.title, g.x = n.startx + l / 2 + (n.stopx - n.startx) / 2, g.y = n.starty + o + s, g.anchor = "middle", g.valign = "middle", g.textMargin = s, g.class = "loopText", g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.wrap = !0;
|
|
3293
|
+
let _ = hasKatex(g.text) ? await drawKatex(p, g, n) : drawText(p, g);
|
|
3294
3294
|
if (n.sectionTitles !== void 0) {
|
|
3295
3295
|
for (let [e, t] of Object.entries(n.sectionTitles)) if (t.message) {
|
|
3296
|
-
g.text = t.message, g.x = n.startx + (n.stopx - n.startx) / 2, g.y = n.sections[e].y + o + s, g.class = "sectionTitle", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.wrap = n.wrap, hasKatex(g.text) ? (n.starty = n.sections[e].y, await drawKatex(
|
|
3296
|
+
g.text = t.message, g.x = n.startx + (n.stopx - n.startx) / 2, g.y = n.sections[e].y + o + s, g.class = "sectionTitle", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.wrap = n.wrap, hasKatex(g.text) ? (n.starty = n.sections[e].y, await drawKatex(p, g, n)) : drawText(p, g);
|
|
3297
3297
|
let r = Math.round(_.map((e) => (e._groups || e)[0][0].getBBox().height).reduce((e, t) => e + t));
|
|
3298
3298
|
n.sections[e].height += r - (o + s);
|
|
3299
3299
|
}
|
|
3300
3300
|
}
|
|
3301
|
-
return n.height = Math.round(n.stopy - n.starty),
|
|
3301
|
+
return n.height = Math.round(n.stopy - n.starty), p;
|
|
3302
3302
|
}, "drawLoop"), drawBackgroundRect2 = /* @__PURE__ */ __name(function(e, t) {
|
|
3303
3303
|
drawBackgroundRect(e, t);
|
|
3304
3304
|
}, "drawBackgroundRect"), insertDatabaseIcon = /* @__PURE__ */ __name(function(e, t) {
|
|
@@ -3346,40 +3346,40 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3346
3346
|
ry: 0
|
|
3347
3347
|
};
|
|
3348
3348
|
}, "getNoteRect"), _drawTextCandidateFunc = /* @__PURE__ */ (function() {
|
|
3349
|
-
function
|
|
3349
|
+
function e(e, t, n, r, i, a, o) {
|
|
3350
3350
|
s(t.append("text").attr("x", n + i / 2).attr("y", r + a / 2 + 5).style("text-anchor", "middle").text(e), o);
|
|
3351
3351
|
}
|
|
3352
|
-
__name(
|
|
3353
|
-
function n(e, t, n, r, i,
|
|
3352
|
+
__name(e, "byText");
|
|
3353
|
+
function n(e, t, n, r, i, a, c, l) {
|
|
3354
3354
|
let { actorFontSize: u, actorFontFamily: d, actorFontWeight: f } = l, [p, m] = parseFontSize(u), h = e.split(common_default.lineBreakRegex);
|
|
3355
3355
|
for (let e = 0; e < h.length; e++) {
|
|
3356
|
-
let
|
|
3357
|
-
l.append("tspan").attr("x", n + i / 2).attr("dy",
|
|
3356
|
+
let o = e * p - p * (h.length - 1) / 2, l = t.append("text").attr("x", n + i / 2).attr("y", r).style("text-anchor", "middle").style("font-size", m).style("font-weight", f).style("font-family", d);
|
|
3357
|
+
l.append("tspan").attr("x", n + i / 2).attr("dy", o).text(h[e]), l.attr("y", r + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(l, c);
|
|
3358
3358
|
}
|
|
3359
3359
|
}
|
|
3360
3360
|
__name(n, "byTspan");
|
|
3361
|
-
function
|
|
3361
|
+
function r(e, t, r, i, a, o, c, l) {
|
|
3362
3362
|
let u = t.append("switch"), d = u.append("foreignObject").attr("x", r).attr("y", i).attr("width", a).attr("height", o).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
3363
3363
|
d.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(e), n(e, u, r, i, a, o, c, l), s(d, c);
|
|
3364
3364
|
}
|
|
3365
|
-
__name(
|
|
3366
|
-
async function
|
|
3367
|
-
let f = await calculateMathMLDimensions(e, getConfig()), p = t.append("switch"),
|
|
3368
|
-
|
|
3365
|
+
__name(r, "byFo");
|
|
3366
|
+
async function a(e, t, r, a, o, c, l, d) {
|
|
3367
|
+
let f = await calculateMathMLDimensions(e, getConfig()), p = t.append("switch"), m = p.append("foreignObject").attr("x", r + o / 2 - f.width / 2).attr("y", a + c / 2 - f.height / 2).attr("width", f.width).attr("height", f.height).append("xhtml:div").style("height", "100%").style("width", "100%");
|
|
3368
|
+
m.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatexSanitized(e, getConfig())), n(e, p, r, a, o, c, l, d), s(m, l);
|
|
3369
3369
|
}
|
|
3370
|
-
__name(
|
|
3370
|
+
__name(a, "byKatex");
|
|
3371
3371
|
function s(e, t) {
|
|
3372
3372
|
for (let n in t) t.hasOwnProperty(n) && e.attr(n, t[n]);
|
|
3373
3373
|
}
|
|
3374
|
-
return __name(s, "_setTextAttrs"), function(
|
|
3375
|
-
return
|
|
3374
|
+
return __name(s, "_setTextAttrs"), function(t, i = !1) {
|
|
3375
|
+
return i ? a : t.textPlacement === "fo" ? r : t.textPlacement === "old" ? e : n;
|
|
3376
3376
|
};
|
|
3377
3377
|
})(), _drawMenuItemTextCandidateFunc = /* @__PURE__ */ (function() {
|
|
3378
|
-
function
|
|
3378
|
+
function e(e, t, n, r, a, o, s) {
|
|
3379
3379
|
i(t.append("text").attr("x", n).attr("y", r).style("text-anchor", "start").text(e), s);
|
|
3380
3380
|
}
|
|
3381
|
-
__name(
|
|
3382
|
-
function n(e, t, n, r,
|
|
3381
|
+
__name(e, "byText");
|
|
3382
|
+
function n(e, t, n, r, a, s, c, l) {
|
|
3383
3383
|
let { actorFontSize: u, actorFontFamily: d, actorFontWeight: f } = l, p = e.split(common_default.lineBreakRegex);
|
|
3384
3384
|
for (let e = 0; e < p.length; e++) {
|
|
3385
3385
|
let a = e * u - u * (p.length - 1) / 2, o = t.append("text").attr("x", n).attr("y", r).style("text-anchor", "start").style("font-size", u).style("font-weight", f).style("font-family", d);
|
|
@@ -3395,8 +3395,8 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3395
3395
|
function i(e, t) {
|
|
3396
3396
|
for (let n in t) t.hasOwnProperty(n) && e.attr(n, t[n]);
|
|
3397
3397
|
}
|
|
3398
|
-
return __name(i, "_setTextAttrs"), function(
|
|
3399
|
-
return
|
|
3398
|
+
return __name(i, "_setTextAttrs"), function(t) {
|
|
3399
|
+
return t.textPlacement === "fo" ? r : t.textPlacement === "old" ? e : n;
|
|
3400
3400
|
};
|
|
3401
3401
|
})(), svgDraw_default = {
|
|
3402
3402
|
drawRect: drawRect2,
|
|
@@ -3494,20 +3494,20 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3494
3494
|
updateVal: /* @__PURE__ */ __name(function(e, t, n, r) {
|
|
3495
3495
|
e[t] === void 0 ? e[t] = n : e[t] = r(n, e[t]);
|
|
3496
3496
|
}, "updateVal"),
|
|
3497
|
-
updateBounds: /* @__PURE__ */ __name(function(
|
|
3497
|
+
updateBounds: /* @__PURE__ */ __name(function(e, n, r, i) {
|
|
3498
3498
|
let a = this, o = 0;
|
|
3499
3499
|
function s(s) {
|
|
3500
|
-
return /* @__PURE__ */ __name(function(
|
|
3500
|
+
return /* @__PURE__ */ __name(function(t) {
|
|
3501
3501
|
o++;
|
|
3502
3502
|
let c = a.sequenceItems.length - o + 1;
|
|
3503
|
-
a.updateVal(
|
|
3503
|
+
a.updateVal(t, "starty", n - c * conf.boxMargin, Math.min), a.updateVal(t, "stopy", i + c * conf.boxMargin, Math.max), a.updateVal(bounds.data, "startx", e - c * conf.boxMargin, Math.min), a.updateVal(bounds.data, "stopx", r + c * conf.boxMargin, Math.max), s !== "activation" && (a.updateVal(t, "startx", e - c * conf.boxMargin, Math.min), a.updateVal(t, "stopx", r + c * conf.boxMargin, Math.max), a.updateVal(bounds.data, "starty", n - c * conf.boxMargin, Math.min), a.updateVal(bounds.data, "stopy", i + c * conf.boxMargin, Math.max));
|
|
3504
3504
|
}, "updateItemBounds");
|
|
3505
3505
|
}
|
|
3506
3506
|
__name(s, "updateFn"), this.sequenceItems.forEach(s()), this.activations.forEach(s("activation"));
|
|
3507
3507
|
}, "updateBounds"),
|
|
3508
3508
|
insert: /* @__PURE__ */ __name(function(e, t, n, r) {
|
|
3509
|
-
let i = common_default.getMin(e, n),
|
|
3510
|
-
this.updateVal(bounds.data, "startx", i, Math.min), this.updateVal(bounds.data, "starty", s, Math.min), this.updateVal(bounds.data, "stopx",
|
|
3509
|
+
let i = common_default.getMin(e, n), a = common_default.getMax(e, n), s = common_default.getMin(t, r), c = common_default.getMax(t, r);
|
|
3510
|
+
this.updateVal(bounds.data, "startx", i, Math.min), this.updateVal(bounds.data, "starty", s, Math.min), this.updateVal(bounds.data, "stopx", a, Math.max), this.updateVal(bounds.data, "stopy", c, Math.max), this.updateBounds(i, s, a, c);
|
|
3511
3511
|
}, "insert"),
|
|
3512
3512
|
newActivation: /* @__PURE__ */ __name(function(e, t, n) {
|
|
3513
3513
|
let r = n.get(e.from), i = actorActivations(e.from).length || 0, a = r.x + r.width / 2 + (i - 1) * conf.activationWidth / 2;
|
|
@@ -3591,8 +3591,8 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3591
3591
|
o.x = t.startx, o.y = t.starty, o.width = r.width, o.dy = "1em", o.text = t.message, o.class = "noteText", o.fontFamily = conf.noteFontFamily, o.fontSize = conf.noteFontSize, o.fontWeight = conf.noteFontWeight, o.anchor = conf.noteAlign, o.textMargin = conf.noteMargin, o.valign = "center";
|
|
3592
3592
|
let s = hasKatex(o.text) ? await drawKatex(i, o) : drawText(i, o), c = Math.round(s.map((e) => (e._groups || e)[0][0].getBBox().height).reduce((e, t) => e + t));
|
|
3593
3593
|
a.attr("height", c + 2 * conf.noteMargin), t.height += c + 2 * conf.noteMargin, bounds.bumpVerticalPos(c + 2 * conf.noteMargin), t.stopy = t.starty + c + 2 * conf.noteMargin, t.stopx = t.startx + r.width, bounds.insert(t.startx, t.starty, t.stopx, t.stopy), bounds.models.addNote(t);
|
|
3594
|
-
}, "drawNote"), drawCentralConnection = /* @__PURE__ */ __name(function(
|
|
3595
|
-
let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = isReverseArrowType(n, i), g =
|
|
3594
|
+
}, "drawNote"), drawCentralConnection = /* @__PURE__ */ __name(function(e, n, r, i, a, o, s) {
|
|
3595
|
+
let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = isReverseArrowType(n, i), g = e.append("g"), _ = 16.5, v = /* @__PURE__ */ __name((e, t) => {
|
|
3596
3596
|
let n = e ? _ : -_;
|
|
3597
3597
|
return t ? -n : n;
|
|
3598
3598
|
}, "getCircleOffset"), y = /* @__PURE__ */ __name((e) => {
|
|
@@ -3635,22 +3635,22 @@ var sequenceDiagram_default = parser, LINETYPE = {
|
|
|
3635
3635
|
}), "actorFont");
|
|
3636
3636
|
async function boundMessage(e, t) {
|
|
3637
3637
|
bounds.bumpVerticalPos(10);
|
|
3638
|
-
let { startx: n, stopx:
|
|
3638
|
+
let { startx: n, stopx: r, message: a } = t, s = common_default.splitBreaks(a).length, c = hasKatex(a), l = c ? await calculateMathMLDimensions(a, getConfig2()) : utils_default.calculateTextDimensions(a, messageFont(conf));
|
|
3639
3639
|
if (!c) {
|
|
3640
3640
|
let e = l.height / s;
|
|
3641
3641
|
t.height += e, bounds.bumpVerticalPos(e);
|
|
3642
3642
|
}
|
|
3643
|
-
let
|
|
3644
|
-
if (n ===
|
|
3645
|
-
|
|
3646
|
-
let e = common_default.getMax(
|
|
3647
|
-
bounds.insert(n - e, bounds.getVerticalPos() - 10 + f,
|
|
3648
|
-
} else f += conf.boxMargin,
|
|
3649
|
-
return bounds.bumpVerticalPos(f), t.height += f, t.stopy = t.starty + t.height, bounds.insert(t.fromBounds, t.starty, t.toBounds, t.stopy),
|
|
3643
|
+
let u, f = l.height - 10, p = l.width;
|
|
3644
|
+
if (n === r) {
|
|
3645
|
+
u = bounds.getVerticalPos() + f, conf.rightAngles || (f += conf.boxMargin, u = bounds.getVerticalPos() + f), f += 30;
|
|
3646
|
+
let e = common_default.getMax(p / 2, conf.width / 2);
|
|
3647
|
+
bounds.insert(n - e, bounds.getVerticalPos() - 10 + f, r + e, bounds.getVerticalPos() + 30 + f);
|
|
3648
|
+
} else f += conf.boxMargin, u = bounds.getVerticalPos() + f, bounds.insert(n, u - 10, r, u);
|
|
3649
|
+
return bounds.bumpVerticalPos(f), t.height += f, t.stopy = t.starty + t.height, bounds.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), u;
|
|
3650
3650
|
}
|
|
3651
3651
|
__name(boundMessage, "boundMessage");
|
|
3652
|
-
var drawMessage = /* @__PURE__ */ __name(async function(e, t, n, r, i,
|
|
3653
|
-
let { startx: s, stopx: c, starty: l, message: u, type: d, sequenceIndex:
|
|
3652
|
+
var drawMessage = /* @__PURE__ */ __name(async function(e, t, n, r, i, a) {
|
|
3653
|
+
let { startx: s, stopx: c, starty: l, message: u, type: d, sequenceIndex: f, sequenceVisible: h } = t, g = utils_default.calculateTextDimensions(u, messageFont(conf)), _ = getTextObj();
|
|
3654
3654
|
_.x = Math.min(s, c), _.y = l + 10, _.width = Math.abs(c - s), _.class = "messageText", _.dy = "1em", _.text = u, _.fontFamily = conf.messageFontFamily, _.fontSize = conf.messageFontSize, _.fontWeight = conf.messageFontWeight, _.anchor = conf.messageAlign, _.valign = "center", _.textMargin = conf.wrapPadding, _.tspan = !1, hasKatex(_.text) ? await drawKatex(e, _, {
|
|
3655
3655
|
startx: s,
|
|
3656
3656
|
stopx: c,
|
|
@@ -3658,40 +3658,40 @@ var drawMessage = /* @__PURE__ */ __name(async function(e, t, n, r, i, o) {
|
|
|
3658
3658
|
}) : drawText(e, _);
|
|
3659
3659
|
let v = g.width, y;
|
|
3660
3660
|
if (s === c) {
|
|
3661
|
-
let
|
|
3661
|
+
let a = h || conf.showSequenceNumbers, l = isReverseArrowType(i, r), u = isBidirectionalArrowType(i, r), d = s + (a && (l || u) ? 10 : 0);
|
|
3662
3662
|
y = conf.rightAngles ? e.append("path").attr("d", `M ${d},${n} H ${s + common_default.getMax(conf.width / 2, v / 2)} V ${n + 25} H ${s}`) : e.append("path").attr("d", "M " + d + "," + n + " C " + (d + 60) + "," + (n - 10) + " " + (s + 60) + "," + (n + 30) + " " + s + "," + (n + 20)), hasCentralConnection(i, r) && drawCentralConnection(e, i, t, r, s, c, n);
|
|
3663
3663
|
} else y = e.append("line"), y.attr("x1", s), y.attr("y1", n), y.attr("x2", c), y.attr("y2", n), hasCentralConnection(i, r) && drawCentralConnection(e, i, t, r, s, c, n);
|
|
3664
3664
|
d === r.db.LINETYPE.DOTTED || d === r.db.LINETYPE.DOTTED_CROSS || d === r.db.LINETYPE.DOTTED_POINT || d === r.db.LINETYPE.DOTTED_OPEN || d === r.db.LINETYPE.BIDIRECTIONAL_DOTTED || d === r.db.LINETYPE.SOLID_TOP_DOTTED || d === r.db.LINETYPE.SOLID_BOTTOM_DOTTED || d === r.db.LINETYPE.STICK_TOP_DOTTED || d === r.db.LINETYPE.STICK_BOTTOM_DOTTED || d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED ? (y.style("stroke-dasharray", "3, 3"), y.attr("class", "messageLine1")) : y.attr("class", "messageLine0"), y.attr("data-et", "message"), y.attr("data-id", "i" + t.id), y.attr("data-from", t.from), y.attr("data-to", t.to);
|
|
3665
3665
|
let b = "";
|
|
3666
|
-
if (conf.arrowMarkerAbsolute && (b = getUrl(!0)), y.attr("stroke-width", 2), y.attr("stroke", "none"), y.style("fill", "none"), (d === r.db.LINETYPE.SOLID_TOP || d === r.db.LINETYPE.SOLID_TOP_DOTTED) && y.attr("marker-end", "url(" + b + "#" +
|
|
3667
|
-
let
|
|
3668
|
-
|
|
3666
|
+
if (conf.arrowMarkerAbsolute && (b = getUrl(!0)), y.attr("stroke-width", 2), y.attr("stroke", "none"), y.style("fill", "none"), (d === r.db.LINETYPE.SOLID_TOP || d === r.db.LINETYPE.SOLID_TOP_DOTTED) && y.attr("marker-end", "url(" + b + "#" + a + "-solidTopArrowHead)"), (d === r.db.LINETYPE.SOLID_BOTTOM || d === r.db.LINETYPE.SOLID_BOTTOM_DOTTED) && y.attr("marker-end", "url(" + b + "#" + a + "-solidBottomArrowHead)"), (d === r.db.LINETYPE.STICK_TOP || d === r.db.LINETYPE.STICK_TOP_DOTTED) && y.attr("marker-end", "url(" + b + "#" + a + "-stickTopArrowHead)"), (d === r.db.LINETYPE.STICK_BOTTOM || d === r.db.LINETYPE.STICK_BOTTOM_DOTTED) && y.attr("marker-end", "url(" + b + "#" + a + "-stickBottomArrowHead)"), (d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + a + "-solidBottomArrowHead)"), (d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + a + "-solidTopArrowHead)"), (d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + a + "-stickBottomArrowHead)"), (d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + a + "-stickTopArrowHead)"), (d === r.db.LINETYPE.SOLID || d === r.db.LINETYPE.DOTTED) && y.attr("marker-end", "url(" + b + "#" + a + "-arrowhead)"), (d === r.db.LINETYPE.BIDIRECTIONAL_SOLID || d === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (y.attr("marker-start", "url(" + b + "#" + a + "-arrowhead)"), y.attr("marker-end", "url(" + b + "#" + a + "-arrowhead)")), (d === r.db.LINETYPE.SOLID_POINT || d === r.db.LINETYPE.DOTTED_POINT) && y.attr("marker-end", "url(" + b + "#" + a + "-filled-head)"), (d === r.db.LINETYPE.SOLID_CROSS || d === r.db.LINETYPE.DOTTED_CROSS) && y.attr("marker-end", "url(" + b + "#" + a + "-crosshead)"), h || conf.showSequenceNumbers) {
|
|
3667
|
+
let o = d === r.db.LINETYPE.BIDIRECTIONAL_SOLID || d === r.db.LINETYPE.BIDIRECTIONAL_DOTTED, l = d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED, u = hasCentralConnection(i, r), p = s, m = c;
|
|
3668
|
+
o ? (s < c ? p = s + 12 : (p = s - 6 + (u ? -5 : 0), p += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), y.attr("x1", p)) : l ? (c > s ? m = c - 12 : (m = c - 6, p += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), m += u ? 15 : 0, y.attr("x2", m), y.attr("x1", p)) : y.attr("x1", s + 6);
|
|
3669
3669
|
let h = 0, g = s === c, _ = s <= c;
|
|
3670
3670
|
h = g ? t.fromBounds + 1 : l ? _ ? t.toBounds - 1 : t.fromBounds + 1 : _ ? t.fromBounds + 1 : t.toBounds - 1;
|
|
3671
|
-
let v = "12px", x =
|
|
3672
|
-
x > 5 ? v = "7px" : x > 3 && (v = "9px"), e.append("line").attr("x1", h).attr("y1", n).attr("x2", h).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + b + "#" +
|
|
3671
|
+
let v = "12px", x = f.toString().length;
|
|
3672
|
+
x > 5 ? v = "7px" : x > 3 && (v = "9px"), e.append("line").attr("x1", h).attr("y1", n).attr("x2", h).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + b + "#" + a + "-sequencenumber)"), e.append("text").attr("x", h).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", v).attr("text-anchor", "middle").attr("class", "sequenceNumber").text(f);
|
|
3673
3673
|
}
|
|
3674
|
-
}, "drawMessage"), addActorRenderingData = /* @__PURE__ */ __name(function(e, t, n, r, i,
|
|
3674
|
+
}, "drawMessage"), addActorRenderingData = /* @__PURE__ */ __name(function(e, t, n, r, i, a, s) {
|
|
3675
3675
|
let c = 0, l = 0, u, d = 0;
|
|
3676
3676
|
for (let e of r) {
|
|
3677
|
-
let r = t.get(e),
|
|
3678
|
-
u && u !=
|
|
3677
|
+
let r = t.get(e), a = r.box;
|
|
3678
|
+
u && u != a && (s || bounds.models.addBox(u), l += conf.boxMargin + u.margin), a && a != u && (s || (a.x = c + l, a.y = i), l += a.margin), r.width = common_default.getMax(r.width || conf.width, conf.width), r.height = common_default.getMax(r.height || conf.height, conf.height), r.margin = r.margin || conf.actorMargin, d = common_default.getMax(d, r.height), n.get(r.name) && (l += r.width / 2), r.x = c + l, r.starty = bounds.getVerticalPos(), bounds.insert(r.x, i, r.x + r.width, r.height), c += r.width + l, r.box && (r.box.width = c + a.margin - r.box.x), l = r.margin, u = r.box, bounds.models.addActor(r);
|
|
3679
3679
|
}
|
|
3680
3680
|
u && !s && bounds.models.addBox(u), bounds.bumpVerticalPos(d);
|
|
3681
|
-
}, "addActorRenderingData"), drawActors = /* @__PURE__ */ __name(async function(e, t, n, r, i,
|
|
3681
|
+
}, "addActorRenderingData"), drawActors = /* @__PURE__ */ __name(async function(e, t, n, r, i, a, s) {
|
|
3682
3682
|
if (r) {
|
|
3683
3683
|
let r = 0;
|
|
3684
3684
|
bounds.bumpVerticalPos(conf.boxMargin * 2);
|
|
3685
3685
|
for (let c of n) {
|
|
3686
3686
|
let n = t.get(c);
|
|
3687
3687
|
n.stopy ||= bounds.getVerticalPos();
|
|
3688
|
-
let l = await svgDraw_default.drawActor(e, n, conf, !0, i,
|
|
3688
|
+
let l = await svgDraw_default.drawActor(e, n, conf, !0, i, a, s);
|
|
3689
3689
|
r = common_default.getMax(r, l);
|
|
3690
3690
|
}
|
|
3691
3691
|
bounds.bumpVerticalPos(r + conf.boxMargin);
|
|
3692
3692
|
} else for (let r of n) {
|
|
3693
3693
|
let n = t.get(r);
|
|
3694
|
-
await svgDraw_default.drawActor(e, n, conf, !1, i,
|
|
3694
|
+
await svgDraw_default.drawActor(e, n, conf, !1, i, a, s);
|
|
3695
3695
|
}
|
|
3696
3696
|
}, "drawActors"), drawActorsPopup = /* @__PURE__ */ __name(function(e, t, n, r) {
|
|
3697
3697
|
let i = 0, a = 0;
|
|
@@ -3717,25 +3717,25 @@ var drawMessage = /* @__PURE__ */ __name(async function(e, t, n, r, i, o) {
|
|
|
3717
3717
|
return common_default.getMax(e, t.stopx);
|
|
3718
3718
|
}, n.x + n.width / 2 + 1)];
|
|
3719
3719
|
}, "activationBounds");
|
|
3720
|
-
function adjustLoopHeightForWrap(e,
|
|
3720
|
+
function adjustLoopHeightForWrap(e, t, r, i, a) {
|
|
3721
3721
|
bounds.bumpVerticalPos(r);
|
|
3722
3722
|
let s = i;
|
|
3723
|
-
if (
|
|
3724
|
-
let r = e[
|
|
3725
|
-
|
|
3726
|
-
let c = utils_default.calculateTextDimensions(
|
|
3727
|
-
s = i + l, log.debug(`${l} - ${
|
|
3723
|
+
if (t.id && t.message && e[t.id]) {
|
|
3724
|
+
let r = e[t.id].width, a = messageFont(conf);
|
|
3725
|
+
t.message = utils_default.wrapLabel(`[${t.message}]`, r - 2 * conf.wrapPadding, a), t.width = r, t.wrap = !0;
|
|
3726
|
+
let c = utils_default.calculateTextDimensions(t.message, a), l = common_default.getMax(c.height, conf.labelBoxHeight);
|
|
3727
|
+
s = i + l, log.debug(`${l} - ${t.message}`);
|
|
3728
3728
|
}
|
|
3729
|
-
|
|
3729
|
+
a(t), bounds.bumpVerticalPos(s);
|
|
3730
3730
|
}
|
|
3731
3731
|
__name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap");
|
|
3732
|
-
function adjustCreatedDestroyedData(
|
|
3733
|
-
function c(
|
|
3734
|
-
|
|
3732
|
+
function adjustCreatedDestroyedData(e, n, r, i, a, o, s) {
|
|
3733
|
+
function c(t, r) {
|
|
3734
|
+
t.x < a.get(e.from).x ? (bounds.insert(n.stopx - r, n.starty, n.startx, n.stopy + t.height / 2 + conf.noteMargin), n.stopx += r) : (bounds.insert(n.startx, n.starty, n.stopx + r, n.stopy + t.height / 2 + conf.noteMargin), n.stopx -= r);
|
|
3735
3735
|
}
|
|
3736
3736
|
__name(c, "receiverAdjustment");
|
|
3737
|
-
function l(
|
|
3738
|
-
|
|
3737
|
+
function l(t, r) {
|
|
3738
|
+
t.x < a.get(e.to).x ? (bounds.insert(n.startx - r, n.starty, n.stopx, n.stopy + t.height / 2 + conf.noteMargin), n.startx += r) : (bounds.insert(n.stopx, n.starty, n.startx + r, n.stopy + t.height / 2 + conf.noteMargin), n.startx -= r);
|
|
3739
3739
|
}
|
|
3740
3740
|
__name(l, "senderAdjustment");
|
|
3741
3741
|
let u = [
|
|
@@ -3744,119 +3744,119 @@ function adjustCreatedDestroyedData(t, n, r, i, a, o, s) {
|
|
|
3744
3744
|
PARTICIPANT_TYPE.ENTITY,
|
|
3745
3745
|
PARTICIPANT_TYPE.DATABASE
|
|
3746
3746
|
];
|
|
3747
|
-
if (o.get(
|
|
3748
|
-
let
|
|
3749
|
-
c(
|
|
3750
|
-
} else if (s.get(
|
|
3751
|
-
let
|
|
3752
|
-
conf.mirrorActors && l(
|
|
3753
|
-
} else if (s.get(
|
|
3754
|
-
let
|
|
3755
|
-
conf.mirrorActors && c(
|
|
3747
|
+
if (o.get(e.to) == i) {
|
|
3748
|
+
let t = a.get(e.to);
|
|
3749
|
+
c(t, u.includes(t.type) ? ACTOR_TYPE_WIDTH / 2 + 3 : t.width / 2 + 3), t.starty = r - t.height / 2, bounds.bumpVerticalPos(t.height / 2);
|
|
3750
|
+
} else if (s.get(e.from) == i) {
|
|
3751
|
+
let t = a.get(e.from);
|
|
3752
|
+
conf.mirrorActors && l(t, u.includes(t.type) ? ACTOR_TYPE_WIDTH / 2 : t.width / 2), t.stopy = r - t.height / 2, bounds.bumpVerticalPos(t.height / 2);
|
|
3753
|
+
} else if (s.get(e.to) == i) {
|
|
3754
|
+
let t = a.get(e.to);
|
|
3755
|
+
conf.mirrorActors && c(t, u.includes(t.type) ? ACTOR_TYPE_WIDTH / 2 + 3 : t.width / 2 + 3), t.stopy = r - t.height / 2, bounds.bumpVerticalPos(t.height / 2);
|
|
3756
3756
|
}
|
|
3757
3757
|
}
|
|
3758
3758
|
__name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData");
|
|
3759
|
-
var draw = /* @__PURE__ */ __name(async function(
|
|
3760
|
-
let { securityLevel:
|
|
3761
|
-
conf =
|
|
3762
|
-
let
|
|
3763
|
-
|
|
3764
|
-
let
|
|
3765
|
-
bounds.init(), log.debug(
|
|
3766
|
-
let
|
|
3767
|
-
if (conf.height = await calculateActorMargins(
|
|
3759
|
+
var draw = /* @__PURE__ */ __name(async function(r, i, a, o) {
|
|
3760
|
+
let { securityLevel: c, sequence: l, look: u } = getConfig2();
|
|
3761
|
+
conf = l;
|
|
3762
|
+
let f;
|
|
3763
|
+
c === "sandbox" && (f = select_default("#i" + i));
|
|
3764
|
+
let p = select_default(c === "sandbox" ? f.nodes()[0].contentDocument.body : "body"), m = c === "sandbox" ? f.nodes()[0].contentDocument : document;
|
|
3765
|
+
bounds.init(), log.debug(o.db);
|
|
3766
|
+
let h = c === "sandbox" ? p.select(`[id="${i}"]`) : select_default(`[id="${i}"]`), g = o.db.getActors(), _ = o.db.getCreatedActors(), v = o.db.getDestroyedActors(), y = o.db.getBoxes(), b = o.db.getActorKeys(), x = o.db.getMessages(), S = o.db.getDiagramTitle(), C = o.db.hasAtLeastOneBox(), w = o.db.hasAtLeastOneBoxWithTitle(), T = await getMaxMessageWidthPerActor(g, x, o);
|
|
3767
|
+
if (conf.height = await calculateActorMargins(g, T, y), svgDraw_default.insertComputerIcon(h, i), svgDraw_default.insertDatabaseIcon(h, i), svgDraw_default.insertClockIcon(h, i), C && (bounds.bumpVerticalPos(conf.boxMargin), w && bounds.bumpVerticalPos(y[0].textMaxHeight)), conf.hideUnusedParticipants === !0) {
|
|
3768
3768
|
let e = /* @__PURE__ */ new Set();
|
|
3769
3769
|
x.forEach((t) => {
|
|
3770
3770
|
e.add(t.from), e.add(t.to);
|
|
3771
|
-
}),
|
|
3771
|
+
}), b = b.filter((t) => e.has(t));
|
|
3772
3772
|
}
|
|
3773
|
-
let E = new Map(
|
|
3774
|
-
addActorRenderingData(
|
|
3775
|
-
let D = await calculateLoopBounds(x,
|
|
3776
|
-
svgDraw_default.insertArrowHead(
|
|
3773
|
+
let E = new Map(b.map((e, t) => [g.get(e)?.name ?? e, t]));
|
|
3774
|
+
addActorRenderingData(h, g, _, b, 0, x, !1);
|
|
3775
|
+
let D = await calculateLoopBounds(x, g, T, o);
|
|
3776
|
+
svgDraw_default.insertArrowHead(h, i), svgDraw_default.insertArrowCrossHead(h, i), svgDraw_default.insertArrowFilledHead(h, i), svgDraw_default.insertSequenceNumber(h, i), svgDraw_default.insertSolidTopArrowHead(h, i), svgDraw_default.insertSolidBottomArrowHead(h, i), svgDraw_default.insertStickTopArrowHead(h, i), svgDraw_default.insertStickBottomArrowHead(h, i), u === "neo" && svgDraw_default.insertDropShadow(h, conf);
|
|
3777
3777
|
function O(e, t) {
|
|
3778
3778
|
let n = bounds.endActivation(e);
|
|
3779
|
-
n.starty + 18 > t && (n.starty = t - 6, t += 12), svgDraw_default.drawActivation(
|
|
3779
|
+
n.starty + 18 > t && (n.starty = t - 6, t += 12), svgDraw_default.drawActivation(h, n, t, conf, actorActivations(e.from).length, o, E), bounds.insert(n.startx, t - 10, n.stopx, t);
|
|
3780
3780
|
}
|
|
3781
3781
|
__name(O, "activeEnd");
|
|
3782
3782
|
let k = 1, A = 1, j = [], M = [], N = 0;
|
|
3783
3783
|
for (let e of x) {
|
|
3784
|
-
let
|
|
3784
|
+
let t, r, i;
|
|
3785
3785
|
switch (e.type) {
|
|
3786
|
-
case
|
|
3787
|
-
bounds.resetVerticalPos(), r = e.noteModel, await drawNote(
|
|
3786
|
+
case o.db.LINETYPE.NOTE:
|
|
3787
|
+
bounds.resetVerticalPos(), r = e.noteModel, await drawNote(h, r, e.id);
|
|
3788
3788
|
break;
|
|
3789
|
-
case
|
|
3790
|
-
bounds.newActivation(e,
|
|
3789
|
+
case o.db.LINETYPE.ACTIVE_START:
|
|
3790
|
+
bounds.newActivation(e, h, g);
|
|
3791
3791
|
break;
|
|
3792
|
-
case
|
|
3793
|
-
bounds.newActivation(e,
|
|
3792
|
+
case o.db.LINETYPE.CENTRAL_CONNECTION:
|
|
3793
|
+
bounds.newActivation(e, h, g);
|
|
3794
3794
|
break;
|
|
3795
|
-
case
|
|
3796
|
-
bounds.newActivation(e,
|
|
3795
|
+
case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:
|
|
3796
|
+
bounds.newActivation(e, h, g);
|
|
3797
3797
|
break;
|
|
3798
|
-
case
|
|
3798
|
+
case o.db.LINETYPE.ACTIVE_END:
|
|
3799
3799
|
O(e, bounds.getVerticalPos());
|
|
3800
3800
|
break;
|
|
3801
|
-
case
|
|
3801
|
+
case o.db.LINETYPE.LOOP_START:
|
|
3802
3802
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
|
|
3803
3803
|
break;
|
|
3804
|
-
case
|
|
3805
|
-
|
|
3804
|
+
case o.db.LINETYPE.LOOP_END:
|
|
3805
|
+
t = bounds.endLoop(), await svgDraw_default.drawLoop(h, t, "loop", conf, e), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos()), bounds.models.addLoop(t);
|
|
3806
3806
|
break;
|
|
3807
|
-
case
|
|
3807
|
+
case o.db.LINETYPE.RECT_START:
|
|
3808
3808
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin, (e) => bounds.newLoop(void 0, e.message));
|
|
3809
3809
|
break;
|
|
3810
|
-
case
|
|
3811
|
-
|
|
3810
|
+
case o.db.LINETYPE.RECT_END:
|
|
3811
|
+
t = bounds.endLoop(), M.push(t), bounds.models.addLoop(t), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos());
|
|
3812
3812
|
break;
|
|
3813
|
-
case
|
|
3813
|
+
case o.db.LINETYPE.OPT_START:
|
|
3814
3814
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
|
|
3815
3815
|
break;
|
|
3816
|
-
case
|
|
3817
|
-
|
|
3816
|
+
case o.db.LINETYPE.OPT_END:
|
|
3817
|
+
t = bounds.endLoop(), await svgDraw_default.drawLoop(h, t, "opt", conf, e), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos()), bounds.models.addLoop(t);
|
|
3818
3818
|
break;
|
|
3819
|
-
case
|
|
3819
|
+
case o.db.LINETYPE.ALT_START:
|
|
3820
3820
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
|
|
3821
3821
|
break;
|
|
3822
|
-
case
|
|
3822
|
+
case o.db.LINETYPE.ALT_ELSE:
|
|
3823
3823
|
adjustLoopHeightForWrap(D, e, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (e) => bounds.addSectionToLoop(e));
|
|
3824
3824
|
break;
|
|
3825
|
-
case
|
|
3826
|
-
|
|
3825
|
+
case o.db.LINETYPE.ALT_END:
|
|
3826
|
+
t = bounds.endLoop(), await svgDraw_default.drawLoop(h, t, "alt", conf, e), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos()), bounds.models.addLoop(t);
|
|
3827
3827
|
break;
|
|
3828
|
-
case
|
|
3829
|
-
case
|
|
3828
|
+
case o.db.LINETYPE.PAR_START:
|
|
3829
|
+
case o.db.LINETYPE.PAR_OVER_START:
|
|
3830
3830
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e)), bounds.saveVerticalPos();
|
|
3831
3831
|
break;
|
|
3832
|
-
case
|
|
3832
|
+
case o.db.LINETYPE.PAR_AND:
|
|
3833
3833
|
adjustLoopHeightForWrap(D, e, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (e) => bounds.addSectionToLoop(e));
|
|
3834
3834
|
break;
|
|
3835
|
-
case
|
|
3836
|
-
|
|
3835
|
+
case o.db.LINETYPE.PAR_END:
|
|
3836
|
+
t = bounds.endLoop(), await svgDraw_default.drawLoop(h, t, "par", conf, e), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos()), bounds.models.addLoop(t);
|
|
3837
3837
|
break;
|
|
3838
|
-
case
|
|
3839
|
-
k = e.message.start || k, A = e.message.step || A, e.message.visible ?
|
|
3838
|
+
case o.db.LINETYPE.AUTONUMBER:
|
|
3839
|
+
k = e.message.start || k, A = e.message.step || A, e.message.visible ? o.db.enableSequenceNumbers() : o.db.disableSequenceNumbers();
|
|
3840
3840
|
break;
|
|
3841
|
-
case
|
|
3841
|
+
case o.db.LINETYPE.CRITICAL_START:
|
|
3842
3842
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
|
|
3843
3843
|
break;
|
|
3844
|
-
case
|
|
3844
|
+
case o.db.LINETYPE.CRITICAL_OPTION:
|
|
3845
3845
|
adjustLoopHeightForWrap(D, e, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (e) => bounds.addSectionToLoop(e));
|
|
3846
3846
|
break;
|
|
3847
|
-
case
|
|
3848
|
-
|
|
3847
|
+
case o.db.LINETYPE.CRITICAL_END:
|
|
3848
|
+
t = bounds.endLoop(), await svgDraw_default.drawLoop(h, t, "critical", conf, e), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos()), bounds.models.addLoop(t);
|
|
3849
3849
|
break;
|
|
3850
|
-
case
|
|
3850
|
+
case o.db.LINETYPE.BREAK_START:
|
|
3851
3851
|
adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
|
|
3852
3852
|
break;
|
|
3853
|
-
case
|
|
3854
|
-
|
|
3853
|
+
case o.db.LINETYPE.BREAK_END:
|
|
3854
|
+
t = bounds.endLoop(), await svgDraw_default.drawLoop(h, t, "break", conf, e), bounds.bumpVerticalPos(t.stopy - bounds.getVerticalPos()), bounds.models.addLoop(t);
|
|
3855
3855
|
break;
|
|
3856
3856
|
default: try {
|
|
3857
|
-
i = e.msgModel, i.starty = bounds.getVerticalPos(), i.sequenceIndex = k, i.sequenceVisible =
|
|
3858
|
-
let t = await boundMessage(
|
|
3859
|
-
adjustCreatedDestroyedData(e, i, t, N,
|
|
3857
|
+
i = e.msgModel, i.starty = bounds.getVerticalPos(), i.sequenceIndex = k, i.sequenceVisible = o.db.showSequenceNumbers(), i.id = e.id, i.from = e.from, i.to = e.to;
|
|
3858
|
+
let t = await boundMessage(h, i);
|
|
3859
|
+
adjustCreatedDestroyedData(e, i, t, N, g, _, v), j.push({
|
|
3860
3860
|
messageModel: i,
|
|
3861
3861
|
lineStartY: t,
|
|
3862
3862
|
msg: e
|
|
@@ -3866,44 +3866,44 @@ var draw = /* @__PURE__ */ __name(async function(n, r, i, a) {
|
|
|
3866
3866
|
}
|
|
3867
3867
|
}
|
|
3868
3868
|
[
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3869
|
+
o.db.LINETYPE.SOLID_OPEN,
|
|
3870
|
+
o.db.LINETYPE.DOTTED_OPEN,
|
|
3871
|
+
o.db.LINETYPE.SOLID,
|
|
3872
|
+
o.db.LINETYPE.SOLID_TOP,
|
|
3873
|
+
o.db.LINETYPE.SOLID_BOTTOM,
|
|
3874
|
+
o.db.LINETYPE.STICK_TOP,
|
|
3875
|
+
o.db.LINETYPE.STICK_BOTTOM,
|
|
3876
|
+
o.db.LINETYPE.SOLID_TOP_DOTTED,
|
|
3877
|
+
o.db.LINETYPE.SOLID_BOTTOM_DOTTED,
|
|
3878
|
+
o.db.LINETYPE.STICK_TOP_DOTTED,
|
|
3879
|
+
o.db.LINETYPE.STICK_BOTTOM_DOTTED,
|
|
3880
|
+
o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
|
|
3881
|
+
o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
|
|
3882
|
+
o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
|
|
3883
|
+
o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
|
|
3884
|
+
o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
|
|
3885
|
+
o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
|
|
3886
|
+
o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
|
|
3887
|
+
o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
|
|
3888
|
+
o.db.LINETYPE.DOTTED,
|
|
3889
|
+
o.db.LINETYPE.SOLID_CROSS,
|
|
3890
|
+
o.db.LINETYPE.DOTTED_CROSS,
|
|
3891
|
+
o.db.LINETYPE.SOLID_POINT,
|
|
3892
|
+
o.db.LINETYPE.DOTTED_POINT,
|
|
3893
|
+
o.db.LINETYPE.BIDIRECTIONAL_SOLID,
|
|
3894
|
+
o.db.LINETYPE.BIDIRECTIONAL_DOTTED
|
|
3895
3895
|
].includes(e.type) && (k = Math.round((k + A) * 100) / 100), N++;
|
|
3896
3896
|
}
|
|
3897
|
-
log.debug("createdActors",
|
|
3898
|
-
for (let e of j) await drawMessage(
|
|
3899
|
-
conf.mirrorActors && await drawActors(
|
|
3897
|
+
log.debug("createdActors", _), log.debug("destroyedActors", v), await drawActors(h, g, b, !1, i, o, E);
|
|
3898
|
+
for (let e of j) await drawMessage(h, e.messageModel, e.lineStartY, o, e.msg, i);
|
|
3899
|
+
conf.mirrorActors && await drawActors(h, g, b, !0, i, o, E), M.forEach((e) => svgDraw_default.drawBackgroundRect(h, e)), fixLifeLineHeights(h, g, b, conf);
|
|
3900
3900
|
for (let e of bounds.models.boxes) {
|
|
3901
3901
|
e.height = bounds.getVerticalPos() - e.y, bounds.insert(e.x, e.y, e.x + e.width, e.height);
|
|
3902
3902
|
let t = conf.boxMargin * 2;
|
|
3903
|
-
e.startx = e.x - t, e.starty = e.y - t * .25, e.stopx = e.startx + e.width + 2 * t, e.stopy = e.starty + e.height + t * .75, e.stroke = "rgb(0,0,0, 0.5)", svgDraw_default.drawBox(
|
|
3903
|
+
e.startx = e.x - t, e.starty = e.y - t * .25, e.stopx = e.startx + e.width + 2 * t, e.stopy = e.starty + e.height + t * .75, e.stroke = "rgb(0,0,0, 0.5)", svgDraw_default.drawBox(h, e, conf);
|
|
3904
3904
|
}
|
|
3905
3905
|
C && bounds.bumpVerticalPos(conf.boxMargin);
|
|
3906
|
-
let P = drawActorsPopup(
|
|
3906
|
+
let P = drawActorsPopup(h, g, b, m), { bounds: F } = bounds.getBounds();
|
|
3907
3907
|
F.startx === void 0 && (F.startx = 0), F.starty === void 0 && (F.starty = 0), F.stopx === void 0 && (F.stopx = 0), F.stopy === void 0 && (F.stopy = 0);
|
|
3908
3908
|
let I = F.stopy - F.starty;
|
|
3909
3909
|
I < P.maxHeight && (I = P.maxHeight);
|
|
@@ -3912,19 +3912,19 @@ var draw = /* @__PURE__ */ __name(async function(n, r, i, a) {
|
|
|
3912
3912
|
let R = F.stopx - F.startx;
|
|
3913
3913
|
R < P.maxWidth && (R = P.maxWidth);
|
|
3914
3914
|
let z = R + 2 * conf.diagramMarginX;
|
|
3915
|
-
S &&
|
|
3916
|
-
let B = S ? 40 : 0, V =
|
|
3917
|
-
|
|
3915
|
+
S && h.append("text").text(S).attr("x", (F.stopx - F.startx) / 2 - 2 * conf.diagramMarginX).attr("y", -25), configureSvgSize(h, L, z, conf.useMaxWidth);
|
|
3916
|
+
let B = S ? 40 : 0, V = g.size && u === "neo" ? 30 : 0;
|
|
3917
|
+
h.attr("viewBox", F.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + B) + " " + z + " " + (L + B + V)), log.debug("models:", bounds.models);
|
|
3918
3918
|
}, "draw");
|
|
3919
|
-
async function getMaxMessageWidthPerActor(e,
|
|
3920
|
-
let
|
|
3921
|
-
for (let
|
|
3922
|
-
let
|
|
3923
|
-
if (
|
|
3924
|
-
let s =
|
|
3925
|
-
c &&
|
|
3919
|
+
async function getMaxMessageWidthPerActor(e, t, r) {
|
|
3920
|
+
let a = {};
|
|
3921
|
+
for (let n of t) if (e.get(n.to) && e.get(n.from)) {
|
|
3922
|
+
let t = e.get(n.to);
|
|
3923
|
+
if (n.placement === r.db.PLACEMENT.LEFTOF && !t.prevActor || n.placement === r.db.PLACEMENT.RIGHTOF && !t.nextActor) continue;
|
|
3924
|
+
let s = n.placement !== void 0, c = !s, l = s ? noteFont(conf) : messageFont(conf), u = n.wrap ? utils_default.wrapLabel(n.message, conf.width - 2 * conf.wrapPadding, l) : n.message, f = (hasKatex(u) ? await calculateMathMLDimensions(n.message, getConfig2()) : utils_default.calculateTextDimensions(u, l)).width + 2 * conf.wrapPadding;
|
|
3925
|
+
c && n.from === t.nextActor ? a[n.to] = common_default.getMax(a[n.to] || 0, f) : c && n.from === t.prevActor ? a[n.from] = common_default.getMax(a[n.from] || 0, f) : c && n.from === n.to ? (a[n.from] = common_default.getMax(a[n.from] || 0, f / 2), a[n.to] = common_default.getMax(a[n.to] || 0, f / 2)) : n.placement === r.db.PLACEMENT.RIGHTOF ? a[n.from] = common_default.getMax(a[n.from] || 0, f) : n.placement === r.db.PLACEMENT.LEFTOF ? a[t.prevActor] = common_default.getMax(a[t.prevActor] || 0, f) : n.placement === r.db.PLACEMENT.OVER && (t.prevActor && (a[t.prevActor] = common_default.getMax(a[t.prevActor] || 0, f / 2)), t.nextActor && (a[n.from] = common_default.getMax(a[n.from] || 0, f / 2)));
|
|
3926
3926
|
}
|
|
3927
|
-
return log.debug("maxMessageWidthPerActor:",
|
|
3927
|
+
return log.debug("maxMessageWidthPerActor:", a), a;
|
|
3928
3928
|
}
|
|
3929
3929
|
__name(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor");
|
|
3930
3930
|
var getRequiredPopupWidth = /* @__PURE__ */ __name(function(e) {
|
|
@@ -3936,12 +3936,12 @@ var getRequiredPopupWidth = /* @__PURE__ */ __name(function(e) {
|
|
|
3936
3936
|
return t;
|
|
3937
3937
|
}, "getRequiredPopupWidth");
|
|
3938
3938
|
async function calculateActorMargins(e, t, n) {
|
|
3939
|
-
let
|
|
3939
|
+
let r = 0;
|
|
3940
3940
|
for (let t of e.keys()) {
|
|
3941
3941
|
let n = e.get(t);
|
|
3942
3942
|
n.wrap && (n.description = utils_default.wrapLabel(n.description, conf.width - 2 * conf.wrapPadding, actorFont(conf)));
|
|
3943
|
-
let
|
|
3944
|
-
n.width = n.wrap ? conf.width : common_default.getMax(conf.width,
|
|
3943
|
+
let a = hasKatex(n.description) ? await calculateMathMLDimensions(n.description, getConfig2()) : utils_default.calculateTextDimensions(n.description, actorFont(conf));
|
|
3944
|
+
n.width = n.wrap ? conf.width : common_default.getMax(conf.width, a.width + 2 * conf.wrapPadding), n.height = n.wrap ? common_default.getMax(a.height, conf.height) : conf.height, r = common_default.getMax(r, n.height);
|
|
3945
3945
|
}
|
|
3946
3946
|
for (let n in t) {
|
|
3947
3947
|
let r = e.get(n);
|
|
@@ -3952,34 +3952,34 @@ async function calculateActorMargins(e, t, n) {
|
|
|
3952
3952
|
r.margin = common_default.getMax(e, conf.actorMargin);
|
|
3953
3953
|
continue;
|
|
3954
3954
|
}
|
|
3955
|
-
let
|
|
3956
|
-
r.margin = common_default.getMax(
|
|
3955
|
+
let a = t[n] + conf.actorMargin - r.width / 2 - i.width / 2;
|
|
3956
|
+
r.margin = common_default.getMax(a, conf.actorMargin);
|
|
3957
3957
|
}
|
|
3958
|
-
let
|
|
3958
|
+
let a = 0;
|
|
3959
3959
|
return n.forEach((t) => {
|
|
3960
3960
|
let n = messageFont(conf), r = t.actorKeys.reduce((t, n) => t += e.get(n).width + (e.get(n).margin || 0), 0), i = conf.boxMargin * 8;
|
|
3961
3961
|
r += i, r -= 2 * conf.boxTextMargin, t.wrap && (t.name = utils_default.wrapLabel(t.name, r - 2 * conf.wrapPadding, n));
|
|
3962
3962
|
let s = utils_default.calculateTextDimensions(t.name, n);
|
|
3963
|
-
|
|
3963
|
+
a = common_default.getMax(s.height, a);
|
|
3964
3964
|
let c = common_default.getMax(r, s.width + 2 * conf.wrapPadding);
|
|
3965
3965
|
if (t.margin = conf.boxTextMargin, r < c) {
|
|
3966
3966
|
let e = (c - r) / 2;
|
|
3967
3967
|
t.margin += e;
|
|
3968
3968
|
}
|
|
3969
|
-
}), n.forEach((e) => e.textMaxHeight =
|
|
3969
|
+
}), n.forEach((e) => e.textMaxHeight = a), common_default.getMax(r, conf.height);
|
|
3970
3970
|
}
|
|
3971
3971
|
__name(calculateActorMargins, "calculateActorMargins");
|
|
3972
|
-
var buildNoteModel = /* @__PURE__ */ __name(async function(e,
|
|
3973
|
-
let
|
|
3974
|
-
width:
|
|
3972
|
+
var buildNoteModel = /* @__PURE__ */ __name(async function(e, t, r) {
|
|
3973
|
+
let a = t.get(e.from), s = t.get(e.to), c = a.x, l = s.x, u = e.wrap && e.message, f = hasKatex(e.message) ? await calculateMathMLDimensions(e.message, getConfig2()) : utils_default.calculateTextDimensions(u ? utils_default.wrapLabel(e.message, conf.width, noteFont(conf)) : e.message, noteFont(conf)), p = {
|
|
3974
|
+
width: u ? conf.width : common_default.getMax(conf.width, f.width + 2 * conf.noteMargin),
|
|
3975
3975
|
height: 0,
|
|
3976
|
-
startx:
|
|
3976
|
+
startx: a.x,
|
|
3977
3977
|
stopx: 0,
|
|
3978
3978
|
starty: 0,
|
|
3979
3979
|
stopy: 0,
|
|
3980
3980
|
message: e.message
|
|
3981
3981
|
};
|
|
3982
|
-
return e.placement ===
|
|
3982
|
+
return e.placement === r.db.PLACEMENT.RIGHTOF ? (p.width = u ? common_default.getMax(conf.width, f.width) : common_default.getMax(a.width / 2 + s.width / 2, f.width + 2 * conf.noteMargin), p.startx = c + (a.width + conf.actorMargin) / 2) : e.placement === r.db.PLACEMENT.LEFTOF ? (p.width = u ? common_default.getMax(conf.width, f.width + 2 * conf.noteMargin) : common_default.getMax(a.width / 2 + s.width / 2, f.width + 2 * conf.noteMargin), p.startx = c - p.width + (a.width - conf.actorMargin) / 2) : e.to === e.from ? (f = utils_default.calculateTextDimensions(u ? utils_default.wrapLabel(e.message, common_default.getMax(conf.width, a.width), noteFont(conf)) : e.message, noteFont(conf)), p.width = u ? common_default.getMax(conf.width, a.width) : common_default.getMax(a.width, conf.width, f.width + 2 * conf.noteMargin), p.startx = c + (a.width - p.width) / 2) : (p.width = Math.abs(c + a.width / 2 - (l + s.width / 2)) + conf.actorMargin, p.startx = c < l ? c + a.width / 2 - conf.actorMargin / 2 : l + s.width / 2 - conf.actorMargin / 2), u && (p.message = utils_default.wrapLabel(e.message, p.width - 2 * conf.wrapPadding, noteFont(conf))), log.debug(`NM:[${p.startx},${p.stopx},${p.starty},${p.stopy}:${p.width},${p.height}=${e.message}]`), p;
|
|
3983
3983
|
}, "buildNoteModel"), CENTRAL_CONNECTION_BASE_OFFSET = 4, CENTRAL_CONNECTION_BIDIRECTIONAL_OFFSET = 6, hasCentralConnection = /* @__PURE__ */ __name(function(e, t) {
|
|
3984
3984
|
let { CENTRAL_CONNECTION: n, CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i } = t.db.LINETYPE;
|
|
3985
3985
|
return [
|
|
@@ -4005,7 +4005,7 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4005
4005
|
}, "isReverseArrowType"), isBidirectionalArrowType = /* @__PURE__ */ __name(function(e, t) {
|
|
4006
4006
|
let { BIDIRECTIONAL_SOLID: n, BIDIRECTIONAL_DOTTED: r } = t.db.LINETYPE;
|
|
4007
4007
|
return [n, r].includes(e.type);
|
|
4008
|
-
}, "isBidirectionalArrowType"), buildMessageModel = /* @__PURE__ */ __name(function(
|
|
4008
|
+
}, "isBidirectionalArrowType"), buildMessageModel = /* @__PURE__ */ __name(function(e, n, r) {
|
|
4009
4009
|
let { look: i } = getConfig2();
|
|
4010
4010
|
if (![
|
|
4011
4011
|
r.db.LINETYPE.SOLID_OPEN,
|
|
@@ -4034,11 +4034,11 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4034
4034
|
r.db.LINETYPE.DOTTED_POINT,
|
|
4035
4035
|
r.db.LINETYPE.BIDIRECTIONAL_SOLID,
|
|
4036
4036
|
r.db.LINETYPE.BIDIRECTIONAL_DOTTED
|
|
4037
|
-
].includes(
|
|
4038
|
-
let [
|
|
4039
|
-
i === "neo" && (
|
|
4040
|
-
let m = Math.abs(c - l) > 2, h = /* @__PURE__ */ __name((e) =>
|
|
4041
|
-
|
|
4037
|
+
].includes(e.type)) return {};
|
|
4038
|
+
let [a, s] = activationBounds(e.from, n), [c, l] = activationBounds(e.to, n), u = a <= c, f = u ? s : a, p = u ? c : l;
|
|
4039
|
+
i === "neo" && (e.type !== r.db.LINETYPE.SOLID_OPEN && (p += u ? -3 : 3), (e.type === r.db.LINETYPE.BIDIRECTIONAL_SOLID || e.type === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (f += u ? 3 : -3)), f += calculateCentralConnectionOffset(e, r, u);
|
|
4040
|
+
let m = Math.abs(c - l) > 2, h = /* @__PURE__ */ __name((e) => u ? -e : e, "adjustValue");
|
|
4041
|
+
e.from === e.to ? p = f : (e.activate && !m && (p += h(conf.activationWidth / 2 - 1)), [
|
|
4042
4042
|
r.db.LINETYPE.SOLID_OPEN,
|
|
4043
4043
|
r.db.LINETYPE.DOTTED_OPEN,
|
|
4044
4044
|
r.db.LINETYPE.STICK_TOP,
|
|
@@ -4053,39 +4053,39 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4053
4053
|
r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
|
|
4054
4054
|
r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
|
|
4055
4055
|
r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
|
|
4056
|
-
].includes(
|
|
4056
|
+
].includes(e.type) || (p += h(3)), [
|
|
4057
4057
|
r.db.LINETYPE.BIDIRECTIONAL_SOLID,
|
|
4058
4058
|
r.db.LINETYPE.BIDIRECTIONAL_DOTTED,
|
|
4059
4059
|
r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
|
|
4060
4060
|
r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
|
|
4061
4061
|
r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
|
|
4062
4062
|
r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
|
|
4063
|
-
].includes(
|
|
4063
|
+
].includes(e.type) && (f -= h(3)));
|
|
4064
4064
|
let g = [
|
|
4065
|
-
|
|
4065
|
+
a,
|
|
4066
4066
|
s,
|
|
4067
4067
|
c,
|
|
4068
4068
|
l
|
|
4069
4069
|
], _ = Math.abs(f - p);
|
|
4070
|
-
|
|
4071
|
-
let v = utils_default.calculateTextDimensions(
|
|
4070
|
+
e.wrap && e.message && (e.message = utils_default.wrapLabel(e.message, common_default.getMax(_ + 2 * conf.wrapPadding, conf.width), messageFont(conf)));
|
|
4071
|
+
let v = utils_default.calculateTextDimensions(e.message, messageFont(conf));
|
|
4072
4072
|
return {
|
|
4073
|
-
width: common_default.getMax(
|
|
4073
|
+
width: common_default.getMax(e.wrap ? 0 : v.width + 2 * conf.wrapPadding, _ + 2 * conf.wrapPadding, conf.width),
|
|
4074
4074
|
height: 0,
|
|
4075
4075
|
startx: f,
|
|
4076
4076
|
stopx: p,
|
|
4077
4077
|
starty: 0,
|
|
4078
4078
|
stopy: 0,
|
|
4079
|
-
message:
|
|
4080
|
-
type:
|
|
4081
|
-
wrap:
|
|
4079
|
+
message: e.message,
|
|
4080
|
+
type: e.type,
|
|
4081
|
+
wrap: e.wrap,
|
|
4082
4082
|
fromBounds: Math.min.apply(null, g),
|
|
4083
4083
|
toBounds: Math.max.apply(null, g)
|
|
4084
4084
|
};
|
|
4085
|
-
}, "buildMessageModel"), calculateLoopBounds = /* @__PURE__ */ __name(async function(e,
|
|
4086
|
-
let
|
|
4087
|
-
for (let
|
|
4088
|
-
switch (
|
|
4085
|
+
}, "buildMessageModel"), calculateLoopBounds = /* @__PURE__ */ __name(async function(e, t, r, i) {
|
|
4086
|
+
let a = {}, s = [], c, l, u;
|
|
4087
|
+
for (let n of e) {
|
|
4088
|
+
switch (n.type) {
|
|
4089
4089
|
case i.db.LINETYPE.LOOP_START:
|
|
4090
4090
|
case i.db.LINETYPE.ALT_START:
|
|
4091
4091
|
case i.db.LINETYPE.OPT_START:
|
|
@@ -4094,8 +4094,8 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4094
4094
|
case i.db.LINETYPE.CRITICAL_START:
|
|
4095
4095
|
case i.db.LINETYPE.BREAK_START:
|
|
4096
4096
|
s.push({
|
|
4097
|
-
id:
|
|
4098
|
-
msg:
|
|
4097
|
+
id: n.id,
|
|
4098
|
+
msg: n.message,
|
|
4099
4099
|
from: 2 ** 53 - 1,
|
|
4100
4100
|
to: -(2 ** 53 - 1),
|
|
4101
4101
|
width: 0
|
|
@@ -4104,7 +4104,7 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4104
4104
|
case i.db.LINETYPE.ALT_ELSE:
|
|
4105
4105
|
case i.db.LINETYPE.PAR_AND:
|
|
4106
4106
|
case i.db.LINETYPE.CRITICAL_OPTION:
|
|
4107
|
-
|
|
4107
|
+
n.message && (c = s.pop(), a[c.id] = c, a[n.id] = c, s.push(c));
|
|
4108
4108
|
break;
|
|
4109
4109
|
case i.db.LINETYPE.LOOP_END:
|
|
4110
4110
|
case i.db.LINETYPE.ALT_END:
|
|
@@ -4112,14 +4112,14 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4112
4112
|
case i.db.LINETYPE.PAR_END:
|
|
4113
4113
|
case i.db.LINETYPE.CRITICAL_END:
|
|
4114
4114
|
case i.db.LINETYPE.BREAK_END:
|
|
4115
|
-
c = s.pop(),
|
|
4115
|
+
c = s.pop(), a[c.id] = c;
|
|
4116
4116
|
break;
|
|
4117
4117
|
case i.db.LINETYPE.ACTIVE_START:
|
|
4118
4118
|
{
|
|
4119
|
-
let e =
|
|
4119
|
+
let e = t.get(n.from ? n.from : n.to.actor), r = actorActivations(n.from ? n.from : n.to.actor).length, i = e.x + e.width / 2 + (r - 1) * conf.activationWidth / 2, a = {
|
|
4120
4120
|
startx: i,
|
|
4121
4121
|
stopx: i + conf.activationWidth,
|
|
4122
|
-
actor:
|
|
4122
|
+
actor: n.from,
|
|
4123
4123
|
enabled: !0
|
|
4124
4124
|
};
|
|
4125
4125
|
bounds.activations.push(a);
|
|
@@ -4127,21 +4127,21 @@ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
|
|
|
4127
4127
|
break;
|
|
4128
4128
|
case i.db.LINETYPE.ACTIVE_END:
|
|
4129
4129
|
{
|
|
4130
|
-
let e = bounds.activations.map((e) => e.actor).lastIndexOf(
|
|
4130
|
+
let e = bounds.activations.map((e) => e.actor).lastIndexOf(n.from);
|
|
4131
4131
|
bounds.activations.splice(e, 1).splice(0, 1);
|
|
4132
4132
|
}
|
|
4133
4133
|
break;
|
|
4134
4134
|
}
|
|
4135
|
-
|
|
4135
|
+
n.placement === void 0 ? (u = buildMessageModel(n, t, i), n.msgModel = u, u.startx && u.stopx && s.length > 0 && s.forEach((e) => {
|
|
4136
4136
|
if (c = e, u.startx === u.stopx) {
|
|
4137
|
-
let e =
|
|
4137
|
+
let e = t.get(n.from), r = t.get(n.to);
|
|
4138
4138
|
c.from = common_default.getMin(e.x - u.width / 2, e.x - e.width / 2, c.from), c.to = common_default.getMax(r.x + u.width / 2, r.x + e.width / 2, c.to), c.width = common_default.getMax(c.width, Math.abs(c.to - c.from)) - conf.labelBoxWidth;
|
|
4139
4139
|
} else c.from = common_default.getMin(u.startx, c.from), c.to = common_default.getMax(u.stopx, c.to), c.width = common_default.getMax(c.width, u.width) - conf.labelBoxWidth;
|
|
4140
|
-
})) : (l = await buildNoteModel(
|
|
4140
|
+
})) : (l = await buildNoteModel(n, t, i), n.noteModel = l, s.forEach((e) => {
|
|
4141
4141
|
c = e, c.from = common_default.getMin(c.from, l.startx), c.to = common_default.getMax(c.to, l.startx + l.width), c.width = common_default.getMax(c.width, Math.abs(c.from - c.to)) - conf.labelBoxWidth;
|
|
4142
4142
|
}));
|
|
4143
4143
|
}
|
|
4144
|
-
return bounds.activations = [], log.debug("Loop type widths:",
|
|
4144
|
+
return bounds.activations = [], log.debug("Loop type widths:", a), a;
|
|
4145
4145
|
}, "calculateLoopBounds"), diagram = {
|
|
4146
4146
|
parser: sequenceDiagram_default,
|
|
4147
4147
|
get db() {
|