@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.
- 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/layout/StudioSidebar.js +116 -131
- package/dist/components/lists/ListView.js +46 -46
- 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/dashboard/AppLauncher.js +84 -0
- 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 +73 -73
- 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 +74 -109
- 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 +166 -136
- 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 +119 -18
- package/dist/index.js +10 -9
- 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/DashboardPage.js +20 -74
- 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/dist/routing/LocalRouter.js +1 -1
- package/package.json +2 -2
- package/dist/features/dashboard/Dashboard.js +0 -125
- package/dist/features/dashboard/RunItem.js +0 -78
- package/dist/features/dashboard/RunList.js +0 -32
- package/dist/hooks/useDashboard.js +0 -16
|
@@ -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 { clear, common_default, defaultConfig_default, getAccDescription, getAccTitle, getConfig, getConfig2, getDiagramTitle, setAccDescription, setAccTitle, setDiagramTitle, setupGraphViewbox2 } from "./chunk-CSCIHK7Q.js";
|
|
3
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
4
4
|
import "../../../../d3/src/index.js";
|
|
5
5
|
import { cleanAndMerge, random, utils_default } from "./chunk-5ZQYHXKU.js";
|
|
6
6
|
import { populateCommonDb } from "./chunk-4BX2VUAB.js";
|
|
@@ -56,13 +56,13 @@ var setDirection = /* @__PURE__ */ __name(function(i) {
|
|
|
56
56
|
}, "setOptions"), getOptions = /* @__PURE__ */ __name(function() {
|
|
57
57
|
return state.records.options;
|
|
58
58
|
}, "getOptions"), commit = /* @__PURE__ */ __name(function(i) {
|
|
59
|
-
let
|
|
60
|
-
log.info("commit",
|
|
59
|
+
let N = i.msg, F = i.id, L = i.type, R = i.tags;
|
|
60
|
+
log.info("commit", N, F, L, R), log.debug("Entering commit:", N, F, L, R);
|
|
61
61
|
let z = getConfig3();
|
|
62
|
-
|
|
62
|
+
F = common_default.sanitizeText(F, z), N = common_default.sanitizeText(N, z), R = R?.map((i) => common_default.sanitizeText(i, z));
|
|
63
63
|
let B = {
|
|
64
|
-
id:
|
|
65
|
-
message:
|
|
64
|
+
id: F || state.records.seq + "-" + getID(),
|
|
65
|
+
message: N,
|
|
66
66
|
seq: state.records.seq++,
|
|
67
67
|
type: L ?? commitType.NORMAL,
|
|
68
68
|
tags: R ?? [],
|
|
@@ -71,100 +71,100 @@ var setDirection = /* @__PURE__ */ __name(function(i) {
|
|
|
71
71
|
};
|
|
72
72
|
state.records.head = B, log.info("main branch", z.mainBranchName), state.records.commits.has(B.id) && log.warn(`Commit ID ${B.id} already exists`), state.records.commits.set(B.id, B), state.records.branches.set(state.records.currBranch, B.id), log.debug("in pushCommit " + B.id);
|
|
73
73
|
}, "commit"), branch = /* @__PURE__ */ __name(function(i) {
|
|
74
|
-
let
|
|
75
|
-
if (
|
|
76
|
-
state.records.branches.set(
|
|
77
|
-
name:
|
|
78
|
-
order:
|
|
79
|
-
}), checkout(
|
|
74
|
+
let N = i.name, F = i.order;
|
|
75
|
+
if (N = common_default.sanitizeText(N, getConfig3()), state.records.branches.has(N)) throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${N}")`);
|
|
76
|
+
state.records.branches.set(N, state.records.head == null ? null : state.records.head.id), state.records.branchConfig.set(N, {
|
|
77
|
+
name: N,
|
|
78
|
+
order: F
|
|
79
|
+
}), checkout(N), log.debug("in createBranch");
|
|
80
80
|
}, "branch"), merge = /* @__PURE__ */ __name((i) => {
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
let B = state.records.branches.get(state.records.currBranch), V = state.records.branches.get(
|
|
84
|
-
if (H && U && H.branch ===
|
|
85
|
-
if (state.records.currBranch ===
|
|
81
|
+
let N = i.branch, F = i.id, L = i.type, R = i.tags, z = getConfig3();
|
|
82
|
+
N = common_default.sanitizeText(N, z), F &&= common_default.sanitizeText(F, z);
|
|
83
|
+
let B = state.records.branches.get(state.records.currBranch), V = state.records.branches.get(N), H = B ? state.records.commits.get(B) : void 0, U = V ? state.records.commits.get(V) : void 0;
|
|
84
|
+
if (H && U && H.branch === N) throw Error(`Cannot merge branch '${N}' into itself.`);
|
|
85
|
+
if (state.records.currBranch === N) {
|
|
86
86
|
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Cannot merge a branch to itself");
|
|
87
87
|
throw i.hash = {
|
|
88
|
-
text: `merge ${
|
|
89
|
-
token: `merge ${
|
|
88
|
+
text: `merge ${N}`,
|
|
89
|
+
token: `merge ${N}`,
|
|
90
90
|
expected: ["branch abc"]
|
|
91
91
|
}, i;
|
|
92
92
|
}
|
|
93
93
|
if (H === void 0 || !H) {
|
|
94
94
|
let i = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${state.records.currBranch})has no commits`);
|
|
95
95
|
throw i.hash = {
|
|
96
|
-
text: `merge ${
|
|
97
|
-
token: `merge ${
|
|
96
|
+
text: `merge ${N}`,
|
|
97
|
+
token: `merge ${N}`,
|
|
98
98
|
expected: ["commit"]
|
|
99
99
|
}, i;
|
|
100
100
|
}
|
|
101
|
-
if (!state.records.branches.has(
|
|
102
|
-
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" +
|
|
101
|
+
if (!state.records.branches.has(N)) {
|
|
102
|
+
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + N + ") does not exist");
|
|
103
103
|
throw i.hash = {
|
|
104
|
-
text: `merge ${
|
|
105
|
-
token: `merge ${
|
|
106
|
-
expected: [`branch ${
|
|
104
|
+
text: `merge ${N}`,
|
|
105
|
+
token: `merge ${N}`,
|
|
106
|
+
expected: [`branch ${N}`]
|
|
107
107
|
}, i;
|
|
108
108
|
}
|
|
109
109
|
if (U === void 0 || !U) {
|
|
110
|
-
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" +
|
|
110
|
+
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + N + ") has no commits");
|
|
111
111
|
throw i.hash = {
|
|
112
|
-
text: `merge ${
|
|
113
|
-
token: `merge ${
|
|
112
|
+
text: `merge ${N}`,
|
|
113
|
+
token: `merge ${N}`,
|
|
114
114
|
expected: ["\"commit\""]
|
|
115
115
|
}, i;
|
|
116
116
|
}
|
|
117
117
|
if (H === U) {
|
|
118
118
|
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Both branches have same head");
|
|
119
119
|
throw i.hash = {
|
|
120
|
-
text: `merge ${
|
|
121
|
-
token: `merge ${
|
|
120
|
+
text: `merge ${N}`,
|
|
121
|
+
token: `merge ${N}`,
|
|
122
122
|
expected: ["branch abc"]
|
|
123
123
|
}, i;
|
|
124
124
|
}
|
|
125
|
-
if (
|
|
126
|
-
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" +
|
|
125
|
+
if (F && state.records.commits.has(F)) {
|
|
126
|
+
let i = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" + F + " already exists, use different custom id");
|
|
127
127
|
throw i.hash = {
|
|
128
|
-
text: `merge ${
|
|
129
|
-
token: `merge ${
|
|
130
|
-
expected: [`merge ${
|
|
128
|
+
text: `merge ${N} ${F} ${L} ${R?.join(" ")}`,
|
|
129
|
+
token: `merge ${N} ${F} ${L} ${R?.join(" ")}`,
|
|
130
|
+
expected: [`merge ${N} ${F}_UNIQUE ${L} ${R?.join(" ")}`]
|
|
131
131
|
}, i;
|
|
132
132
|
}
|
|
133
133
|
let W = V || "", G = {
|
|
134
|
-
id:
|
|
135
|
-
message: `merged branch ${
|
|
134
|
+
id: F || `${state.records.seq}-${getID()}`,
|
|
135
|
+
message: `merged branch ${N} into ${state.records.currBranch}`,
|
|
136
136
|
seq: state.records.seq++,
|
|
137
137
|
parents: state.records.head == null ? [] : [state.records.head.id, W],
|
|
138
138
|
branch: state.records.currBranch,
|
|
139
139
|
type: commitType.MERGE,
|
|
140
140
|
customType: L,
|
|
141
|
-
customId: !!
|
|
141
|
+
customId: !!F,
|
|
142
142
|
tags: R ?? []
|
|
143
143
|
};
|
|
144
144
|
state.records.head = G, state.records.commits.set(G.id, G), state.records.branches.set(state.records.currBranch, G.id), log.debug(state.records.branches), log.debug("in mergeBranch");
|
|
145
145
|
}, "merge"), cherryPick = /* @__PURE__ */ __name(function(i) {
|
|
146
|
-
let
|
|
147
|
-
log.debug("Entering cherryPick:",
|
|
146
|
+
let N = i.id, F = i.targetId, L = i.tags, R = i.parent;
|
|
147
|
+
log.debug("Entering cherryPick:", N, F, L);
|
|
148
148
|
let z = getConfig3();
|
|
149
|
-
if (
|
|
149
|
+
if (N = common_default.sanitizeText(N, z), F = common_default.sanitizeText(F, z), L = L?.map((i) => common_default.sanitizeText(i, z)), R = common_default.sanitizeText(R, z), !N || !state.records.commits.has(N)) {
|
|
150
150
|
let i = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
151
151
|
throw i.hash = {
|
|
152
|
-
text: `cherryPick ${
|
|
153
|
-
token: `cherryPick ${
|
|
152
|
+
text: `cherryPick ${N} ${F}`,
|
|
153
|
+
token: `cherryPick ${N} ${F}`,
|
|
154
154
|
expected: ["cherry-pick abc"]
|
|
155
155
|
}, i;
|
|
156
156
|
}
|
|
157
|
-
let B = state.records.commits.get(
|
|
157
|
+
let B = state.records.commits.get(N);
|
|
158
158
|
if (B === void 0 || !B) throw Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
159
159
|
if (R && !(Array.isArray(B.parents) && B.parents.includes(R))) throw /* @__PURE__ */ Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");
|
|
160
160
|
let V = B.branch;
|
|
161
161
|
if (B.type === commitType.MERGE && !R) throw /* @__PURE__ */ Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");
|
|
162
|
-
if (!
|
|
162
|
+
if (!F || !state.records.commits.has(F)) {
|
|
163
163
|
if (V === state.records.currBranch) {
|
|
164
164
|
let i = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit is already on current branch");
|
|
165
165
|
throw i.hash = {
|
|
166
|
-
text: `cherryPick ${
|
|
167
|
-
token: `cherryPick ${
|
|
166
|
+
text: `cherryPick ${N} ${F}`,
|
|
167
|
+
token: `cherryPick ${N} ${F}`,
|
|
168
168
|
expected: ["cherry-pick abc"]
|
|
169
169
|
}, i;
|
|
170
170
|
}
|
|
@@ -172,17 +172,17 @@ var setDirection = /* @__PURE__ */ __name(function(i) {
|
|
|
172
172
|
if (i === void 0 || !i) {
|
|
173
173
|
let i = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${state.records.currBranch})has no commits`);
|
|
174
174
|
throw i.hash = {
|
|
175
|
-
text: `cherryPick ${
|
|
176
|
-
token: `cherryPick ${
|
|
175
|
+
text: `cherryPick ${N} ${F}`,
|
|
176
|
+
token: `cherryPick ${N} ${F}`,
|
|
177
177
|
expected: ["cherry-pick abc"]
|
|
178
178
|
}, i;
|
|
179
179
|
}
|
|
180
|
-
let
|
|
181
|
-
if (
|
|
180
|
+
let I = state.records.commits.get(i);
|
|
181
|
+
if (I === void 0 || !I) {
|
|
182
182
|
let i = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${state.records.currBranch})has no commits`);
|
|
183
183
|
throw i.hash = {
|
|
184
|
-
text: `cherryPick ${
|
|
185
|
-
token: `cherryPick ${
|
|
184
|
+
text: `cherryPick ${N} ${F}`,
|
|
185
|
+
token: `cherryPick ${N} ${F}`,
|
|
186
186
|
expected: ["cherry-pick abc"]
|
|
187
187
|
}, i;
|
|
188
188
|
}
|
|
@@ -217,23 +217,23 @@ function upsert(i, N, P) {
|
|
|
217
217
|
}
|
|
218
218
|
__name(upsert, "upsert");
|
|
219
219
|
function prettyPrintCommitHistory(i) {
|
|
220
|
-
let
|
|
220
|
+
let N = i.reduce((i, N) => i.seq > N.seq ? i : N, i[0]), F = "";
|
|
221
221
|
i.forEach(function(i) {
|
|
222
|
-
i ===
|
|
222
|
+
i === N ? F += " *" : F += " |";
|
|
223
223
|
});
|
|
224
224
|
let I = [
|
|
225
225
|
F,
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
N.id,
|
|
227
|
+
N.seq
|
|
228
228
|
];
|
|
229
|
-
for (let i in state.records.branches) state.records.branches.get(i) ===
|
|
230
|
-
if (log.debug(I.join(" ")),
|
|
231
|
-
let
|
|
232
|
-
upsert(i,
|
|
233
|
-
} else if (
|
|
234
|
-
else if (
|
|
235
|
-
let
|
|
236
|
-
upsert(i,
|
|
229
|
+
for (let i in state.records.branches) state.records.branches.get(i) === N.id && I.push(i);
|
|
230
|
+
if (log.debug(I.join(" ")), N.parents && N.parents.length == 2 && N.parents[0] && N.parents[1]) {
|
|
231
|
+
let P = state.records.commits.get(N.parents[0]);
|
|
232
|
+
upsert(i, N, P), N.parents[1] && i.push(state.records.commits.get(N.parents[1]));
|
|
233
|
+
} else if (N.parents.length == 0) return;
|
|
234
|
+
else if (N.parents[0]) {
|
|
235
|
+
let P = state.records.commits.get(N.parents[0]);
|
|
236
|
+
upsert(i, N, P);
|
|
237
237
|
}
|
|
238
238
|
i = uniqBy(i, (i) => i.id), prettyPrintCommitHistory(i);
|
|
239
239
|
}
|
|
@@ -293,15 +293,15 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
293
293
|
}, populate = /* @__PURE__ */ __name((i, N) => {
|
|
294
294
|
populateCommonDb(i, N), i.dir && N.setDirection(i.dir);
|
|
295
295
|
for (let P of i.statements) parseStatement(P, N);
|
|
296
|
-
}, "populate"), parseStatement = /* @__PURE__ */ __name((
|
|
296
|
+
}, "populate"), parseStatement = /* @__PURE__ */ __name((i, F) => {
|
|
297
297
|
let I = {
|
|
298
298
|
Commit: /* @__PURE__ */ __name((i) => F.commit(parseCommit(i)), "Commit"),
|
|
299
299
|
Branch: /* @__PURE__ */ __name((i) => F.branch(parseBranch(i)), "Branch"),
|
|
300
300
|
Merge: /* @__PURE__ */ __name((i) => F.merge(parseMerge(i)), "Merge"),
|
|
301
301
|
Checkout: /* @__PURE__ */ __name((i) => F.checkout(parseCheckout(i)), "Checkout"),
|
|
302
302
|
CherryPicking: /* @__PURE__ */ __name((i) => F.cherryPick(parseCherryPicking(i)), "CherryPicking")
|
|
303
|
-
}[
|
|
304
|
-
I ? I(
|
|
303
|
+
}[i.$type];
|
|
304
|
+
I ? I(i) : log.error(`Unknown statement type: ${i.$type}`);
|
|
305
305
|
}, "parseStatement"), parseCommit = /* @__PURE__ */ __name((i) => ({
|
|
306
306
|
id: i.id,
|
|
307
307
|
msg: i.message ?? "",
|
|
@@ -321,8 +321,8 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
321
321
|
tags: i.tags?.length === 0 ? void 0 : i.tags,
|
|
322
322
|
parent: i.parent
|
|
323
323
|
}), "parseCherryPicking"), parser = { parse: /* @__PURE__ */ __name(async (i) => {
|
|
324
|
-
let
|
|
325
|
-
log.debug(
|
|
324
|
+
let N = await parse("gitGraph", i);
|
|
325
|
+
log.debug(N), populate(N, db);
|
|
326
326
|
}, "parse") }, LAYOUT_OFFSET = 10, COMMIT_STEP = 40, PX = 4, PY = 2, THEME_COLOR_LIMIT = 8, REDUX_GEOMETRY_THEMES = /* @__PURE__ */ new Set([
|
|
327
327
|
"redux",
|
|
328
328
|
"redux-dark",
|
|
@@ -341,9 +341,9 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
341
341
|
let P = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
342
342
|
P.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), P.setAttribute("dy", "1em"), P.setAttribute("x", "0"), P.setAttribute("class", "row"), P.textContent = i.trim(), N.appendChild(P);
|
|
343
343
|
}), N;
|
|
344
|
-
}, "drawText"), findClosestParent = /* @__PURE__ */ __name((
|
|
344
|
+
}, "drawText"), findClosestParent = /* @__PURE__ */ __name((i) => {
|
|
345
345
|
let P, F, I;
|
|
346
|
-
return dir === "BT" ? (F = /* @__PURE__ */ __name((i, N) => i <= N, "comparisonFunc"), I = Infinity) : (F = /* @__PURE__ */ __name((i, N) => i >= N, "comparisonFunc"), I = 0),
|
|
346
|
+
return dir === "BT" ? (F = /* @__PURE__ */ __name((i, N) => i <= N, "comparisonFunc"), I = Infinity) : (F = /* @__PURE__ */ __name((i, N) => i >= N, "comparisonFunc"), I = 0), i.forEach((i) => {
|
|
347
347
|
let N = dir === "TB" || dir == "BT" ? commitPos.get(i)?.y : commitPos.get(i)?.x;
|
|
348
348
|
N !== void 0 && F(N, I) && (P = i, I = N);
|
|
349
349
|
}), P;
|
|
@@ -399,18 +399,18 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
399
399
|
y: I
|
|
400
400
|
});
|
|
401
401
|
}, "setRootPosition"), drawCommitBullet = /* @__PURE__ */ __name((i, N, P, F, I, L) => {
|
|
402
|
-
let { theme: R } = getConfig2(), z = REDUX_GEOMETRY_THEMES.has(R ?? ""),
|
|
403
|
-
if (L === commitType.HIGHLIGHT) i.append("rect").attr("x", P.x - 10 + (z ? 3 : 0)).attr("y", P.y - 10 + (z ? 3 : 0)).attr("width", z ? 14 : 20).attr("height", z ? 14 : 20).attr("class", `commit ${N.id} commit-highlight${calcColorIndex(I, THEME_COLOR_LIMIT,
|
|
402
|
+
let { theme: R } = getConfig2(), z = REDUX_GEOMETRY_THEMES.has(R ?? ""), B = COLOR_THEMES.has(R ?? ""), H = DARK_THEMES.has(R ?? "");
|
|
403
|
+
if (L === commitType.HIGHLIGHT) i.append("rect").attr("x", P.x - 10 + (z ? 3 : 0)).attr("y", P.y - 10 + (z ? 3 : 0)).attr("width", z ? 14 : 20).attr("height", z ? 14 : 20).attr("class", `commit ${N.id} commit-highlight${calcColorIndex(I, THEME_COLOR_LIMIT, B)} ${F}-outer`), i.append("rect").attr("x", P.x - 6 + (z ? 2 : 0)).attr("y", P.y - 6 + (z ? 2 : 0)).attr("width", z ? 8 : 12).attr("height", z ? 8 : 12).attr("class", `commit ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT, B)} ${F}-inner`);
|
|
404
404
|
else if (L === commitType.CHERRY_PICK) i.append("circle").attr("cx", P.x).attr("cy", P.y).attr("r", z ? 7 : 10).attr("class", `commit ${N.id} ${F}`), i.append("circle").attr("cx", P.x - 3).attr("cy", P.y + 2).attr("r", z ? 2.5 : 2.75).attr("fill", H ? "#000000" : "#fff").attr("class", `commit ${N.id} ${F}`), i.append("circle").attr("cx", P.x + 3).attr("cy", P.y + 2).attr("r", z ? 2.5 : 2.75).attr("fill", H ? "#000000" : "#fff").attr("class", `commit ${N.id} ${F}`), i.append("line").attr("x1", P.x + 3).attr("y1", P.y + 1).attr("x2", P.x).attr("y2", P.y - 5).attr("stroke", H ? "#000000" : "#fff").attr("class", `commit ${N.id} ${F}`), i.append("line").attr("x1", P.x - 3).attr("y1", P.y + 1).attr("x2", P.x).attr("y2", P.y - 5).attr("stroke", H ? "#000000" : "#fff").attr("class", `commit ${N.id} ${F}`);
|
|
405
405
|
else {
|
|
406
406
|
let R = i.append("circle");
|
|
407
|
-
if (R.attr("cx", P.x), R.attr("cy", P.y), R.attr("r", z ? 7 : 10), R.attr("class", `commit ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT,
|
|
407
|
+
if (R.attr("cx", P.x), R.attr("cy", P.y), R.attr("r", z ? 7 : 10), R.attr("class", `commit ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT, B)}`), L === commitType.MERGE) {
|
|
408
408
|
let L = i.append("circle");
|
|
409
|
-
L.attr("cx", P.x), L.attr("cy", P.y), L.attr("r", z ? 5 : 6), L.attr("class", `commit ${F} ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT,
|
|
409
|
+
L.attr("cx", P.x), L.attr("cy", P.y), L.attr("r", z ? 5 : 6), L.attr("class", `commit ${F} ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT, B)}`);
|
|
410
410
|
}
|
|
411
411
|
if (L === commitType.REVERSE) {
|
|
412
412
|
let L = i.append("path"), R = z ? 4 : 5;
|
|
413
|
-
L.attr("d", `M ${P.x - R},${P.y - R}L${P.x + R},${P.y + R}M${P.x - R},${P.y + R}L${P.x + R},${P.y - R}`).attr("class", `commit ${F} ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT,
|
|
413
|
+
L.attr("d", `M ${P.x - R},${P.y - R}L${P.x + R},${P.y + R}M${P.x - R},${P.y + R}L${P.x + R},${P.y - R}`).attr("class", `commit ${F} ${N.id} commit${calcColorIndex(I, THEME_COLOR_LIMIT, B)}`);
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
}, "drawCommitBullet"), drawCommitLabel = /* @__PURE__ */ __name((i, N, P, F, I) => {
|
|
@@ -488,8 +488,8 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
488
488
|
y: dir === "TB" || dir === "BT" ? F : I + (R ? REDUX_BRANCH_LABEL_PADDING_Y / 2 + 1 : -2),
|
|
489
489
|
posWithOffset: F
|
|
490
490
|
};
|
|
491
|
-
}, "getCommitPosition"), drawCommits = /* @__PURE__ */ __name((
|
|
492
|
-
let L =
|
|
491
|
+
}, "getCommitPosition"), drawCommits = /* @__PURE__ */ __name((i, P, F, I) => {
|
|
492
|
+
let L = i.append("g").attr("class", "commit-bullets"), R = i.append("g").attr("class", "commit-labels"), z = dir === "TB" || dir === "BT" ? defaultPos : 0, B = [...P.keys()], V = I.parallelCommits ?? !1, H = /* @__PURE__ */ __name((i, N) => {
|
|
493
493
|
let F = P.get(i)?.seq, I = P.get(N)?.seq;
|
|
494
494
|
return F !== void 0 && I !== void 0 ? F - I : 0;
|
|
495
495
|
}, "sortKeys"), U = B.sort(H);
|
|
@@ -510,8 +510,8 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
510
510
|
y: B.y
|
|
511
511
|
}), z = dir === "BT" && V ? z + COMMIT_STEP : z + COMMIT_STEP + LAYOUT_OFFSET, z > maxPos && (maxPos = z);
|
|
512
512
|
});
|
|
513
|
-
}, "drawCommits"), shouldRerouteArrow = /* @__PURE__ */ __name((
|
|
514
|
-
let R = (dir === "TB" || dir === "BT" ? F.x < I.x : F.y < I.y) ? P.branch :
|
|
513
|
+
}, "drawCommits"), shouldRerouteArrow = /* @__PURE__ */ __name((i, P, F, I, L) => {
|
|
514
|
+
let R = (dir === "TB" || dir === "BT" ? F.x < I.x : F.y < I.y) ? P.branch : i.branch, z = /* @__PURE__ */ __name((i) => i.branch === R, "isOnBranchToGetCurve"), B = /* @__PURE__ */ __name((N) => N.seq > i.seq && N.seq < P.seq, "isBetweenCommits");
|
|
515
515
|
return [...L.values()].some((i) => B(i) && z(i));
|
|
516
516
|
}, "shouldRerouteArrow"), findLane = /* @__PURE__ */ __name((i, N, P = 0) => {
|
|
517
517
|
let F = i + Math.abs(i - N) / 2;
|
|
@@ -519,10 +519,10 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
519
519
|
}, "findLane"), drawArrow = /* @__PURE__ */ __name((i, N, P, F) => {
|
|
520
520
|
let { theme: I } = getConfig2(), L = COLOR_THEMES.has(I ?? ""), R = commitPos.get(N.id), z = commitPos.get(P.id);
|
|
521
521
|
if (R === void 0 || z === void 0) throw Error(`Commit positions not found for commits ${N.id} and ${P.id}`);
|
|
522
|
-
let
|
|
522
|
+
let B = shouldRerouteArrow(N, P, R, z, F), H = "", U = "", W = 0, G = 0, K = branchPos.get(P.branch)?.index;
|
|
523
523
|
P.type === commitType.MERGE && N.id !== P.parents[0] && (K = branchPos.get(N.branch)?.index);
|
|
524
524
|
let q;
|
|
525
|
-
if (
|
|
525
|
+
if (B) {
|
|
526
526
|
H = "A 10 10, 0, 0, 0,", U = "A 10 10, 0, 0, 1,", W = 10, G = 10;
|
|
527
527
|
let i = R.y < z.y ? findLane(R.y, z.y) : findLane(z.y, R.y), P = R.x < z.x ? findLane(R.x, z.x) : findLane(z.x, R.x);
|
|
528
528
|
dir === "TB" ? R.x < z.x ? q = `M ${R.x} ${R.y} L ${P - W} ${R.y} ${U} ${P} ${R.y + G} L ${P} ${z.y - W} ${H} ${P + G} ${z.y} L ${z.x} ${z.y}` : (K = branchPos.get(N.branch)?.index, q = `M ${R.x} ${R.y} L ${P + W} ${R.y} ${H} ${P} ${R.y + G} L ${P} ${z.y - W} ${U} ${P - G} ${z.y} L ${z.x} ${z.y}`) : dir === "BT" ? R.x < z.x ? q = `M ${R.x} ${R.y} L ${P - W} ${R.y} ${H} ${P} ${R.y - G} L ${P} ${z.y + W} ${U} ${P + G} ${z.y} L ${z.x} ${z.y}` : (K = branchPos.get(N.branch)?.index, q = `M ${R.x} ${R.y} L ${P + W} ${R.y} ${U} ${P} ${R.y - G} L ${P} ${z.y + W} ${H} ${P - G} ${z.y} L ${z.x} ${z.y}`) : R.y < z.y ? q = `M ${R.x} ${R.y} L ${R.x} ${i - W} ${H} ${R.x + G} ${i} L ${z.x - W} ${i} ${U} ${z.x} ${i + G} L ${z.x} ${z.y}` : (K = branchPos.get(N.branch)?.index, q = `M ${R.x} ${R.y} L ${R.x} ${i + W} ${U} ${R.x + G} ${i} L ${z.x - W} ${i} ${H} ${z.x} ${i - G} L ${z.x} ${z.y}`);
|
|
@@ -538,46 +538,46 @@ var prettyPrint = /* @__PURE__ */ __name(function() {
|
|
|
538
538
|
});
|
|
539
539
|
});
|
|
540
540
|
}, "drawArrows"), drawBranches = /* @__PURE__ */ __name((i, N, P, F) => {
|
|
541
|
-
let { look: I, theme: L, themeVariables: R } = getConfig2(), { dropShadow: z, THEME_COLOR_LIMIT:
|
|
541
|
+
let { look: I, theme: L, themeVariables: R } = getConfig2(), { dropShadow: z, THEME_COLOR_LIMIT: B } = R, H = REDUX_GEOMETRY_THEMES.has(L ?? ""), U = COLOR_THEMES.has(L ?? ""), W = i.append("g");
|
|
542
542
|
N.forEach((i, N) => {
|
|
543
|
-
let L = calcColorIndex(N, H ?
|
|
543
|
+
let L = calcColorIndex(N, H ? B : THEME_COLOR_LIMIT, U), R = branchPos.get(i.name)?.pos;
|
|
544
544
|
if (R === void 0) throw Error(`Position not found for branch ${i.name}`);
|
|
545
|
-
let
|
|
546
|
-
G.attr("x1", 0), G.attr("y1",
|
|
545
|
+
let V = dir === "TB" || dir === "BT" ? R : H ? R + REDUX_BRANCH_LABEL_PADDING_Y / 2 + 1 : R - 2, G = W.append("line");
|
|
546
|
+
G.attr("x1", 0), G.attr("y1", V), G.attr("x2", maxPos), G.attr("y2", V), G.attr("class", "branch branch" + L), dir === "TB" ? (G.attr("y1", defaultPos), G.attr("x1", R), G.attr("y2", maxPos), G.attr("x2", R)) : dir === "BT" && (G.attr("y1", maxPos), G.attr("x1", R), G.attr("y2", defaultPos), G.attr("x2", R)), lanes.push(V);
|
|
547
547
|
let K = i.name, q = drawText(K), J = W.insert("rect"), Y = W.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + L);
|
|
548
548
|
Y.node().appendChild(q);
|
|
549
549
|
let X = q.getBBox(), Z = H ? 0 : 4, Q = H ? 16 : 0, $ = H ? REDUX_BRANCH_LABEL_PADDING_Y : 0;
|
|
550
|
-
I === "neo" && J.attr("data-look", "neo"), J.attr("class", "branchLabelBkg label" + L).attr("style", I === "neo" ? `filter:${H ? `url(#${F}-drop-shadow)` : z}` : "").attr("rx", Z).attr("ry", Z).attr("x", -X.width - 4 - (P.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -X.height / 2 + 10).attr("width", X.width + 18 + Q).attr("height", X.height + 4 + $), Y.attr("transform", "translate(" + (-X.width - 14 - (P.rotateCommitLabel === !0 ? 30 : 0) + Q / 2) + ", " + (
|
|
550
|
+
I === "neo" && J.attr("data-look", "neo"), J.attr("class", "branchLabelBkg label" + L).attr("style", I === "neo" ? `filter:${H ? `url(#${F}-drop-shadow)` : z}` : "").attr("rx", Z).attr("ry", Z).attr("x", -X.width - 4 - (P.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -X.height / 2 + 10).attr("width", X.width + 18 + Q).attr("height", X.height + 4 + $), Y.attr("transform", "translate(" + (-X.width - 14 - (P.rotateCommitLabel === !0 ? 30 : 0) + Q / 2) + ", " + (V - X.height / 2 - 2) + ")"), dir === "TB" ? (J.attr("x", R - X.width / 2 - 10).attr("y", 0), Y.attr("transform", "translate(" + (R - X.width / 2 - 5) + ", 0)"), H && (J.attr("transform", `translate(${-Q / 2 - 3}, ${-$ - 10})`), Y.attr("transform", "translate(" + (R - X.width / 2 - 5) + ", " + (-$ * 2 + 7) + ")"))) : dir === "BT" ? (J.attr("x", R - X.width / 2 - 10).attr("y", maxPos), Y.attr("transform", "translate(" + (R - X.width / 2 - 5) + ", " + maxPos + ")"), H && (J.attr("transform", `translate(${-Q / 2 - 3}, ${$ + 10})`), Y.attr("transform", "translate(" + (R - X.width / 2 - 5) + ", " + (maxPos + $ * 2 + 4) + ")"))) : J.attr("transform", "translate(-19, " + (V - 12 - $ / 2) + ")");
|
|
551
551
|
});
|
|
552
552
|
}, "drawBranches"), setBranchPosition = /* @__PURE__ */ __name(function(i, N, P, F, I) {
|
|
553
553
|
return branchPos.set(i, {
|
|
554
554
|
pos: N,
|
|
555
555
|
index: P
|
|
556
556
|
}), N += 50 + (I ? 40 : 0) + (dir === "TB" || dir === "BT" ? F.width / 2 : 0), N;
|
|
557
|
-
}, "setBranchPosition"), gitGraphRenderer_default = { draw: /* @__PURE__ */ __name(function(
|
|
558
|
-
clear3(), log.debug("in gitgraph renderer",
|
|
559
|
-
let
|
|
560
|
-
if (!
|
|
557
|
+
}, "setBranchPosition"), gitGraphRenderer_default = { draw: /* @__PURE__ */ __name(function(N, F, I, L) {
|
|
558
|
+
clear3(), log.debug("in gitgraph renderer", N + "\n", "id:", F, I);
|
|
559
|
+
let R = L.db;
|
|
560
|
+
if (!R.getConfig) {
|
|
561
561
|
log.error("getConfig method is not available on db");
|
|
562
562
|
return;
|
|
563
563
|
}
|
|
564
|
-
let
|
|
565
|
-
allCommitsDict =
|
|
566
|
-
let
|
|
567
|
-
dir =
|
|
568
|
-
let
|
|
564
|
+
let z = R.getConfig(), B = z.rotateCommitLabel ?? !1;
|
|
565
|
+
allCommitsDict = R.getCommits();
|
|
566
|
+
let H = R.getBranchesAsObjArray();
|
|
567
|
+
dir = R.getDirection();
|
|
568
|
+
let U = select_default(`[id="${F}"]`), { look: W, theme: G, themeVariables: q } = getConfig2(), { useGradient: J, gradientStart: X, gradientStop: Z, filterColor: Q } = q;
|
|
569
569
|
if (J) {
|
|
570
|
-
let i =
|
|
570
|
+
let i = U.append("defs").append("linearGradient").attr("id", F + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
|
|
571
571
|
i.append("stop").attr("offset", "0%").attr("stop-color", X).attr("stop-opacity", 1), i.append("stop").attr("offset", "100%").attr("stop-color", Z).attr("stop-opacity", 1);
|
|
572
572
|
}
|
|
573
|
-
|
|
573
|
+
W === "neo" && REDUX_GEOMETRY_THEMES.has(G ?? "") && U.append("defs").append("filter").attr("id", F + "-drop-shadow").attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", Q);
|
|
574
574
|
let $ = 0;
|
|
575
|
-
|
|
576
|
-
let P = drawText(i.name), F =
|
|
575
|
+
H.forEach((i, N) => {
|
|
576
|
+
let P = drawText(i.name), F = U.append("g"), I = F.insert("g").attr("class", "branchLabel"), L = I.insert("g").attr("class", "label branch-label");
|
|
577
577
|
L.node()?.appendChild(P);
|
|
578
578
|
let R = P.getBBox();
|
|
579
|
-
$ = setBranchPosition(i.name, $, N, R,
|
|
580
|
-
}), drawCommits(
|
|
579
|
+
$ = setBranchPosition(i.name, $, N, R, B), L.remove(), I.remove(), F.remove();
|
|
580
|
+
}), drawCommits(U, allCommitsDict, !1, z), z.showBranches && drawBranches(U, H, z, F), drawArrows(U, allCommitsDict), drawCommits(U, allCommitsDict, !0, z), utils_default.insertTitle(U, "gitTitleText", z.titleTopMargin ?? 0, R.getDiagramTitle()), setupGraphViewbox2(void 0, U, z.diagramPadding, z.useMaxWidth);
|
|
581
581
|
}, "draw") }, GIT_NAMED_COLOR_COUNT = 8, REDUX_GEOMETRY_THEMES2 = /* @__PURE__ */ new Set([
|
|
582
582
|
"redux",
|
|
583
583
|
"redux-dark",
|