@loopstack/loopstack-studio 0.29.4 → 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/Form.js +31 -51
- 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,9 +1,9 @@
|
|
|
1
|
+
import select_default from "../../../../d3-selection/src/select.js";
|
|
1
2
|
import { __export, __name, log } from "./chunk-AGHRB4JF.js";
|
|
2
3
|
import is_dark_default from "../../../../khroma/dist/methods/is_dark.js";
|
|
3
4
|
import lighten_default from "../../../../khroma/dist/methods/lighten.js";
|
|
4
5
|
import darken_default from "../../../../khroma/dist/methods/darken.js";
|
|
5
6
|
import { clear, commonDb_exports, getConfig, getConfig2, setupGraphViewbox } from "./chunk-CSCIHK7Q.js";
|
|
6
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
7
7
|
import arc_default from "../../../../d3-shape/src/arc.js";
|
|
8
8
|
import "../../../../d3/src/index.js";
|
|
9
9
|
import { selectSvgElement } from "./chunk-WU5MYG2G.js";
|
|
@@ -12,7 +12,7 @@ var parser = (function() {
|
|
|
12
12
|
var e = /* @__PURE__ */ __name(function(e, b, x, S) {
|
|
13
13
|
for (x ||= {}, S = e.length; S--; x[e[S]] = b);
|
|
14
14
|
return x;
|
|
15
|
-
}, "o"),
|
|
15
|
+
}, "o"), b = [
|
|
16
16
|
6,
|
|
17
17
|
11,
|
|
18
18
|
13,
|
|
@@ -147,10 +147,10 @@ var parser = (function() {
|
|
|
147
147
|
9: [1, 5]
|
|
148
148
|
},
|
|
149
149
|
{ 1: [3] },
|
|
150
|
-
e(
|
|
151
|
-
e(
|
|
152
|
-
e(
|
|
153
|
-
e(
|
|
150
|
+
e(b, [2, 5], { 5: 6 }),
|
|
151
|
+
e(b, [2, 2]),
|
|
152
|
+
e(b, [2, 3]),
|
|
153
|
+
e(b, [2, 4]),
|
|
154
154
|
{
|
|
155
155
|
6: [1, 7],
|
|
156
156
|
10: 8,
|
|
@@ -167,8 +167,8 @@ var parser = (function() {
|
|
|
167
167
|
23: D,
|
|
168
168
|
24: O
|
|
169
169
|
},
|
|
170
|
-
e(
|
|
171
|
-
e(
|
|
170
|
+
e(b, [2, 10], { 1: [2, 1] }),
|
|
171
|
+
e(b, [2, 6]),
|
|
172
172
|
{
|
|
173
173
|
12: 21,
|
|
174
174
|
14: S,
|
|
@@ -181,20 +181,20 @@ var parser = (function() {
|
|
|
181
181
|
23: D,
|
|
182
182
|
24: O
|
|
183
183
|
},
|
|
184
|
-
e(
|
|
185
|
-
e(
|
|
186
|
-
e(
|
|
184
|
+
e(b, [2, 8]),
|
|
185
|
+
e(b, [2, 9]),
|
|
186
|
+
e(b, [2, 11]),
|
|
187
187
|
{ 16: [1, 22] },
|
|
188
188
|
{ 18: [1, 23] },
|
|
189
|
-
e(
|
|
190
|
-
e(
|
|
191
|
-
e(
|
|
192
|
-
e(
|
|
193
|
-
e(
|
|
194
|
-
e(
|
|
195
|
-
e(
|
|
196
|
-
e(
|
|
197
|
-
e(
|
|
189
|
+
e(b, [2, 14]),
|
|
190
|
+
e(b, [2, 15]),
|
|
191
|
+
e(b, [2, 16]),
|
|
192
|
+
e(b, [2, 17]),
|
|
193
|
+
e(b, [2, 18]),
|
|
194
|
+
e(b, [2, 19]),
|
|
195
|
+
e(b, [2, 7]),
|
|
196
|
+
e(b, [2, 12]),
|
|
197
|
+
e(b, [2, 13])
|
|
198
198
|
],
|
|
199
199
|
defaultActions: {},
|
|
200
200
|
parseError: /* @__PURE__ */ __name(function(e, b) {
|
|
@@ -205,7 +205,7 @@ var parser = (function() {
|
|
|
205
205
|
}
|
|
206
206
|
}, "parseError"),
|
|
207
207
|
parse: /* @__PURE__ */ __name(function(e) {
|
|
208
|
-
var
|
|
208
|
+
var b = this, S = [0], C = [], w = [null], T = [], E = this.table, D = "", O = 0, k = 0, A = 0, j = 2, M = 1, N = T.slice.call(arguments, 1), P = Object.create(this.lexer), F = { yy: {} };
|
|
209
209
|
for (var I in this.yy) Object.prototype.hasOwnProperty.call(this.yy, I) && (F.yy[I] = this.yy[I]);
|
|
210
210
|
P.setInput(e, F.yy), F.yy.lexer = P, F.yy.parser = this, P.yylloc === void 0 && (P.yylloc = {});
|
|
211
211
|
var L = P.yylloc;
|
|
@@ -218,7 +218,7 @@ var parser = (function() {
|
|
|
218
218
|
__name(z, "popStack");
|
|
219
219
|
function B() {
|
|
220
220
|
var e = C.pop() || P.lex() || M;
|
|
221
|
-
return typeof e != "number" && (e instanceof Array && (C = e, e = C.pop()), e =
|
|
221
|
+
return typeof e != "number" && (e instanceof Array && (C = e, e = C.pop()), e = b.symbols_[e] || e), e;
|
|
222
222
|
}
|
|
223
223
|
__name(B, "lex");
|
|
224
224
|
for (var V, H, U, W, G, K = {}, q, J, Y, X;;) {
|
|
@@ -543,9 +543,9 @@ var currentSection = "", currentTaskId = 0, direction = "LR", sections = [], tas
|
|
|
543
543
|
}, "addTaskOrg"), compileTasks = /* @__PURE__ */ __name(function() {
|
|
544
544
|
let e = /* @__PURE__ */ __name(function(e) {
|
|
545
545
|
return rawTasks[e].processed;
|
|
546
|
-
}, "compileTask"),
|
|
547
|
-
for (let [
|
|
548
|
-
return
|
|
546
|
+
}, "compileTask"), b = !0;
|
|
547
|
+
for (let [x, S] of rawTasks.entries()) e(x), b &&= S.processed;
|
|
548
|
+
return b;
|
|
549
549
|
}, "compileTasks"), timelineDb_default = {
|
|
550
550
|
clear: clear2,
|
|
551
551
|
getCommonDb,
|
|
@@ -560,23 +560,23 @@ var currentSection = "", currentTaskId = 0, direction = "LR", sections = [], tas
|
|
|
560
560
|
}, nodeCount = 0, drawRect = /* @__PURE__ */ __name(function(e, b) {
|
|
561
561
|
let x = e.append("rect");
|
|
562
562
|
return x.attr("x", b.x), x.attr("y", b.y), x.attr("fill", b.fill), x.attr("stroke", b.stroke), x.attr("width", b.width), x.attr("height", b.height), x.attr("rx", b.rx), x.attr("ry", b.ry), b.class !== void 0 && x.attr("class", b.class), x;
|
|
563
|
-
}, "drawRect"), drawFace = /* @__PURE__ */ __name(function(e,
|
|
564
|
-
let S = e.append("circle").attr("cx",
|
|
565
|
-
C.append("circle").attr("cx",
|
|
563
|
+
}, "drawRect"), drawFace = /* @__PURE__ */ __name(function(e, b) {
|
|
564
|
+
let S = e.append("circle").attr("cx", b.cx).attr("cy", b.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), C = e.append("g");
|
|
565
|
+
C.append("circle").attr("cx", b.cx - 15 / 3).attr("cy", b.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), C.append("circle").attr("cx", b.cx + 15 / 3).attr("cy", b.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
|
|
566
566
|
function w(e) {
|
|
567
|
-
let
|
|
568
|
-
e.append("path").attr("class", "mouth").attr("d",
|
|
567
|
+
let x = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(15 / 2).outerRadius(15 / 2.2);
|
|
568
|
+
e.append("path").attr("class", "mouth").attr("d", x).attr("transform", "translate(" + b.cx + "," + (b.cy + 2) + ")");
|
|
569
569
|
}
|
|
570
570
|
__name(w, "smile");
|
|
571
571
|
function T(e) {
|
|
572
|
-
let
|
|
573
|
-
e.append("path").attr("class", "mouth").attr("d",
|
|
572
|
+
let x = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(15 / 2).outerRadius(15 / 2.2);
|
|
573
|
+
e.append("path").attr("class", "mouth").attr("d", x).attr("transform", "translate(" + b.cx + "," + (b.cy + 7) + ")");
|
|
574
574
|
}
|
|
575
575
|
__name(T, "sad");
|
|
576
576
|
function E(e) {
|
|
577
|
-
e.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1",
|
|
577
|
+
e.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", b.cx - 5).attr("y1", b.cy + 7).attr("x2", b.cx + 5).attr("y2", b.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
|
|
578
578
|
}
|
|
579
|
-
return __name(E, "ambivalent"),
|
|
579
|
+
return __name(E, "ambivalent"), b.score > 3 ? w(C) : b.score < 3 ? T(C) : E(C), S;
|
|
580
580
|
}, "drawFace"), drawCircle = /* @__PURE__ */ __name(function(e, b) {
|
|
581
581
|
let x = e.append("circle");
|
|
582
582
|
return x.attr("cx", b.cx), x.attr("cy", b.cy), x.attr("class", "actor-" + b.pos), x.attr("fill", b.fill), x.attr("stroke", b.stroke), x.attr("r", b.r), x.class !== void 0 && x.attr("class", x.class), b.title !== void 0 && x.append("title").text(b.title), x;
|
|
@@ -585,13 +585,13 @@ var currentSection = "", currentTaskId = 0, direction = "LR", sections = [], tas
|
|
|
585
585
|
S.attr("x", b.x), S.attr("y", b.y), S.attr("class", "legend"), S.style("text-anchor", b.anchor), b.class !== void 0 && S.attr("class", b.class);
|
|
586
586
|
let C = S.append("tspan");
|
|
587
587
|
return C.attr("x", b.x + b.textMargin * 2), C.text(x), S;
|
|
588
|
-
}, "drawText"), drawLabel = /* @__PURE__ */ __name(function(e,
|
|
588
|
+
}, "drawText"), drawLabel = /* @__PURE__ */ __name(function(e, b) {
|
|
589
589
|
function S(e, b, x, S, C) {
|
|
590
590
|
return e + "," + b + " " + (e + x) + "," + b + " " + (e + x) + "," + (b + S - C) + " " + (e + x - C * 1.2) + "," + (b + S) + " " + e + "," + (b + S);
|
|
591
591
|
}
|
|
592
592
|
__name(S, "genPoints");
|
|
593
593
|
let C = e.append("polygon");
|
|
594
|
-
C.attr("points", S(
|
|
594
|
+
C.attr("points", S(b.x, b.y, 50, 20, 7)), C.attr("class", "labelBox"), b.y += b.labelMargin, b.x += .5 * b.labelMargin, drawText(e, b);
|
|
595
595
|
}, "drawLabel"), drawSection = /* @__PURE__ */ __name(function(e, b, x) {
|
|
596
596
|
let S = e.append("g"), C = getNoteRect();
|
|
597
597
|
C.x = b.x, C.y = b.y, C.fill = b.fill, C.width = x.width, C.height = x.height, C.class = "journey-section section-type-" + b.num, C.rx = 3, C.ry = 3, drawRect(S, C), _drawTextCandidateFunc(x)(b.text, S, C.x, C.y, C.width, C.height, { class: "journey-section section-type-" + b.num }, x, b.colour);
|
|
@@ -640,47 +640,47 @@ var currentSection = "", currentTaskId = 0, direction = "LR", sections = [], tas
|
|
|
640
640
|
C(b.append("text").attr("x", x + w / 2).attr("y", S + T / 2 + 5).style("font-color", D).style("text-anchor", "middle").text(e), E);
|
|
641
641
|
}
|
|
642
642
|
__name(e, "byText");
|
|
643
|
-
function
|
|
643
|
+
function b(e, b, x, S, w, T, E, D, O) {
|
|
644
644
|
let { taskFontSize: k, taskFontFamily: A } = D, j = e.split(/<br\s*\/?>/gi);
|
|
645
645
|
for (let e = 0; e < j.length; e++) {
|
|
646
646
|
let D = e * k - k * (j.length - 1) / 2, M = b.append("text").attr("x", x + w / 2).attr("y", S).attr("fill", O).style("text-anchor", "middle").style("font-size", k).style("font-family", A);
|
|
647
647
|
M.append("tspan").attr("x", x + w / 2).attr("dy", D).text(j[e]), M.attr("y", S + T / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), C(M, E);
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
__name(
|
|
651
|
-
function S(e,
|
|
652
|
-
let k =
|
|
653
|
-
A.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(e),
|
|
650
|
+
__name(b, "byTspan");
|
|
651
|
+
function S(e, x, S, w, T, E, D, O) {
|
|
652
|
+
let k = x.append("switch"), A = k.append("foreignObject").attr("x", S).attr("y", w).attr("width", T).attr("height", E).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
653
|
+
A.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(e), b(e, k, S, w, T, E, D, O), C(A, D);
|
|
654
654
|
}
|
|
655
655
|
__name(S, "byFo");
|
|
656
656
|
function C(e, b) {
|
|
657
657
|
for (let x in b) x in b && e.attr(x, b[x]);
|
|
658
658
|
}
|
|
659
|
-
return __name(C, "_setTextAttrs"), function(
|
|
660
|
-
return
|
|
659
|
+
return __name(C, "_setTextAttrs"), function(x) {
|
|
660
|
+
return x.textPlacement === "fo" ? S : x.textPlacement === "old" ? e : b;
|
|
661
661
|
};
|
|
662
662
|
})(), initGraphics = /* @__PURE__ */ __name(function(e, b) {
|
|
663
663
|
nodeCount = 0, taskCount = -1, e.append("defs").append("marker").attr("id", b + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
|
|
664
664
|
}, "initGraphics");
|
|
665
|
-
function wrap(
|
|
666
|
-
|
|
667
|
-
var
|
|
668
|
-
for (let
|
|
665
|
+
function wrap(b, x) {
|
|
666
|
+
b.each(function() {
|
|
667
|
+
var b = select_default(this), S = b.text().split(/(\s+|<br>)/).reverse(), C, w = [], T = 1.1, E = b.attr("y"), D = parseFloat(b.attr("dy")), O = b.text(null).append("tspan").attr("x", 0).attr("y", E).attr("dy", D + "em");
|
|
668
|
+
for (let e = 0; e < S.length; e++) C = S[S.length - 1 - e], w.push(C), O.text(w.join(" ").trim()), (O.node().getComputedTextLength() > x || C === "<br>") && (w.pop(), O.text(w.join(" ").trim()), w = C === "<br>" ? [""] : [C], O = b.append("tspan").attr("x", 0).attr("y", E).attr("dy", T + "em").text(C));
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
671
|
__name(wrap, "wrap");
|
|
672
|
-
var drawNode = /* @__PURE__ */ __name(function(
|
|
673
|
-
let { theme:
|
|
674
|
-
|
|
675
|
-
let j =
|
|
676
|
-
if (
|
|
677
|
-
let
|
|
678
|
-
if (
|
|
679
|
-
let e =
|
|
680
|
-
(e.empty() ?
|
|
672
|
+
var drawNode = /* @__PURE__ */ __name(function(b, x, S, C, w, T = !1) {
|
|
673
|
+
let { theme: E, look: D } = C, O = E?.includes("redux"), k = S % (C?.themeVariables?.THEME_COLOR_LIMIT ?? 12) - 1, A = b.append("g");
|
|
674
|
+
x.section = k, A.attr("class", (x.class ? x.class + " " : "") + "timeline-node " + ("section-" + k));
|
|
675
|
+
let j = A.append("g"), M = A.append("g"), N = M.append("text").text(x.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, x.width).node().getBBox(), P = C.fontSize?.replace ? C.fontSize.replace("px", "") : C.fontSize;
|
|
676
|
+
if (x.height = N.height + P * 1.1 * .5 + x.padding, x.height = Math.max(x.height, x.maxHeight), x.width += 2 * x.padding, M.attr("transform", "translate(" + x.width / 2 + ", " + x.padding / 2 + ")"), O && M.attr("transform", `translate(${x.width / 2}, ${T ? x.padding / 2 + 3 : x.padding})`), defaultBkg(j, x, k, w, C), D === "neo" && (A.attr("data-look", "neo"), O)) {
|
|
677
|
+
let x = E.includes("dark"), S = select_default(b.node()?.ownerSVGElement ?? b.node()), C = S.attr("id") ?? "", w = C ? `${C}-drop-shadow` : "drop-shadow";
|
|
678
|
+
if (S.select(`#${w}`).empty()) {
|
|
679
|
+
let e = S.select("defs");
|
|
680
|
+
(e.empty() ? S.append("defs") : e).append("filter").attr("id", w).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", x ? "0.2" : "0.06").attr("flood-color", x ? "#FFFFFF" : "#000000");
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
return
|
|
683
|
+
return x;
|
|
684
684
|
}, "drawNode"), getVirtualNodeHeight = /* @__PURE__ */ __name(function(e, b, x) {
|
|
685
685
|
let S = e.append("g"), C = S.append("text").text(b.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, b.width).node().getBBox(), w = x.fontSize?.replace ? x.fontSize.replace("px", "") : x.fontSize;
|
|
686
686
|
return S.remove(), C.height + w * 1.1 * .5 + b.padding;
|
|
@@ -700,16 +700,16 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
700
700
|
initGraphics,
|
|
701
701
|
drawNode,
|
|
702
702
|
getVirtualNodeHeight
|
|
703
|
-
}, draw = /* @__PURE__ */ __name(function(
|
|
704
|
-
let
|
|
705
|
-
log.debug("timeline",
|
|
706
|
-
let F =
|
|
707
|
-
F === "sandbox" && (I = select_default("#i" +
|
|
708
|
-
let L = select_default(F === "sandbox" ? I.nodes()[0].contentDocument.body : "body").select("#" +
|
|
703
|
+
}, draw = /* @__PURE__ */ __name(function(b, x, C, w) {
|
|
704
|
+
let T = getConfig2(), { look: E, theme: D, themeVariables: O } = T, { useGradient: j, gradientStart: M, gradientStop: N } = O, P = T.timeline?.leftMargin ?? 50;
|
|
705
|
+
log.debug("timeline", w.db);
|
|
706
|
+
let F = T.securityLevel, I;
|
|
707
|
+
F === "sandbox" && (I = select_default("#i" + x));
|
|
708
|
+
let L = select_default(F === "sandbox" ? I.nodes()[0].contentDocument.body : "body").select("#" + x);
|
|
709
709
|
L.append("g");
|
|
710
|
-
let R =
|
|
711
|
-
log.debug("task", R), svgDraw_default.initGraphics(L,
|
|
712
|
-
let B =
|
|
710
|
+
let R = w.db.getTasks(), z = w.db.getCommonDb().getDiagramTitle();
|
|
711
|
+
log.debug("task", R), svgDraw_default.initGraphics(L, x);
|
|
712
|
+
let B = w.db.getSections();
|
|
713
713
|
log.debug("sections", B);
|
|
714
714
|
let V = 0, H = 0, U = 0, W = 0, G = 50 + P, K = 50;
|
|
715
715
|
W = 50;
|
|
@@ -722,22 +722,22 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
722
722
|
width: 150,
|
|
723
723
|
padding: 20,
|
|
724
724
|
maxHeight: V
|
|
725
|
-
},
|
|
726
|
-
log.debug("sectionHeight before draw",
|
|
725
|
+
}, x = svgDraw_default.getVirtualNodeHeight(L, b, T);
|
|
726
|
+
log.debug("sectionHeight before draw", x), V = Math.max(V, x + 20);
|
|
727
727
|
});
|
|
728
728
|
let Y = 0, X = 0;
|
|
729
729
|
log.debug("tasks.length", R.length);
|
|
730
730
|
for (let [e, b] of R.entries()) {
|
|
731
|
-
let
|
|
731
|
+
let x = {
|
|
732
732
|
number: e,
|
|
733
733
|
descr: b,
|
|
734
734
|
section: b.section,
|
|
735
735
|
width: 150,
|
|
736
736
|
padding: 20,
|
|
737
737
|
maxHeight: H
|
|
738
|
-
}, C = svgDraw_default.getVirtualNodeHeight(L,
|
|
738
|
+
}, C = svgDraw_default.getVirtualNodeHeight(L, x, T);
|
|
739
739
|
log.debug("taskHeight before draw", C), H = Math.max(H, C + 20), Y = Math.max(Y, b.events.length);
|
|
740
|
-
let
|
|
740
|
+
let w = 0;
|
|
741
741
|
for (let e of b.events) {
|
|
742
742
|
let x = {
|
|
743
743
|
descr: e,
|
|
@@ -747,74 +747,74 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
747
747
|
padding: 20,
|
|
748
748
|
maxHeight: 50
|
|
749
749
|
};
|
|
750
|
-
|
|
750
|
+
w += svgDraw_default.getVirtualNodeHeight(L, x, T);
|
|
751
751
|
}
|
|
752
|
-
b.events.length > 0 && (
|
|
752
|
+
b.events.length > 0 && (w += (b.events.length - 1) * 10), X = Math.max(X, w);
|
|
753
753
|
}
|
|
754
754
|
log.debug("maxSectionHeight before draw", V), log.debug("maxTaskHeight before draw", H), B && B.length > 0 ? B.forEach((e) => {
|
|
755
|
-
let
|
|
755
|
+
let b = R.filter((b) => b.section === e), C = {
|
|
756
756
|
number: q,
|
|
757
757
|
descr: e,
|
|
758
758
|
section: q,
|
|
759
|
-
width: 200 * Math.max(
|
|
759
|
+
width: 200 * Math.max(b.length, 1) - 50,
|
|
760
760
|
padding: 20,
|
|
761
761
|
maxHeight: V
|
|
762
762
|
};
|
|
763
763
|
log.debug("sectionNode", C);
|
|
764
|
-
let
|
|
765
|
-
log.debug("sectionNode output", E),
|
|
766
|
-
}) : (J = !1, drawTasks(L, R, q, G, K, H,
|
|
764
|
+
let w = L.append("g"), E = svgDraw_default.drawNode(w, C, q, T, x);
|
|
765
|
+
log.debug("sectionNode output", E), w.attr("transform", `translate(${G}, ${W})`), K += V + 50, b.length > 0 && drawTasks(L, b, q, G, K, H, T, Y, X, V, !1, x), G += 200 * Math.max(b.length, 1), K = W, q++;
|
|
766
|
+
}) : (J = !1, drawTasks(L, R, q, G, K, H, T, Y, X, V, !0, x));
|
|
767
767
|
let Z = L.node().getBBox();
|
|
768
|
-
if (log.debug("bounds", Z), z && L.append("text").text(z).attr("x",
|
|
768
|
+
if (log.debug("bounds", Z), z && L.append("text").text(z).attr("x", E === "neo" ? Z.x * 2 + P : Z.width / 2 - P).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), U = J ? V + H + 150 : H + 100, L.append("g").attr("class", "lineWrapper").append("line").attr("x1", P).attr("y1", U).attr("x2", Z.width + 3 * P).attr("y2", U).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", `url(#${x}-arrowhead)`), E === "neo" && j && D !== "neutral") {
|
|
769
769
|
let e = L.select("defs"), b = (e.empty() ? L.append("defs") : e).append("linearGradient").attr("id", L.attr("id") + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
|
|
770
770
|
b.append("stop").attr("offset", "0%").attr("stop-color", M).attr("stop-opacity", 1), b.append("stop").attr("offset", "100%").attr("stop-color", N).attr("stop-opacity", 1);
|
|
771
771
|
}
|
|
772
|
-
setupGraphViewbox(void 0, L,
|
|
773
|
-
}, "draw"), drawTasks = /* @__PURE__ */ __name(function(e, b,
|
|
772
|
+
setupGraphViewbox(void 0, L, T.timeline?.padding ?? 50, T.timeline?.useMaxWidth ?? !1);
|
|
773
|
+
}, "draw"), drawTasks = /* @__PURE__ */ __name(function(e, b, x, C, w, T, E, D, O, k, A, j) {
|
|
774
774
|
for (let D of b) {
|
|
775
775
|
let b = {
|
|
776
776
|
descr: D.task,
|
|
777
|
-
section:
|
|
778
|
-
number:
|
|
777
|
+
section: x,
|
|
778
|
+
number: x,
|
|
779
779
|
width: 150,
|
|
780
780
|
padding: 20,
|
|
781
781
|
maxHeight: T
|
|
782
782
|
};
|
|
783
783
|
log.debug("taskNode", b);
|
|
784
|
-
let k = e.append("g").attr("class", "taskWrapper"), M = svgDraw_default.drawNode(k, b,
|
|
784
|
+
let k = e.append("g").attr("class", "taskWrapper"), M = svgDraw_default.drawNode(k, b, x, E, j).height;
|
|
785
785
|
if (log.debug("taskHeight after draw", M), k.attr("transform", `translate(${C}, ${w})`), T = Math.max(T, M), D.events) {
|
|
786
|
-
let b = e.append("g").attr("class", "lineWrapper"),
|
|
787
|
-
w += 100,
|
|
786
|
+
let b = e.append("g").attr("class", "lineWrapper"), S = T;
|
|
787
|
+
w += 100, S += drawEvents(e, D.events, x, C, w, E, j), w -= 100, b.append("line").attr("x1", C + 190 / 2).attr("y1", w + T).attr("x2", C + 190 / 2).attr("y2", w + T + 100 + O + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", `url(#${j}-arrowhead)`).attr("stroke-dasharray", "5,5");
|
|
788
788
|
}
|
|
789
|
-
C += 200, A && !E.timeline?.disableMulticolor &&
|
|
789
|
+
C += 200, A && !E.timeline?.disableMulticolor && x++;
|
|
790
790
|
}
|
|
791
791
|
w -= 10;
|
|
792
|
-
}, "drawTasks"), drawEvents = /* @__PURE__ */ __name(function(e, b,
|
|
792
|
+
}, "drawTasks"), drawEvents = /* @__PURE__ */ __name(function(e, b, x, C, w, T, E) {
|
|
793
793
|
let D = 0, O = w;
|
|
794
794
|
w += 100;
|
|
795
795
|
for (let O of b) {
|
|
796
796
|
let b = {
|
|
797
797
|
descr: O,
|
|
798
|
-
section:
|
|
799
|
-
number:
|
|
798
|
+
section: x,
|
|
799
|
+
number: x,
|
|
800
800
|
width: 150,
|
|
801
801
|
padding: 20,
|
|
802
802
|
maxHeight: 50
|
|
803
803
|
};
|
|
804
804
|
log.debug("eventNode", b);
|
|
805
|
-
let k = e.append("g").attr("class", "eventWrapper"), A = svgDraw_default.drawNode(k, b,
|
|
805
|
+
let k = e.append("g").attr("class", "eventWrapper"), A = svgDraw_default.drawNode(k, b, x, T, E, !0).height;
|
|
806
806
|
D += A, k.attr("transform", `translate(${C}, ${w})`), w = w + 10 + A;
|
|
807
807
|
}
|
|
808
808
|
return w = O, D;
|
|
809
809
|
}, "drawEvents"), timelineRenderer_default = {
|
|
810
810
|
setConf: /* @__PURE__ */ __name(() => {}, "setConf"),
|
|
811
811
|
draw
|
|
812
|
-
}, NODE_WIDTH = 200, NODE_PADDING = 5, NODE_TOTAL_WIDTH = NODE_WIDTH + NODE_PADDING * 2, EVENT_WIDTH = NODE_WIDTH + 100, EVENT_TOTAL_WIDTH = EVENT_WIDTH + NODE_PADDING * 2, EVENT_SPACING = 10, EVENT_VERTICAL_GAP = 0, SECTION_TASK_GAP = 20, TASK_AXIS_GAP = 20, TASK_VERTICAL_GAP = 30, EVENT_AXIS_GAP = 50, draw2 = /* @__PURE__ */ __name(function(e, b,
|
|
812
|
+
}, NODE_WIDTH = 200, NODE_PADDING = 5, NODE_TOTAL_WIDTH = NODE_WIDTH + NODE_PADDING * 2, EVENT_WIDTH = NODE_WIDTH + 100, EVENT_TOTAL_WIDTH = EVENT_WIDTH + NODE_PADDING * 2, EVENT_SPACING = 10, EVENT_VERTICAL_GAP = 0, SECTION_TASK_GAP = 20, TASK_AXIS_GAP = 20, TASK_VERTICAL_GAP = 30, EVENT_AXIS_GAP = 50, draw2 = /* @__PURE__ */ __name(function(e, b, x, C) {
|
|
813
813
|
let w = getConfig2(), T = w.timeline?.leftMargin ?? 50;
|
|
814
814
|
log.debug("timeline", C.db);
|
|
815
815
|
let E = selectSvgElement(b);
|
|
816
816
|
E.append("g");
|
|
817
|
-
let D = C.db.getTasks(),
|
|
817
|
+
let D = C.db.getTasks(), O = C.db.getCommonDb().getDiagramTitle();
|
|
818
818
|
log.debug("task", D), svgDraw_default.initGraphics(E);
|
|
819
819
|
let j = C.db.getSections();
|
|
820
820
|
log.debug("sections", j);
|
|
@@ -827,20 +827,20 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
827
827
|
width: K,
|
|
828
828
|
padding: NODE_PADDING,
|
|
829
829
|
maxHeight: P
|
|
830
|
-
},
|
|
831
|
-
log.debug("sectionHeight before draw",
|
|
830
|
+
}, x = svgDraw_default.getVirtualNodeHeight(E, b, w);
|
|
831
|
+
log.debug("sectionHeight before draw", x), P = Math.max(P, x);
|
|
832
832
|
});
|
|
833
833
|
let q = 0;
|
|
834
834
|
log.debug("tasks.length", D.length);
|
|
835
835
|
for (let [e, b] of D.entries()) {
|
|
836
|
-
let
|
|
836
|
+
let x = {
|
|
837
837
|
number: e,
|
|
838
838
|
descr: b,
|
|
839
839
|
section: b.section,
|
|
840
840
|
width: NODE_WIDTH,
|
|
841
841
|
padding: NODE_PADDING,
|
|
842
842
|
maxHeight: F
|
|
843
|
-
}, C = svgDraw_default.getVirtualNodeHeight(E,
|
|
843
|
+
}, C = svgDraw_default.getVirtualNodeHeight(E, x, w);
|
|
844
844
|
log.debug("taskHeight before draw", C), F = Math.max(F, C);
|
|
845
845
|
let T = 0;
|
|
846
846
|
for (let e of b.events) {
|
|
@@ -859,7 +859,7 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
859
859
|
log.debug("maxSectionHeight before draw", P), log.debug("maxTaskHeight before draw", F);
|
|
860
860
|
let J = Math.max(F, q) + TASK_VERTICAL_GAP;
|
|
861
861
|
W ? j.forEach((e) => {
|
|
862
|
-
let b = D.filter((b) => b.section === e),
|
|
862
|
+
let b = D.filter((b) => b.section === e), x = {
|
|
863
863
|
number: U,
|
|
864
864
|
descr: e,
|
|
865
865
|
section: U,
|
|
@@ -867,8 +867,8 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
867
867
|
padding: NODE_PADDING,
|
|
868
868
|
maxHeight: P
|
|
869
869
|
};
|
|
870
|
-
log.debug("sectionNode",
|
|
871
|
-
let C = E.append("g"), T = svgDraw_default.drawNode(C,
|
|
870
|
+
log.debug("sectionNode", x);
|
|
871
|
+
let C = E.append("g"), T = svgDraw_default.drawNode(C, x, U, w);
|
|
872
872
|
log.debug("sectionNode output", T);
|
|
873
873
|
let O = G - B;
|
|
874
874
|
C.attr("transform", `translate(${O}, ${L})`);
|
|
@@ -879,45 +879,45 @@ var drawNode = /* @__PURE__ */ __name(function(e, b, x, S, C, w = !1) {
|
|
|
879
879
|
}) : drawTasks2(E, D, U, G, L, F, w, J, !0);
|
|
880
880
|
let Y = E.node()?.getBBox();
|
|
881
881
|
if (!Y) throw Error("bbox not found");
|
|
882
|
-
if (log.debug("bounds", Y),
|
|
883
|
-
if (E.append("text").text(
|
|
882
|
+
if (log.debug("bounds", Y), O) {
|
|
883
|
+
if (E.append("text").text(O).attr("x", Y.width / 2 - T).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), Y = E.node()?.getBBox(), !Y) throw Error("bbox not found");
|
|
884
884
|
log.debug("bounds after title", Y);
|
|
885
885
|
}
|
|
886
886
|
let [X] = parseFontSize(w.fontSize), Z = (X ?? 16) * 2, Q = (X ?? 16) * .5 + 20, $ = E.append("g").attr("class", "lineWrapper");
|
|
887
887
|
$.append("line").attr("x1", G).attr("y1", R - Z).attr("x2", G).attr("y2", Y.y + Y.height + Q).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), $.lower(), setupGraphViewbox(void 0, E, w.timeline?.padding ?? 50, w.timeline?.useMaxWidth ?? !1);
|
|
888
|
-
}, "draw"), drawTasks2 = /* @__PURE__ */ __name(function(e, b,
|
|
888
|
+
}, "draw"), drawTasks2 = /* @__PURE__ */ __name(function(e, b, x, C, w, T, E, D, O) {
|
|
889
889
|
for (let k of b) {
|
|
890
890
|
let b = {
|
|
891
891
|
descr: k.task,
|
|
892
|
-
section:
|
|
893
|
-
number:
|
|
892
|
+
section: x,
|
|
893
|
+
number: x,
|
|
894
894
|
width: NODE_WIDTH,
|
|
895
895
|
padding: NODE_PADDING,
|
|
896
896
|
maxHeight: T
|
|
897
897
|
};
|
|
898
898
|
log.debug("taskNode", b);
|
|
899
|
-
let A = e.append("g").attr("class", "taskWrapper"), j = svgDraw_default.drawNode(A, b,
|
|
899
|
+
let A = e.append("g").attr("class", "taskWrapper"), j = svgDraw_default.drawNode(A, b, x, E), M = j.height;
|
|
900
900
|
log.debug("taskHeight after draw", M);
|
|
901
901
|
let N = C - TASK_AXIS_GAP - j.width;
|
|
902
902
|
if (A.attr("transform", `translate(${N}, ${w})`), T = Math.max(T, M), k.events && k.events.length > 0) {
|
|
903
|
-
let b = w,
|
|
904
|
-
drawEvents2(e, k.events,
|
|
903
|
+
let b = w, S = C + EVENT_AXIS_GAP;
|
|
904
|
+
drawEvents2(e, k.events, x, C, S, b, E);
|
|
905
905
|
}
|
|
906
|
-
w += D, O && !E.timeline?.disableMulticolor &&
|
|
906
|
+
w += D, O && !E.timeline?.disableMulticolor && x++;
|
|
907
907
|
}
|
|
908
|
-
}, "drawTasks"), drawEvents2 = /* @__PURE__ */ __name(function(e, b,
|
|
908
|
+
}, "drawTasks"), drawEvents2 = /* @__PURE__ */ __name(function(e, b, x, C, w, T, E) {
|
|
909
909
|
let D = T;
|
|
910
910
|
for (let T of b) {
|
|
911
911
|
let b = {
|
|
912
912
|
descr: T,
|
|
913
|
-
section:
|
|
914
|
-
number:
|
|
913
|
+
section: x,
|
|
914
|
+
number: x,
|
|
915
915
|
width: EVENT_WIDTH,
|
|
916
916
|
padding: NODE_PADDING,
|
|
917
917
|
maxHeight: 0
|
|
918
918
|
};
|
|
919
919
|
log.debug("eventNode", b);
|
|
920
|
-
let O = e.append("g").attr("class", "eventWrapper"), k = svgDraw_default.drawNode(O, b,
|
|
920
|
+
let O = e.append("g").attr("class", "eventWrapper"), k = svgDraw_default.drawNode(O, b, x, E).height;
|
|
921
921
|
O.attr("transform", `translate(${w}, ${D})`);
|
|
922
922
|
let A = e.append("g").attr("class", "lineWrapper"), j = D + k / 2;
|
|
923
923
|
A.append("line").attr("x1", C).attr("y1", j).attr("x2", w).attr("y2", j).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5"), D = D + k + EVENT_SPACING;
|