@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,12 +1,12 @@
|
|
|
1
1
|
import { __toESM } from "../../../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import select_default from "../../../../d3-selection/src/select.js";
|
|
3
|
+
import hcl_default from "../../../../d3-interpolate/src/hcl.js";
|
|
2
4
|
import { require_dayjs_min } from "../../../../dayjs/dayjs.min.js";
|
|
3
5
|
import { __name, log } from "./chunk-AGHRB4JF.js";
|
|
4
6
|
import { clear, common_default, configureSvgSize, getAccDescription, getAccTitle, getConfig2, getDiagramTitle, setAccDescription, setAccTitle, setDiagramTitle } from "./chunk-CSCIHK7Q.js";
|
|
5
7
|
import max from "../../../../d3-array/src/max.js";
|
|
6
8
|
import min from "../../../../d3-array/src/min.js";
|
|
7
9
|
import { axisBottom, axisTop } from "../../../../d3-axis/src/axis.js";
|
|
8
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
9
|
-
import hcl_default from "../../../../d3-interpolate/src/hcl.js";
|
|
10
10
|
import linear from "../../../../d3-scale/src/linear.js";
|
|
11
11
|
import { millisecond } from "../../../../d3-time/src/millisecond.js";
|
|
12
12
|
import { second } from "../../../../d3-time/src/second.js";
|
|
@@ -56,7 +56,7 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
56
56
|
36,
|
|
57
57
|
38,
|
|
58
58
|
40
|
|
59
|
-
],
|
|
59
|
+
], p = [1, 26], m = [1, 27], g = [1, 28], _ = [1, 29], v = [1, 30], y = [1, 31], b = [1, 32], x = [1, 33], S = [1, 34], C = [1, 9], T = [1, 10], E = [1, 11], D = [1, 12], O = [1, 13], k = [1, 14], A = [1, 15], j = [1, 16], M = [1, 19], N = [1, 20], P = [1, 21], F = [1, 22], I = [1, 23], L = [1, 25], R = [1, 35], z = {
|
|
60
60
|
trace: /* @__PURE__ */ __name(function() {}, "trace"),
|
|
61
61
|
yy: {},
|
|
62
62
|
symbols_: {
|
|
@@ -328,8 +328,8 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
328
328
|
9: 7,
|
|
329
329
|
10: [1, 8],
|
|
330
330
|
11: 17,
|
|
331
|
-
12:
|
|
332
|
-
13:
|
|
331
|
+
12: p,
|
|
332
|
+
13: m,
|
|
333
333
|
14: g,
|
|
334
334
|
15: _,
|
|
335
335
|
16: v,
|
|
@@ -360,8 +360,8 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
360
360
|
{
|
|
361
361
|
9: 36,
|
|
362
362
|
11: 17,
|
|
363
|
-
12:
|
|
364
|
-
13:
|
|
363
|
+
12: p,
|
|
364
|
+
13: m,
|
|
365
365
|
14: g,
|
|
366
366
|
15: _,
|
|
367
367
|
16: v,
|
|
@@ -443,7 +443,7 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
443
443
|
}
|
|
444
444
|
}, "parseError"),
|
|
445
445
|
parse: /* @__PURE__ */ __name(function(e) {
|
|
446
|
-
var f = this,
|
|
446
|
+
var f = this, p = [0], m = [], g = [null], _ = [], v = this.table, y = "", b = 0, x = 0, S = 0, C = 2, T = 1, E = _.slice.call(arguments, 1), D = Object.create(this.lexer), O = { yy: {} };
|
|
447
447
|
for (var k in this.yy) Object.prototype.hasOwnProperty.call(this.yy, k) && (O.yy[k] = this.yy[k]);
|
|
448
448
|
D.setInput(e, O.yy), O.yy.lexer = D, O.yy.parser = this, D.yylloc === void 0 && (D.yylloc = {});
|
|
449
449
|
var A = D.yylloc;
|
|
@@ -451,16 +451,16 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
451
451
|
var j = D.options && D.options.ranges;
|
|
452
452
|
typeof O.yy.parseError == "function" ? this.parseError = O.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
453
453
|
function M(e) {
|
|
454
|
-
|
|
454
|
+
p.length -= 2 * e, g.length -= e, _.length -= e;
|
|
455
455
|
}
|
|
456
456
|
__name(M, "popStack");
|
|
457
457
|
function N() {
|
|
458
|
-
var e =
|
|
459
|
-
return typeof e != "number" && (e instanceof Array && (
|
|
458
|
+
var e = m.pop() || D.lex() || T;
|
|
459
|
+
return typeof e != "number" && (e instanceof Array && (m = e, e = m.pop()), e = f.symbols_[e] || e), e;
|
|
460
460
|
}
|
|
461
461
|
__name(N, "lex");
|
|
462
462
|
for (var P, F, I, L, R, z = {}, B, V, H, U;;) {
|
|
463
|
-
if (I =
|
|
463
|
+
if (I = p[p.length - 1], this.defaultActions[I] ? L = this.defaultActions[I] : (P ??= N(), L = v[I] && v[I][P]), L === void 0 || !L.length || !L[0]) {
|
|
464
464
|
var W = "";
|
|
465
465
|
for (B in U = [], v[I]) this.terminals_[B] && B > C && U.push("'" + this.terminals_[B] + "'");
|
|
466
466
|
W = D.showPosition ? "Parse error on line " + (b + 1) + ":\n" + D.showPosition() + "\nExpecting " + U.join(", ") + ", got '" + (this.terminals_[P] || P) + "'" : "Parse error on line " + (b + 1) + ": Unexpected " + (P == T ? "end of input" : "'" + (this.terminals_[P] || P) + "'"), this.parseError(W, {
|
|
@@ -474,7 +474,7 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
474
474
|
if (L[0] instanceof Array && L.length > 1) throw Error("Parse Error: multiple actions possible at state: " + I + ", token: " + P);
|
|
475
475
|
switch (L[0]) {
|
|
476
476
|
case 1:
|
|
477
|
-
|
|
477
|
+
p.push(P), g.push(D.yytext), _.push(D.yylloc), p.push(L[1]), P = null, F ? (P = F, F = null) : (x = D.yyleng, y = D.yytext, b = D.yylineno, A = D.yylloc, S > 0 && S--);
|
|
478
478
|
break;
|
|
479
479
|
case 2:
|
|
480
480
|
if (V = this.productions_[L[1]][1], z.$ = g[g.length - V], z._$ = {
|
|
@@ -491,7 +491,7 @@ var import_dist = require_dist(), import_dayjs_min = /* @__PURE__ */ __toESM(req
|
|
|
491
491
|
g,
|
|
492
492
|
_
|
|
493
493
|
].concat(E)), R !== void 0) return R;
|
|
494
|
-
V && (
|
|
494
|
+
V && (p = p.slice(0, -1 * V * 2), g = g.slice(0, -1 * V), _ = _.slice(0, -1 * V)), p.push(this.productions_[L[1]][0]), g.push(z.$), _.push(z._$), H = v[p[p.length - 2]][p[p.length - 1]], p.push(H);
|
|
495
495
|
break;
|
|
496
496
|
case 3: return !0;
|
|
497
497
|
}
|
|
@@ -937,15 +937,15 @@ var WEEKEND_START_DAY = {
|
|
|
937
937
|
e = e.add(1, "d");
|
|
938
938
|
}
|
|
939
939
|
return [f, _];
|
|
940
|
-
}, "fixTaskDates"), getStartDate = /* @__PURE__ */ __name(function(e, f,
|
|
941
|
-
if (
|
|
940
|
+
}, "fixTaskDates"), getStartDate = /* @__PURE__ */ __name(function(e, f, p) {
|
|
941
|
+
if (p = p.trim(), (/* @__PURE__ */ __name((e) => {
|
|
942
942
|
let f = e.trim();
|
|
943
943
|
return f === "x" || f === "X";
|
|
944
|
-
}, "isTimestampFormat"))(f) && /^\d+$/.test(
|
|
945
|
-
let
|
|
946
|
-
if (
|
|
944
|
+
}, "isTimestampFormat"))(f) && /^\d+$/.test(p)) return new Date(Number(p));
|
|
945
|
+
let m = /^after\s+(?<ids>[\d\w- ]+)/.exec(p);
|
|
946
|
+
if (m !== null) {
|
|
947
947
|
let e = null;
|
|
948
|
-
for (let f of
|
|
948
|
+
for (let f of m.groups.ids.split(" ")) {
|
|
949
949
|
let p = findTaskById(f);
|
|
950
950
|
p !== void 0 && (!e || p.endTime > e.endTime) && (e = p);
|
|
951
951
|
}
|
|
@@ -953,12 +953,12 @@ var WEEKEND_START_DAY = {
|
|
|
953
953
|
let f = /* @__PURE__ */ new Date();
|
|
954
954
|
return f.setHours(0, 0, 0, 0), f;
|
|
955
955
|
}
|
|
956
|
-
let _ = (0, import_dayjs_min.default)(
|
|
956
|
+
let _ = (0, import_dayjs_min.default)(p, f.trim(), !0);
|
|
957
957
|
if (_.isValid()) return _.toDate();
|
|
958
958
|
{
|
|
959
|
-
log.debug("Invalid date:" +
|
|
960
|
-
let e = new Date(
|
|
961
|
-
if (e === void 0 || isNaN(e.getTime()) || e.getFullYear() < -1e4 || e.getFullYear() > 1e4) throw Error("Invalid date:" +
|
|
959
|
+
log.debug("Invalid date:" + p), log.debug("With date format:" + f.trim());
|
|
960
|
+
let e = new Date(p);
|
|
961
|
+
if (e === void 0 || isNaN(e.getTime()) || e.getFullYear() < -1e4 || e.getFullYear() > 1e4) throw Error("Invalid date:" + p);
|
|
962
962
|
return e;
|
|
963
963
|
}
|
|
964
964
|
}, "getStartDate"), parseDuration = /* @__PURE__ */ __name(function(e) {
|
|
@@ -1195,127 +1195,127 @@ var setConf = /* @__PURE__ */ __name(function() {
|
|
|
1195
1195
|
db: ganttDb_default,
|
|
1196
1196
|
renderer: {
|
|
1197
1197
|
setConf,
|
|
1198
|
-
draw: /* @__PURE__ */ __name(function(e,
|
|
1199
|
-
let
|
|
1200
|
-
|
|
1201
|
-
let
|
|
1202
|
-
|
|
1203
|
-
let
|
|
1204
|
-
w = R.parentElement.offsetWidth, w === void 0 && (w = 1200),
|
|
1205
|
-
let z =
|
|
1198
|
+
draw: /* @__PURE__ */ __name(function(e, m, _, b) {
|
|
1199
|
+
let x = getConfig2().gantt;
|
|
1200
|
+
b.db.setDiagramId(m);
|
|
1201
|
+
let C = getConfig2().securityLevel, T;
|
|
1202
|
+
C === "sandbox" && (T = select_default("#i" + m));
|
|
1203
|
+
let E = select_default(C === "sandbox" ? T.nodes()[0].contentDocument.body : "body"), D = C === "sandbox" ? T.nodes()[0].contentDocument : document, R = D.getElementById(m);
|
|
1204
|
+
w = R.parentElement.offsetWidth, w === void 0 && (w = 1200), x.useWidth !== void 0 && (w = x.useWidth);
|
|
1205
|
+
let z = b.db.getTasks(), B = [];
|
|
1206
1206
|
for (let e of z) B.push(e.type);
|
|
1207
1207
|
B = $(B);
|
|
1208
|
-
let V = {}, H = 2 *
|
|
1209
|
-
if (
|
|
1208
|
+
let V = {}, H = 2 * x.topPadding;
|
|
1209
|
+
if (b.db.getDisplayMode() === "compact" || x.displayMode === "compact") {
|
|
1210
1210
|
let e = {};
|
|
1211
1211
|
for (let f of z) e[f.section] === void 0 ? e[f.section] = [f] : e[f.section].push(f);
|
|
1212
1212
|
let f = 0;
|
|
1213
1213
|
for (let p of Object.keys(e)) {
|
|
1214
1214
|
let m = getMaxIntersections(e[p], f) + 1;
|
|
1215
|
-
f += m, H += m * (
|
|
1215
|
+
f += m, H += m * (x.barHeight + x.barGap), V[p] = m;
|
|
1216
1216
|
}
|
|
1217
1217
|
} else {
|
|
1218
|
-
H += z.length * (
|
|
1218
|
+
H += z.length * (x.barHeight + x.barGap);
|
|
1219
1219
|
for (let e of B) V[e] = z.filter((f) => f.type === e).length;
|
|
1220
1220
|
}
|
|
1221
1221
|
R.setAttribute("viewBox", "0 0 " + w + " " + H);
|
|
1222
|
-
let U =
|
|
1222
|
+
let U = E.select(`[id="${m}"]`), W = time().domain([min(z, function(e) {
|
|
1223
1223
|
return e.startTime;
|
|
1224
1224
|
}), max(z, function(e) {
|
|
1225
1225
|
return e.endTime;
|
|
1226
|
-
})]).rangeRound([0, w -
|
|
1226
|
+
})]).rangeRound([0, w - x.leftPadding - x.rightPadding]);
|
|
1227
1227
|
function G(e, f) {
|
|
1228
1228
|
let p = e.startTime, m = f.startTime, h = 0;
|
|
1229
1229
|
return p > m ? h = 1 : p < m && (h = -1), h;
|
|
1230
1230
|
}
|
|
1231
|
-
__name(G, "taskCompare"), z.sort(G), K(z, w, H), configureSvgSize(U, H, w,
|
|
1232
|
-
function K(e, f,
|
|
1233
|
-
let
|
|
1234
|
-
J(
|
|
1231
|
+
__name(G, "taskCompare"), z.sort(G), K(z, w, H), configureSvgSize(U, H, w, x.useMaxWidth), U.append("text").text(b.db.getDiagramTitle()).attr("x", w / 2).attr("y", x.titleTopMargin).attr("class", "titleText");
|
|
1232
|
+
function K(e, f, m) {
|
|
1233
|
+
let h = x.barHeight, g = h + x.barGap, _ = x.topPadding, v = x.leftPadding, y = linear().domain([0, B.length]).range(["#00B9FA", "#F95002"]).interpolate(hcl_default);
|
|
1234
|
+
J(g, _, v, f, m, e, b.db.getExcludes(), b.db.getIncludes()), X(v, _, f, m), q(e, g, _, v, h, y, f, m), Z(g, _, v, h, y), Q(v, _, f, m);
|
|
1235
1235
|
}
|
|
1236
1236
|
__name(K, "makeGantt");
|
|
1237
|
-
function q(e, p,
|
|
1237
|
+
function q(e, p, h, g, _, v, y) {
|
|
1238
1238
|
e.sort((e, f) => e.vert === f.vert ? 0 : e.vert ? 1 : -1);
|
|
1239
|
-
let
|
|
1240
|
-
U.append("g").selectAll("rect").data(
|
|
1241
|
-
return f = e.order, f * p +
|
|
1239
|
+
let C = [...new Set(e.map((e) => e.order))].map((f) => e.find((e) => e.order === f));
|
|
1240
|
+
U.append("g").selectAll("rect").data(C).enter().append("rect").attr("x", 0).attr("y", function(e, f) {
|
|
1241
|
+
return f = e.order, f * p + h - 2;
|
|
1242
1242
|
}).attr("width", function() {
|
|
1243
|
-
return
|
|
1243
|
+
return y - x.rightPadding / 2;
|
|
1244
1244
|
}).attr("height", p).attr("class", function(e) {
|
|
1245
|
-
for (let [f, p] of B.entries()) if (e.type === p) return "section section" + f %
|
|
1245
|
+
for (let [f, p] of B.entries()) if (e.type === p) return "section section" + f % x.numberSectionStyles;
|
|
1246
1246
|
return "section section0";
|
|
1247
1247
|
}).enter();
|
|
1248
|
-
let
|
|
1249
|
-
if (
|
|
1250
|
-
return
|
|
1248
|
+
let T = U.append("g").selectAll("rect").data(e).enter(), E = b.db.getLinks();
|
|
1249
|
+
if (T.append("rect").attr("id", function(e) {
|
|
1250
|
+
return m + "-" + e.id;
|
|
1251
1251
|
}).attr("rx", 3).attr("ry", 3).attr("x", function(e) {
|
|
1252
|
-
return e.milestone ? W(e.startTime) +
|
|
1252
|
+
return e.milestone ? W(e.startTime) + g + .5 * (W(e.endTime) - W(e.startTime)) - .5 * _ : W(e.startTime) + g;
|
|
1253
1253
|
}).attr("y", function(e, f) {
|
|
1254
|
-
return f = e.order, e.vert ?
|
|
1254
|
+
return f = e.order, e.vert ? x.gridLineStartPadding : f * p + h;
|
|
1255
1255
|
}).attr("width", function(e) {
|
|
1256
|
-
return e.milestone ?
|
|
1256
|
+
return e.milestone ? _ : e.vert ? .08 * _ : W(e.renderEndTime || e.endTime) - W(e.startTime);
|
|
1257
1257
|
}).attr("height", function(e) {
|
|
1258
|
-
return e.vert ? z.length * (
|
|
1258
|
+
return e.vert ? z.length * (x.barHeight + x.barGap) + x.barHeight * 2 : _;
|
|
1259
1259
|
}).attr("transform-origin", function(e, f) {
|
|
1260
|
-
return f = e.order, (W(e.startTime) +
|
|
1260
|
+
return f = e.order, (W(e.startTime) + g + .5 * (W(e.endTime) - W(e.startTime))).toString() + "px " + (f * p + h + .5 * _).toString() + "px";
|
|
1261
1261
|
}).attr("class", function(e) {
|
|
1262
1262
|
let f = "";
|
|
1263
1263
|
e.classes.length > 0 && (f = e.classes.join(" "));
|
|
1264
1264
|
let p = 0;
|
|
1265
|
-
for (let [f, m] of B.entries()) e.type === m && (p = f %
|
|
1265
|
+
for (let [f, m] of B.entries()) e.type === m && (p = f % x.numberSectionStyles);
|
|
1266
1266
|
let m = "";
|
|
1267
1267
|
return e.active ? e.crit ? m += " activeCrit" : m = " active" : e.done ? m = e.crit ? " doneCrit" : " done" : e.crit && (m += " crit"), m.length === 0 && (m = " task"), e.milestone && (m = " milestone " + m), e.vert && (m = " vert " + m), m += p, m += " " + f, "task" + m;
|
|
1268
|
-
}),
|
|
1269
|
-
return
|
|
1268
|
+
}), T.append("text").attr("id", function(e) {
|
|
1269
|
+
return m + "-" + e.id + "-text";
|
|
1270
1270
|
}).text(function(e) {
|
|
1271
1271
|
return e.task;
|
|
1272
|
-
}).attr("font-size",
|
|
1272
|
+
}).attr("font-size", x.fontSize).attr("x", function(e) {
|
|
1273
1273
|
let f = W(e.startTime), p = W(e.renderEndTime || e.endTime);
|
|
1274
|
-
if (e.milestone && (f += .5 * (W(e.endTime) - W(e.startTime)) - .5 *
|
|
1274
|
+
if (e.milestone && (f += .5 * (W(e.endTime) - W(e.startTime)) - .5 * _, p = f + _), e.vert) return W(e.startTime) + g;
|
|
1275
1275
|
let m = this.getBBox().width;
|
|
1276
|
-
return m > p - f ? p + m + 1.5 *
|
|
1276
|
+
return m > p - f ? p + m + 1.5 * x.leftPadding > y ? f + g - 5 : p + g + 5 : (p - f) / 2 + f + g;
|
|
1277
1277
|
}).attr("y", function(e, f) {
|
|
1278
|
-
return e.vert ?
|
|
1279
|
-
}).attr("text-height",
|
|
1278
|
+
return e.vert ? x.gridLineStartPadding + z.length * (x.barHeight + x.barGap) + 60 : (f = e.order, f * p + x.barHeight / 2 + (x.fontSize / 2 - 2) + h);
|
|
1279
|
+
}).attr("text-height", _).attr("class", function(e) {
|
|
1280
1280
|
let f = W(e.startTime), p = W(e.endTime);
|
|
1281
|
-
e.milestone && (p = f +
|
|
1281
|
+
e.milestone && (p = f + _);
|
|
1282
1282
|
let m = this.getBBox().width, h = "";
|
|
1283
1283
|
e.classes.length > 0 && (h = e.classes.join(" "));
|
|
1284
|
-
let
|
|
1285
|
-
for (let [f, p] of B.entries()) e.type === p && (
|
|
1284
|
+
let g = 0;
|
|
1285
|
+
for (let [f, p] of B.entries()) e.type === p && (g = f % x.numberSectionStyles);
|
|
1286
1286
|
let v = "";
|
|
1287
|
-
return e.active && (v = e.crit ? "activeCritText" +
|
|
1287
|
+
return e.active && (v = e.crit ? "activeCritText" + g : "activeText" + g), e.done ? v = e.crit ? v + " doneCritText" + g : v + " doneText" + g : e.crit && (v = v + " critText" + g), e.milestone && (v += " milestoneText"), e.vert && (v += " vertText"), m > p - f ? p + m + 1.5 * x.leftPadding > y ? h + " taskTextOutsideLeft taskTextOutside" + g + " " + v : h + " taskTextOutsideRight taskTextOutside" + g + " " + v + " width-" + m : h + " taskText taskText" + g + " " + v + " width-" + m;
|
|
1288
1288
|
}), getConfig2().securityLevel === "sandbox") {
|
|
1289
1289
|
let e;
|
|
1290
|
-
e = select_default("#i" +
|
|
1290
|
+
e = select_default("#i" + m);
|
|
1291
1291
|
let p = e.nodes()[0].contentDocument;
|
|
1292
|
-
|
|
1293
|
-
return
|
|
1292
|
+
T.filter(function(e) {
|
|
1293
|
+
return E.has(e.id);
|
|
1294
1294
|
}).each(function(e) {
|
|
1295
|
-
var
|
|
1296
|
-
let g =
|
|
1295
|
+
var f = p.querySelector("#" + CSS.escape(m + "-" + e.id)), h = p.querySelector("#" + CSS.escape(m + "-" + e.id + "-text"));
|
|
1296
|
+
let g = f.parentNode;
|
|
1297
1297
|
var _ = p.createElement("a");
|
|
1298
|
-
_.setAttribute("xlink:href",
|
|
1298
|
+
_.setAttribute("xlink:href", E.get(e.id)), _.setAttribute("target", "_top"), g.appendChild(_), _.appendChild(f), _.appendChild(h);
|
|
1299
1299
|
});
|
|
1300
1300
|
}
|
|
1301
1301
|
}
|
|
1302
1302
|
__name(q, "drawRects");
|
|
1303
|
-
function J(e, p, h,
|
|
1304
|
-
if (
|
|
1303
|
+
function J(e, f, p, h, _, v, y, S) {
|
|
1304
|
+
if (y.length === 0 && S.length === 0) return;
|
|
1305
1305
|
let C, T;
|
|
1306
|
-
for (let { startTime: e, endTime: f } of
|
|
1306
|
+
for (let { startTime: e, endTime: f } of v) (C === void 0 || e < C) && (C = e), (T === void 0 || f > T) && (T = f);
|
|
1307
1307
|
if (!C || !T) return;
|
|
1308
1308
|
if ((0, import_dayjs_min$1.default)(T).diff((0, import_dayjs_min$1.default)(C), "year") > 5) {
|
|
1309
1309
|
log.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");
|
|
1310
1310
|
return;
|
|
1311
1311
|
}
|
|
1312
|
-
let E =
|
|
1313
|
-
for (; k.valueOf() <= T;)
|
|
1312
|
+
let E = b.db.getDateFormat(), D = [], O = null, k = (0, import_dayjs_min$1.default)(C);
|
|
1313
|
+
for (; k.valueOf() <= T;) b.db.isInvalidDate(k, E, y, S) ? O ? O.end = k : O = {
|
|
1314
1314
|
start: k,
|
|
1315
1315
|
end: k
|
|
1316
1316
|
} : O &&= (D.push(O), null), k = k.add(1, "d");
|
|
1317
|
-
U.append("g").selectAll("rect").data(D).enter().append("rect").attr("id", (e) =>
|
|
1318
|
-
return (W(f.start) +
|
|
1317
|
+
U.append("g").selectAll("rect").data(D).enter().append("rect").attr("id", (e) => m + "-exclude-" + e.start.format("YYYY-MM-DD")).attr("x", (e) => W(e.start.startOf("day")) + p).attr("y", x.gridLineStartPadding).attr("width", (e) => W(e.end.endOf("day")) - W(e.start.startOf("day"))).attr("height", _ - f - x.gridLineStartPadding).attr("transform-origin", function(f, m) {
|
|
1318
|
+
return (W(f.start) + p + .5 * (W(f.end) - W(f.start))).toString() + "px " + (m * e + .5 * _).toString() + "px";
|
|
1319
1319
|
}).attr("class", "exclude-range");
|
|
1320
1320
|
}
|
|
1321
1321
|
__name(J, "drawExcludeDays");
|
|
@@ -1325,48 +1325,48 @@ var setConf = /* @__PURE__ */ __name(function() {
|
|
|
1325
1325
|
return g <= 0 ? Infinity : Math.ceil(h / g);
|
|
1326
1326
|
}
|
|
1327
1327
|
__name(Y, "getEstimatedTickCount");
|
|
1328
|
-
function X(e, f, p,
|
|
1329
|
-
let
|
|
1330
|
-
|
|
1331
|
-
let
|
|
1328
|
+
function X(e, f, p, m) {
|
|
1329
|
+
let h = b.db.getDateFormat(), _ = b.db.getAxisFormat(), v;
|
|
1330
|
+
v = _ || (h === "D" ? "%d" : x.axisFormat ?? "%Y-%m-%d");
|
|
1331
|
+
let y = axisBottom(W).tickSize(-m + f + x.gridLineStartPadding).tickFormat(timeFormat(v)), S = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(b.db.getTickInterval() || x.tickInterval);
|
|
1332
1332
|
if (S !== null) {
|
|
1333
1333
|
let e = parseInt(S[1], 10);
|
|
1334
1334
|
if (isNaN(e) || e <= 0) log.warn(`Invalid tick interval value: "${S[1]}". Skipping custom tick interval.`);
|
|
1335
1335
|
else {
|
|
1336
|
-
let f = S[2], p =
|
|
1337
|
-
if (
|
|
1336
|
+
let f = S[2], p = b.db.getWeekday() || x.weekday, m = W.domain(), h = m[0], _ = m[1], v = Y(h, _, e, f);
|
|
1337
|
+
if (v > MAX_TICK_COUNT) log.warn(`The tick interval "${e}${f}" would generate ${v} ticks, which exceeds the maximum allowed (${MAX_TICK_COUNT}). This may indicate an invalid date or time range. Skipping custom tick interval.`);
|
|
1338
1338
|
else switch (f) {
|
|
1339
1339
|
case "millisecond":
|
|
1340
|
-
|
|
1340
|
+
y.ticks(millisecond.every(e));
|
|
1341
1341
|
break;
|
|
1342
1342
|
case "second":
|
|
1343
|
-
|
|
1343
|
+
y.ticks(second.every(e));
|
|
1344
1344
|
break;
|
|
1345
1345
|
case "minute":
|
|
1346
|
-
|
|
1346
|
+
y.ticks(timeMinute.every(e));
|
|
1347
1347
|
break;
|
|
1348
1348
|
case "hour":
|
|
1349
|
-
|
|
1349
|
+
y.ticks(timeHour.every(e));
|
|
1350
1350
|
break;
|
|
1351
1351
|
case "day":
|
|
1352
|
-
|
|
1352
|
+
y.ticks(timeDay.every(e));
|
|
1353
1353
|
break;
|
|
1354
1354
|
case "week":
|
|
1355
|
-
|
|
1355
|
+
y.ticks(mapWeekdayToTimeFunction[p].every(e));
|
|
1356
1356
|
break;
|
|
1357
1357
|
case "month":
|
|
1358
|
-
|
|
1358
|
+
y.ticks(timeMonth.every(e));
|
|
1359
1359
|
break;
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
|
-
if (U.append("g").attr("class", "grid").attr("transform", "translate(" + e + ", " + (
|
|
1364
|
-
let p = axisTop(W).tickSize(-
|
|
1363
|
+
if (U.append("g").attr("class", "grid").attr("transform", "translate(" + e + ", " + (m - 50) + ")").call(y).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"), b.db.topAxisEnabled() || x.topAxis) {
|
|
1364
|
+
let p = axisTop(W).tickSize(-m + f + x.gridLineStartPadding).tickFormat(timeFormat(v));
|
|
1365
1365
|
if (S !== null) {
|
|
1366
1366
|
let e = parseInt(S[1], 10);
|
|
1367
1367
|
if (isNaN(e) || e <= 0) log.warn(`Invalid tick interval value: "${S[1]}". Skipping custom tick interval.`);
|
|
1368
1368
|
else {
|
|
1369
|
-
let f = S[2], m =
|
|
1369
|
+
let f = S[2], m = b.db.getWeekday() || x.weekday, h = W.domain(), g = h[0], _ = h[1];
|
|
1370
1370
|
if (Y(g, _, e, f) <= MAX_TICK_COUNT) switch (f) {
|
|
1371
1371
|
case "millisecond":
|
|
1372
1372
|
p.ticks(millisecond.every(e));
|
|
@@ -1399,27 +1399,27 @@ var setConf = /* @__PURE__ */ __name(function() {
|
|
|
1399
1399
|
function Z(e, f) {
|
|
1400
1400
|
let p = 0, m = Object.keys(V).map((e) => [e, V[e]]);
|
|
1401
1401
|
U.append("g").selectAll("text").data(m).enter().append(function(e) {
|
|
1402
|
-
let f = e[0].split(common_default.lineBreakRegex), p = -(f.length - 1) / 2, m =
|
|
1402
|
+
let f = e[0].split(common_default.lineBreakRegex), p = -(f.length - 1) / 2, m = D.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1403
1403
|
m.setAttribute("dy", p + "em");
|
|
1404
1404
|
for (let [e, p] of f.entries()) {
|
|
1405
|
-
let f =
|
|
1405
|
+
let f = D.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
1406
1406
|
f.setAttribute("alignment-baseline", "central"), f.setAttribute("x", "10"), e > 0 && f.setAttribute("dy", "1em"), f.textContent = p, m.appendChild(f);
|
|
1407
1407
|
}
|
|
1408
1408
|
return m;
|
|
1409
1409
|
}).attr("x", 10).attr("y", function(h, g) {
|
|
1410
1410
|
if (g > 0) for (let _ = 0; _ < g; _++) return p += m[g - 1][1], h[1] * e / 2 + p * e + f;
|
|
1411
1411
|
else return h[1] * e / 2 + f;
|
|
1412
|
-
}).attr("font-size",
|
|
1413
|
-
for (let [f, p] of B.entries()) if (e[0] === p) return "sectionTitle sectionTitle" + f %
|
|
1412
|
+
}).attr("font-size", x.sectionFontSize).attr("class", function(e) {
|
|
1413
|
+
for (let [f, p] of B.entries()) if (e[0] === p) return "sectionTitle sectionTitle" + f % x.numberSectionStyles;
|
|
1414
1414
|
return "sectionTitle";
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
1417
|
__name(Z, "vertLabels");
|
|
1418
1418
|
function Q(e, f, p, m) {
|
|
1419
|
-
let h =
|
|
1419
|
+
let h = b.db.getTodayMarker();
|
|
1420
1420
|
if (h === "off") return;
|
|
1421
|
-
let g = U.append("g").attr("class", "today"), _ = /* @__PURE__ */ new Date(),
|
|
1422
|
-
|
|
1421
|
+
let g = U.append("g").attr("class", "today"), _ = /* @__PURE__ */ new Date(), v = g.append("line");
|
|
1422
|
+
v.attr("x1", W(_) + e).attr("x2", W(_) + e).attr("y1", x.titleTopMargin).attr("y2", m - x.titleTopMargin).attr("class", "today"), h !== "" && v.attr("style", h.replace(/,/g, ";"));
|
|
1423
1423
|
}
|
|
1424
1424
|
__name(Q, "drawToday");
|
|
1425
1425
|
function $(e) {
|