@loopstack/loopstack-studio 0.29.5 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/_virtual/rolldown_runtime.js +3 -1
  2. package/dist/api/config.js +5 -4
  3. package/dist/api/environments.js +5 -1
  4. package/dist/api/processor.js +4 -1
  5. package/dist/app/EnvironmentEmbedRoot.js +22 -30
  6. package/dist/components/ai-elements/code-block.js +4 -4
  7. package/dist/components/dynamic-form/CodeContent.js +1 -1
  8. package/dist/components/dynamic-form/FormBody.js +1 -1
  9. package/dist/components/layout/StudioSidebar.js +116 -131
  10. package/dist/components/lists/ListView.js +46 -46
  11. package/dist/components/motion/FadeIn.js +72 -0
  12. package/dist/components/motion/StreamingText.js +49 -0
  13. package/dist/components/ui/accordion.js +2 -2
  14. package/dist/components/ui-widgets/UiWidget.js +11 -10
  15. package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
  16. package/dist/events/sse-client-events.js +7 -1
  17. package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
  18. package/dist/features/dashboard/AppLauncher.js +84 -0
  19. package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
  20. package/dist/features/documents/DocumentRenderer.js +18 -17
  21. package/dist/features/documents/components/DocumentItem.js +42 -20
  22. package/dist/features/documents/components/DocumentList.js +34 -36
  23. package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
  24. package/dist/features/documents/document-details/DocumentDetails.js +577 -377
  25. package/dist/features/documents/document-details/PromptDetails.js +118 -130
  26. package/dist/features/documents/document-details/document-debug-utils.js +100 -0
  27. package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
  28. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
  29. package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
  30. package/dist/features/documents/renderers/LlmMessage.js +52 -47
  31. package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
  32. package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
  33. package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
  34. package/dist/features/feature-registry/available-features.js +12 -0
  35. package/dist/features/feature-registry/index.js +2 -1
  36. package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
  37. package/dist/features/git/components/GitBranchBadge.js +31 -0
  38. package/dist/features/git/components/GitCommitList.js +46 -0
  39. package/dist/features/git/components/GitRemoteStatus.js +84 -0
  40. package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
  41. package/dist/features/git/git-feature.js +12 -0
  42. package/dist/features/git/hooks/useGit.js +78 -0
  43. package/dist/features/git/index.js +1 -0
  44. package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
  45. package/dist/features/runs/Runs.js +73 -73
  46. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  47. package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
  48. package/dist/features/workbench/Workbench.js +25 -33
  49. package/dist/features/workbench/WorkflowItem.js +9 -9
  50. package/dist/features/workbench/WorkflowList.js +61 -62
  51. package/dist/features/workbench/components/NewRunDialog.js +237 -209
  52. package/dist/features/workbench/components/RecentRunItem.js +3 -3
  53. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
  54. package/dist/features/workbench/components/WorkbenchIconSidebar.js +74 -109
  55. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  56. package/dist/features/workbench/components/WorkflowForms.js +11 -10
  57. package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
  58. package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
  59. package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
  60. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
  61. package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
  62. package/dist/features/workbench/index.js +2 -2
  63. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
  64. package/dist/features/workspaces/Workspaces.js +166 -136
  65. package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
  66. package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
  67. package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
  68. package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
  69. package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
  70. package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
  71. package/dist/hooks/index.js +3 -2
  72. package/dist/hooks/query-keys.js +43 -30
  73. package/dist/hooks/useConfig.js +28 -22
  74. package/dist/hooks/useEnvironments.js +27 -2
  75. package/dist/hooks/useProcessor.js +14 -1
  76. package/dist/hooks/useWorkflows.js +4 -4
  77. package/dist/index.d.ts +119 -18
  78. package/dist/index.js +10 -9
  79. package/dist/node_modules/d3/src/index.js +13 -13
  80. package/dist/node_modules/d3-scale/src/continuous.js +16 -16
  81. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
  82. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
  83. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
  84. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
  85. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
  86. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
  87. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
  88. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
  89. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
  90. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
  91. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
  106. package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
  107. package/dist/node_modules/motion/dist/es/react.js +9 -2
  108. package/dist/pages/DashboardPage.js +20 -74
  109. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  110. package/dist/pages/DebugWorkflowsPage.js +76 -106
  111. package/dist/pages/EmbedWorkbenchPage.js +1 -1
  112. package/dist/pages/PreviewWorkbenchPage.js +6 -6
  113. package/dist/pages/WorkbenchPage.js +43 -47
  114. package/dist/pages/WorkflowDebugPage.js +6 -12
  115. package/dist/pages/WorkspacePage.js +40 -66
  116. package/dist/pages/WorkspaceRunsPage.js +24 -31
  117. package/dist/routing/LocalRouter.js +1 -1
  118. package/package.json +2 -2
  119. package/dist/features/dashboard/Dashboard.js +0 -125
  120. package/dist/features/dashboard/RunItem.js +0 -78
  121. package/dist/features/dashboard/RunList.js +0 -32
  122. package/dist/hooks/useDashboard.js +0 -16
@@ -1,12 +1,12 @@
1
+ import select_default from "../../../../d3-selection/src/select.js";
1
2
  import { __name, log } from "./chunk-AGHRB4JF.js";
2
3
  import { assignWithDepth_default, common_default, configureSvgSize, getAccDescription, getAccTitle, getConfig2, sanitizeText, setAccDescription, setAccTitle } from "./chunk-CSCIHK7Q.js";
3
- import select_default from "../../../../d3-selection/src/select.js";
4
4
  import "../../../../d3/src/index.js";
5
5
  import { require_dist } from "../../../../@braintree/sanitize-url/dist/index.js";
6
6
  import { calculateTextHeight, calculateTextWidth, wrapLabel } from "./chunk-5ZQYHXKU.js";
7
7
  import { drawRect, getNoteRect } from "./chunk-ND2GUHAM.js";
8
8
  var import_dist = require_dist(), parser = (function() {
9
- var t = /* @__PURE__ */ __name(function(e, t, n, r) {
9
+ var e = /* @__PURE__ */ __name(function(e, t, n, r) {
10
10
  for (n ||= {}, r = e.length; r--; n[e[r]] = t);
11
11
  return n;
12
12
  }, "o"), n = [1, 24], r = [1, 25], i = [1, 26], a = [1, 27], o = [1, 28], s = [1, 63], l = [1, 64], u = [1, 65], d = [1, 66], f = [1, 67], p = [1, 68], m = [1, 69], h = [1, 29], g = [1, 30], _ = [1, 31], v = [1, 32], y = [1, 33], b = [1, 34], x = [1, 35], S = [1, 36], C = [1, 37], w = [1, 38], T = [1, 39], E = [1, 40], D = [1, 41], O = [1, 42], k = [1, 43], A = [1, 44], j = [1, 45], M = [1, 46], N = [1, 47], P = [1, 48], F = [1, 50], I = [1, 51], L = [1, 52], R = [1, 53], z = [1, 54], B = [1, 55], V = [1, 56], H = [1, 57], U = [1, 58], W = [1, 59], G = [1, 60], K = [14, 42], Fe = [
@@ -846,7 +846,7 @@ var import_dist = require_dist(), parser = (function() {
846
846
  74: G
847
847
  },
848
848
  { 14: [1, 74] },
849
- t(K, [2, 13], {
849
+ e(K, [2, 13], {
850
850
  43: 23,
851
851
  29: 49,
852
852
  30: 61,
@@ -891,14 +891,14 @@ var import_dist = require_dist(), parser = (function() {
891
891
  73: W,
892
892
  74: G
893
893
  }),
894
- t(K, [2, 14]),
895
- t(Fe, [2, 16], { 12: [1, 76] }),
896
- t(K, [2, 36], { 12: [1, 77] }),
897
- t(q, [2, 19]),
898
- t(q, [2, 20]),
894
+ e(K, [2, 14]),
895
+ e(Fe, [2, 16], { 12: [1, 76] }),
896
+ e(K, [2, 36], { 12: [1, 77] }),
897
+ e(q, [2, 19]),
898
+ e(q, [2, 20]),
899
899
  { 25: [1, 78] },
900
900
  { 27: [1, 79] },
901
- t(q, [2, 23]),
901
+ e(q, [2, 23]),
902
902
  {
903
903
  35: 80,
904
904
  75: 81,
@@ -1059,7 +1059,7 @@ var import_dist = require_dist(), parser = (function() {
1059
1059
  79: X,
1060
1060
  80: Z
1061
1061
  },
1062
- t(Q, [2, 59]),
1062
+ e(Q, [2, 59]),
1063
1063
  {
1064
1064
  35: 105,
1065
1065
  75: 81,
@@ -1258,8 +1258,8 @@ var import_dist = require_dist(), parser = (function() {
1258
1258
  { 14: [1, 128] },
1259
1259
  { 14: [1, 129] },
1260
1260
  { 1: [2, 8] },
1261
- t(K, [2, 15]),
1262
- t(Fe, [2, 17], {
1261
+ e(K, [2, 15]),
1262
+ e(Fe, [2, 17], {
1263
1263
  21: 22,
1264
1264
  19: 130,
1265
1265
  22: n,
@@ -1268,7 +1268,7 @@ var import_dist = require_dist(), parser = (function() {
1268
1268
  26: a,
1269
1269
  28: o
1270
1270
  }),
1271
- t(K, [2, 37], {
1271
+ e(K, [2, 37], {
1272
1272
  19: 20,
1273
1273
  20: 21,
1274
1274
  21: 22,
@@ -1321,10 +1321,10 @@ var import_dist = require_dist(), parser = (function() {
1321
1321
  73: W,
1322
1322
  74: G
1323
1323
  }),
1324
- t(q, [2, 21]),
1325
- t(q, [2, 22]),
1326
- t(Q, [2, 39]),
1327
- t(Ie, [2, 71], {
1324
+ e(q, [2, 21]),
1325
+ e(q, [2, 22]),
1326
+ e(Q, [2, 39]),
1327
+ e(Ie, [2, 71], {
1328
1328
  75: 81,
1329
1329
  35: 132,
1330
1330
  76: J,
@@ -1332,66 +1332,66 @@ var import_dist = require_dist(), parser = (function() {
1332
1332
  79: X,
1333
1333
  80: Z
1334
1334
  }),
1335
- t(Le, [2, 73]),
1335
+ e(Le, [2, 73]),
1336
1336
  { 78: [1, 133] },
1337
- t(Le, [2, 75]),
1338
- t(Le, [2, 76]),
1339
- t(Q, [2, 40]),
1340
- t(Q, [2, 41]),
1341
- t(Q, [2, 42]),
1342
- t(Q, [2, 43]),
1343
- t(Q, [2, 44]),
1344
- t(Q, [2, 45]),
1345
- t(Q, [2, 46]),
1346
- t(Q, [2, 47]),
1347
- t(Q, [2, 48]),
1348
- t(Q, [2, 49]),
1349
- t(Q, [2, 50]),
1350
- t(Q, [2, 51]),
1351
- t(Q, [2, 52]),
1352
- t(Q, [2, 53]),
1353
- t(Q, [2, 54]),
1354
- t(Q, [2, 55]),
1355
- t(Q, [2, 56]),
1356
- t(Q, [2, 57]),
1357
- t(Q, [2, 58]),
1358
- t(Q, [2, 60]),
1359
- t(Q, [2, 61]),
1360
- t(Q, [2, 62]),
1361
- t(Q, [2, 63]),
1362
- t(Q, [2, 64]),
1363
- t(Q, [2, 65]),
1364
- t(Q, [2, 66]),
1365
- t(Q, [2, 67]),
1366
- t(Q, [2, 68]),
1367
- t(Q, [2, 69]),
1368
- t(Q, [2, 70]),
1337
+ e(Le, [2, 75]),
1338
+ e(Le, [2, 76]),
1339
+ e(Q, [2, 40]),
1340
+ e(Q, [2, 41]),
1341
+ e(Q, [2, 42]),
1342
+ e(Q, [2, 43]),
1343
+ e(Q, [2, 44]),
1344
+ e(Q, [2, 45]),
1345
+ e(Q, [2, 46]),
1346
+ e(Q, [2, 47]),
1347
+ e(Q, [2, 48]),
1348
+ e(Q, [2, 49]),
1349
+ e(Q, [2, 50]),
1350
+ e(Q, [2, 51]),
1351
+ e(Q, [2, 52]),
1352
+ e(Q, [2, 53]),
1353
+ e(Q, [2, 54]),
1354
+ e(Q, [2, 55]),
1355
+ e(Q, [2, 56]),
1356
+ e(Q, [2, 57]),
1357
+ e(Q, [2, 58]),
1358
+ e(Q, [2, 60]),
1359
+ e(Q, [2, 61]),
1360
+ e(Q, [2, 62]),
1361
+ e(Q, [2, 63]),
1362
+ e(Q, [2, 64]),
1363
+ e(Q, [2, 65]),
1364
+ e(Q, [2, 66]),
1365
+ e(Q, [2, 67]),
1366
+ e(Q, [2, 68]),
1367
+ e(Q, [2, 69]),
1368
+ e(Q, [2, 70]),
1369
1369
  {
1370
1370
  31: 134,
1371
1371
  42: [1, 135]
1372
1372
  },
1373
1373
  { 12: [1, 136] },
1374
1374
  { 33: [1, 137] },
1375
- t($, [2, 28]),
1376
- t($, [2, 29]),
1377
- t($, [2, 30]),
1378
- t($, [2, 31]),
1379
- t($, [2, 32]),
1380
- t($, [2, 33]),
1381
- t($, [2, 34]),
1375
+ e($, [2, 28]),
1376
+ e($, [2, 29]),
1377
+ e($, [2, 30]),
1378
+ e($, [2, 31]),
1379
+ e($, [2, 32]),
1380
+ e($, [2, 33]),
1381
+ e($, [2, 34]),
1382
1382
  { 1: [2, 9] },
1383
1383
  { 1: [2, 10] },
1384
1384
  { 1: [2, 11] },
1385
1385
  { 1: [2, 12] },
1386
- t(Fe, [2, 18]),
1387
- t(K, [2, 38]),
1388
- t(Ie, [2, 72]),
1389
- t(Le, [2, 74]),
1390
- t(Q, [2, 24]),
1391
- t(Q, [2, 35]),
1392
- t(Re, [2, 25]),
1393
- t(Re, [2, 26], { 12: [1, 138] }),
1394
- t(Re, [2, 27])
1386
+ e(Fe, [2, 18]),
1387
+ e(K, [2, 38]),
1388
+ e(Ie, [2, 72]),
1389
+ e(Le, [2, 74]),
1390
+ e(Q, [2, 24]),
1391
+ e(Q, [2, 35]),
1392
+ e(Re, [2, 25]),
1393
+ e(Re, [2, 26], { 12: [1, 138] }),
1394
+ e(Re, [2, 27])
1395
1395
  ],
1396
1396
  defaultActions: {
1397
1397
  2: [2, 1],
@@ -1414,10 +1414,10 @@ var import_dist = require_dist(), parser = (function() {
1414
1414
  throw n.hash = t, n;
1415
1415
  }
1416
1416
  }, "parseError"),
1417
- parse: /* @__PURE__ */ __name(function(t) {
1417
+ parse: /* @__PURE__ */ __name(function(e) {
1418
1418
  var n = this, r = [0], i = [], a = [null], o = [], s = this.table, l = "", u = 0, d = 0, f = 0, p = 2, m = 1, h = o.slice.call(arguments, 1), g = Object.create(this.lexer), _ = { yy: {} };
1419
1419
  for (var v in this.yy) Object.prototype.hasOwnProperty.call(this.yy, v) && (_.yy[v] = this.yy[v]);
1420
- g.setInput(t, _.yy), _.yy.lexer = g, _.yy.parser = this, g.yylloc === void 0 && (g.yylloc = {});
1420
+ g.setInput(e, _.yy), _.yy.lexer = g, _.yy.parser = this, g.yylloc === void 0 && (g.yylloc = {});
1421
1421
  var y = g.yylloc;
1422
1422
  o.push(y);
1423
1423
  var b = g.options && g.options.ranges;
@@ -2734,28 +2734,28 @@ var c4Diagram_default = parser, c4ShapeArray = [], boundaryParseStack = [""], cu
2734
2734
  fontSize: e[t + "FontSize"],
2735
2735
  fontWeight: e[t + "FontWeight"]
2736
2736
  }), "getC4ShapeFont"), _drawTextCandidateFunc = /* @__PURE__ */ (function() {
2737
- function t(e, t, n, r, i, o, s) {
2737
+ function e(e, t, n, r, i, o, s) {
2738
2738
  a(t.append("text").attr("x", n + i / 2).attr("y", r + o / 2 + 5).style("text-anchor", "middle").text(e), s);
2739
2739
  }
2740
- __name(t, "byText");
2741
- function n(e, t, n, i, o, s, l, u) {
2740
+ __name(e, "byText");
2741
+ function n(e, t, n, r, o, s, l, u) {
2742
2742
  let { fontSize: d, fontFamily: f, fontWeight: p } = u, m = e.split(common_default.lineBreakRegex);
2743
2743
  for (let e = 0; e < m.length; e++) {
2744
- let r = e * d - d * (m.length - 1) / 2, s = t.append("text").attr("x", n + o / 2).attr("y", i).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", d).style("font-weight", p).style("font-family", f);
2745
- s.append("tspan").attr("dy", r).text(m[e]).attr("alignment-baseline", "mathematical"), a(s, l);
2744
+ let i = e * d - d * (m.length - 1) / 2, s = t.append("text").attr("x", n + o / 2).attr("y", r).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", d).style("font-weight", p).style("font-family", f);
2745
+ s.append("tspan").attr("dy", i).text(m[e]).attr("alignment-baseline", "mathematical"), a(s, l);
2746
2746
  }
2747
2747
  }
2748
2748
  __name(n, "byTspan");
2749
- function i(e, t, r, i, o, s, l, u) {
2749
+ function r(e, t, r, i, o, s, l, u) {
2750
2750
  let d = t.append("switch"), f = d.append("foreignObject").attr("x", r).attr("y", i).attr("width", o).attr("height", s).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2751
2751
  f.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(e), n(e, d, r, i, o, s, l, u), a(f, l);
2752
2752
  }
2753
- __name(i, "byFo");
2753
+ __name(r, "byFo");
2754
2754
  function a(e, t) {
2755
2755
  for (let n in t) t.hasOwnProperty(n) && e.attr(n, t[n]);
2756
2756
  }
2757
- return __name(a, "_setTextAttrs"), function(e) {
2758
- return e.textPlacement === "fo" ? i : e.textPlacement === "old" ? t : n;
2757
+ return __name(a, "_setTextAttrs"), function(t) {
2758
+ return t.textPlacement === "fo" ? r : t.textPlacement === "old" ? e : n;
2759
2759
  };
2760
2760
  })(), svgDraw_default = {
2761
2761
  drawRect: drawRect2,
@@ -2821,14 +2821,14 @@ var conf = {}, Bounds = class {
2821
2821
  fontSize: e.messageFontSize,
2822
2822
  fontWeight: e.messageFontWeight
2823
2823
  }), "messageFont");
2824
- function calcC4ShapeTextWH(e, t, n, i, a) {
2825
- if (!t[e].width) if (n) t[e].text = wrapLabel(t[e].text, a, i), t[e].textLines = t[e].text.split(common_default.lineBreakRegex).length, t[e].width = a, t[e].height = calculateTextHeight(t[e].text, i);
2824
+ function calcC4ShapeTextWH(e, t, n, r, a) {
2825
+ if (!t[e].width) if (n) t[e].text = wrapLabel(t[e].text, a, r), t[e].textLines = t[e].text.split(common_default.lineBreakRegex).length, t[e].width = a, t[e].height = calculateTextHeight(t[e].text, r);
2826
2826
  else {
2827
2827
  let n = t[e].text.split(common_default.lineBreakRegex);
2828
2828
  t[e].textLines = n.length;
2829
2829
  let a = 0;
2830
2830
  t[e].height = 0, t[e].width = 0;
2831
- for (let r of n) t[e].width = Math.max(calculateTextWidth(r, i), t[e].width), a = calculateTextHeight(r, i), t[e].height = t[e].height + a;
2831
+ for (let i of n) t[e].width = Math.max(calculateTextWidth(i, r), t[e].width), a = calculateTextHeight(i, r), t[e].height = t[e].height + a;
2832
2832
  }
2833
2833
  }
2834
2834
  __name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
@@ -2924,18 +2924,18 @@ var c4Renderer_default = {
2924
2924
  drawPersonOrSystemArray: drawC4ShapeArray,
2925
2925
  drawBoundary: drawBoundary2,
2926
2926
  setConf,
2927
- draw: /* @__PURE__ */ __name(function(e, n, r, a) {
2927
+ draw: /* @__PURE__ */ __name(function(t, r, i, o) {
2928
2928
  conf = getConfig2().c4;
2929
- let o = getConfig2().securityLevel, l;
2930
- o === "sandbox" && (l = select_default("#i" + n));
2931
- let u = select_default(o === "sandbox" ? l.nodes()[0].contentDocument.body : "body"), d = a.db;
2932
- a.db.setWrap(conf.wrap), c4ShapeInRow2 = d.getC4ShapeInRow(), c4BoundaryInRow2 = d.getC4BoundaryInRow(), log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2933
- let p = o === "sandbox" ? u.select(`[id="${n}"]`) : select_default(`[id="${n}"]`);
2934
- svgDraw_default.insertComputerIcon(p, n), svgDraw_default.insertDatabaseIcon(p, n), svgDraw_default.insertClockIcon(p, n);
2935
- let m = new Bounds(a);
2929
+ let s = getConfig2().securityLevel, u;
2930
+ s === "sandbox" && (u = select_default("#i" + r));
2931
+ let d = select_default(s === "sandbox" ? u.nodes()[0].contentDocument.body : "body"), f = o.db;
2932
+ o.db.setWrap(conf.wrap), c4ShapeInRow2 = f.getC4ShapeInRow(), c4BoundaryInRow2 = f.getC4BoundaryInRow(), log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2933
+ let p = s === "sandbox" ? d.select(`[id="${r}"]`) : select_default(`[id="${r}"]`);
2934
+ svgDraw_default.insertComputerIcon(p, r), svgDraw_default.insertDatabaseIcon(p, r), svgDraw_default.insertClockIcon(p, r);
2935
+ let m = new Bounds(o);
2936
2936
  m.setData(conf.diagramMarginX, conf.diagramMarginX, conf.diagramMarginY, conf.diagramMarginY), m.data.widthLimit = screen.availWidth, globalBoundaryMaxX = conf.diagramMarginX, globalBoundaryMaxY = conf.diagramMarginY;
2937
- let h = a.db.getTitle();
2938
- drawInsideBoundary(p, "", m, a.db.getBoundaries(""), a), svgDraw_default.insertArrowHead(p, n), svgDraw_default.insertArrowEnd(p, n), svgDraw_default.insertArrowCrossHead(p, n), svgDraw_default.insertArrowFilledHead(p, n), drawRels2(p, a.db.getRels(), a.db.getC4Shape, a, n), m.data.stopx = globalBoundaryMaxX, m.data.stopy = globalBoundaryMaxY;
2937
+ let h = o.db.getTitle();
2938
+ drawInsideBoundary(p, "", m, o.db.getBoundaries(""), o), svgDraw_default.insertArrowHead(p, r), svgDraw_default.insertArrowEnd(p, r), svgDraw_default.insertArrowCrossHead(p, r), svgDraw_default.insertArrowFilledHead(p, r), drawRels2(p, o.db.getRels(), o.db.getC4Shape, o, r), m.data.stopx = globalBoundaryMaxX, m.data.stopy = globalBoundaryMaxY;
2939
2939
  let g = m.data, _ = g.stopy - g.starty + 2 * conf.diagramMarginY, v = g.stopx - g.startx + 2 * conf.diagramMarginX;
2940
2940
  h && p.append("text").text(h).attr("x", (g.stopx - g.startx) / 2 - 4 * conf.diagramMarginX).attr("y", g.starty + conf.diagramMarginY), configureSvgSize(p, _, v, conf.useMaxWidth);
2941
2941
  let y = h ? 60 : 0;