@foris/ai-agent 0.7.0 → 0.7.1-beta.2
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/_baseUniq-Bo-J_G8t.js +479 -0
- package/dist/ai-agent.es.js +1 -1
- package/dist/ai-agent.umd.js +504 -504
- package/dist/ai-chat-panel/ChatPanel.d.ts +3 -2
- package/dist/{arc-D25sVj89.js → arc-D6vW-5z7.js} +1 -1
- package/dist/architecture-U656AL7Q-CPDaOg6H.js +11 -0
- package/dist/{architectureDiagram-VXUJARFQ-Cgk-YoAJ.js → architectureDiagram-VXUJARFQ-aNTRrbg8.js} +8 -6
- package/dist/{blockDiagram-VD42YOAC-DEl6OtG0.js → blockDiagram-VD42YOAC-D__rdg-y.js} +801 -937
- package/dist/{c4Diagram-YG6GDRKO-C_brDMc_.js → c4Diagram-YG6GDRKO-Ad-zGtIo.js} +3 -3
- package/dist/{channel-BP0bUxGp.js → channel-CJ6nZxxi.js} +1 -1
- package/dist/{chunk-4BX2VUAB-C5fELlqE.js → chunk-4BX2VUAB-sv6CSdNg.js} +1 -1
- package/dist/{chunk-55IACEB6-DaHkCIMI.js → chunk-55IACEB6-tWLXzb2x.js} +1 -1
- package/dist/{chunk-B4BG7PRW-C2Vtaq9f.js → chunk-B4BG7PRW-wp7Bc04i.js} +4 -4
- package/dist/{chunk-DI55MBZ5-DmM1ZmJ9.js → chunk-DI55MBZ5-BAXA-Ihc.js} +3 -3
- package/dist/{chunk-FMBD7UC4-MWLCTT_V.js → chunk-FMBD7UC4-CqgCvnFf.js} +1 -1
- package/dist/{chunk-QN33PNHL-BFfd-KsX.js → chunk-QN33PNHL-Xr4FEi7o.js} +1 -1
- package/dist/{chunk-QZHKN3VN-DvYwzcYM.js → chunk-QZHKN3VN-CW0xSatw.js} +1 -1
- package/dist/{chunk-TZMSLE5B-B_VLLszl.js → chunk-TZMSLE5B-CG4p6VwM.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG-CEjscqbc.js → classDiagram-2ON5EDUG-BwMk_mJR.js} +6 -6
- package/dist/{classDiagram-v2-WZHVMYZB-CEjscqbc.js → classDiagram-v2-WZHVMYZB-BwMk_mJR.js} +6 -6
- package/dist/clone-42WwOfNY.js +8 -0
- package/dist/{code-block-QI2IAROF-MPMUtVbZ.js → code-block-QI2IAROF-Dmk5lA1i.js} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-DNnmrjSK.js → cose-bilkent-S5V4N54A-CQVvTQey.js} +2 -2
- package/dist/{dagre-6UL2VRFP-c7TGz1C2.js → dagre-6UL2VRFP-CZLotLZh.js} +54 -55
- package/dist/{diagram-PSM6KHXK-CyVHRF5H.js → diagram-PSM6KHXK-99LoQEL6.js} +9 -7
- package/dist/{diagram-QEK2KX5R-BQj43c4D.js → diagram-QEK2KX5R-Bcf8pK3Z.js} +8 -6
- package/dist/{diagram-S2PKOQOG-Dp2Zxf6h.js → diagram-S2PKOQOG-Bc7Lic_C.js} +12 -10
- package/dist/{erDiagram-Q2GNP2WA-UU_sJ3Nk.js → erDiagram-Q2GNP2WA-Bdr3nWHa.js} +5 -5
- package/dist/{flowDiagram-NV44I4VS-DmHh0Mw6.js → flowDiagram-NV44I4VS-By1cH5Mx.js} +6 -6
- package/dist/{ganttDiagram-JELNMOA3-B2DD6FxH.js → ganttDiagram-JELNMOA3-DBUWvf88.js} +3 -3
- package/dist/gitGraph-F6HP7TQM-DyZaN85C.js +11 -0
- package/dist/{gitGraphDiagram-NY62KEGX-BIUvS6sD.js → gitGraphDiagram-NY62KEGX-D201ZDzD.js} +71 -69
- package/dist/graph-vxIytVZ1.js +381 -0
- package/dist/{index-DWpc-Mxs.js → index-2q9HQ6jv.js} +4157 -4170
- package/dist/info-NVLQJR56-Bk44kkrd.js +11 -0
- package/dist/infoDiagram-WHAUD3N6-CQvG7eEX.js +29 -0
- package/dist/{journeyDiagram-XKPGCS4Q-Dia_QTZe.js → journeyDiagram-XKPGCS4Q-BO4UASto.js} +5 -5
- package/dist/{kanban-definition-3W4ZIXB7-ClIKCv5J.js → kanban-definition-3W4ZIXB7-zTTXrQZo.js} +3 -3
- package/dist/layout-CFP0NQPV.js +1443 -0
- package/dist/{linear-ZyP8gWvJ.js → linear-DQjYFf2K.js} +25 -25
- package/dist/{mermaid-NA5CF7SZ-BbXrnAMx.js → mermaid-NA5CF7SZ-Dxy04QGl.js} +1 -1
- package/dist/{treemap-KMMF4GRG-D_L55G0b.js → mermaid-parser.core-3bjcG0rb.js} +5934 -5793
- package/dist/{mermaid.core-Ce2qm3MW.js → mermaid.core-D77TS0_l.js} +112 -88
- package/dist/min-D8aWZ538.js +38 -0
- package/dist/{mindmap-definition-VGOIOE7T-CUj7ttm7.js → mindmap-definition-VGOIOE7T-C4eFUgdU.js} +15 -15
- package/dist/packet-BFZMPI3H-BXyr1-Ur.js +11 -0
- package/dist/pie-7BOR55EZ-BdDEpKOx.js +11 -0
- package/dist/pieDiagram-ADFJNKIX-Cagn8I7E.js +168 -0
- package/dist/{quadrantDiagram-AYHSOK5B-C4-Gx7bz.js → quadrantDiagram-AYHSOK5B-CBbS2k6R.js} +3 -3
- package/dist/radar-NHE76QYJ-rrlsBycr.js +11 -0
- package/dist/{requirementDiagram-UZGBJVZJ-Cr3_wZVs.js → requirementDiagram-UZGBJVZJ-BubvO9b2.js} +4 -4
- package/dist/{sankeyDiagram-TZEHDZUN-DqXQCv8A.js → sankeyDiagram-TZEHDZUN-2TYAQPq1.js} +2 -2
- package/dist/{sequenceDiagram-WL72ISMW-DFW243PP.js → sequenceDiagram-WL72ISMW-C5LXKyO6.js} +4 -4
- package/dist/{stateDiagram-FKZM4ZOC-C7xue1N-.js → stateDiagram-FKZM4ZOC-tqWNEvX8.js} +11 -9
- package/dist/{stateDiagram-v2-4FDKWEC3-CxbMhTx0.js → stateDiagram-v2-4FDKWEC3-DwNtkzmN.js} +5 -5
- package/dist/style.css +1 -1
- package/dist/{timeline-definition-IT6M3QCI-HXVoEY4s.js → timeline-definition-IT6M3QCI-DsDBzGHV.js} +3 -3
- package/dist/treemap-KMMF4GRG-BNrkQfZw.js +11 -0
- package/dist/{xychartDiagram-PRI3JC2R-7Isc60Pi.js → xychartDiagram-PRI3JC2R-C96721pe.js} +3 -3
- package/package.json +1 -1
- package/dist/graph-DB2UxkYH.js +0 -1190
- package/dist/infoDiagram-WHAUD3N6-Cz5rmERs.js +0 -27
- package/dist/layout-Q6wQN5dr.js +0 -1730
- package/dist/pieDiagram-ADFJNKIX-w5KEkOWO.js +0 -166
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { p as Z } from "./chunk-4BX2VUAB-
|
|
2
|
-
import { I as F } from "./chunk-QZHKN3VN-
|
|
3
|
-
import { E as U, _ as h, d as rr, F as er, G as tr, H as ar, l as m, s as nr, g as sr, b as or, c as cr, o as ir, p as dr, e as B, v as hr, j as lr, u as $r, I as fr } from "./mermaid.core-
|
|
4
|
-
import { p as gr } from "./
|
|
5
|
-
import "./index-
|
|
1
|
+
import { p as Z } from "./chunk-4BX2VUAB-sv6CSdNg.js";
|
|
2
|
+
import { I as F } from "./chunk-QZHKN3VN-CW0xSatw.js";
|
|
3
|
+
import { E as U, _ as h, d as rr, F as er, G as tr, H as ar, l as m, s as nr, g as sr, b as or, c as cr, o as ir, p as dr, e as B, v as hr, j as lr, u as $r, I as fr } from "./mermaid.core-D77TS0_l.js";
|
|
4
|
+
import { p as gr } from "./mermaid-parser.core-3bjcG0rb.js";
|
|
5
|
+
import "./index-2q9HQ6jv.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
|
|
8
|
+
import "./min-D8aWZ538.js";
|
|
9
|
+
import "./_baseUniq-Bo-J_G8t.js";
|
|
10
|
+
var x = {
|
|
9
11
|
NORMAL: 0,
|
|
10
12
|
REVERSE: 1,
|
|
11
13
|
HIGHLIGHT: 2,
|
|
@@ -40,16 +42,16 @@ function N(t, r) {
|
|
|
40
42
|
}, []);
|
|
41
43
|
}
|
|
42
44
|
h(N, "uniqBy");
|
|
43
|
-
var
|
|
45
|
+
var pr = /* @__PURE__ */ h(function(t) {
|
|
44
46
|
i.records.direction = t;
|
|
45
|
-
}, "setDirection"),
|
|
47
|
+
}, "setDirection"), xr = /* @__PURE__ */ h(function(t) {
|
|
46
48
|
m.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
|
|
47
49
|
try {
|
|
48
50
|
i.records.options = JSON.parse(t);
|
|
49
51
|
} catch (r) {
|
|
50
52
|
m.error("error while parsing gitGraph options", r.message);
|
|
51
53
|
}
|
|
52
|
-
}, "setOptions"),
|
|
54
|
+
}, "setOptions"), ur = /* @__PURE__ */ h(function() {
|
|
53
55
|
return i.records.options;
|
|
54
56
|
}, "getOptions"), br = /* @__PURE__ */ h(function(t) {
|
|
55
57
|
let r = t.msg, a = t.id;
|
|
@@ -62,7 +64,7 @@ var xr = /* @__PURE__ */ h(function(t) {
|
|
|
62
64
|
id: a || i.records.seq + "-" + j(),
|
|
63
65
|
message: r,
|
|
64
66
|
seq: i.records.seq++,
|
|
65
|
-
type: s ??
|
|
67
|
+
type: s ?? x.NORMAL,
|
|
66
68
|
tags: e ?? [],
|
|
67
69
|
parents: i.records.head == null ? [] : [i.records.head.id],
|
|
68
70
|
branch: i.records.currBranch
|
|
@@ -147,7 +149,7 @@ var xr = /* @__PURE__ */ h(function(t) {
|
|
|
147
149
|
seq: i.records.seq++,
|
|
148
150
|
parents: i.records.head == null ? [] : [i.records.head.id, f],
|
|
149
151
|
branch: i.records.currBranch,
|
|
150
|
-
type:
|
|
152
|
+
type: x.MERGE,
|
|
151
153
|
customType: s,
|
|
152
154
|
customId: !!a,
|
|
153
155
|
tags: e ?? []
|
|
@@ -175,7 +177,7 @@ var xr = /* @__PURE__ */ h(function(t) {
|
|
|
175
177
|
"Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
|
|
176
178
|
);
|
|
177
179
|
const o = c.branch;
|
|
178
|
-
if (c.type ===
|
|
180
|
+
if (c.type === x.MERGE && !e)
|
|
179
181
|
throw new Error(
|
|
180
182
|
"Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
|
|
181
183
|
);
|
|
@@ -218,9 +220,9 @@ var xr = /* @__PURE__ */ h(function(t) {
|
|
|
218
220
|
seq: i.records.seq++,
|
|
219
221
|
parents: i.records.head == null ? [] : [i.records.head.id, c.id],
|
|
220
222
|
branch: i.records.currBranch,
|
|
221
|
-
type:
|
|
223
|
+
type: x.CHERRY_PICK,
|
|
222
224
|
tags: s ? s.filter(Boolean) : [
|
|
223
|
-
`cherry-pick:${c.id}${c.type ===
|
|
225
|
+
`cherry-pick:${c.id}${c.type === x.MERGE ? `|parent:${e}` : ""}`
|
|
224
226
|
]
|
|
225
227
|
};
|
|
226
228
|
i.records.head = f, i.records.commits.set(f.id, f), i.records.branches.set(i.records.currBranch, f.id), m.debug(i.records.branches), m.debug("in cherryPick");
|
|
@@ -296,11 +298,11 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
296
298
|
}, "getDirection"), Rr = /* @__PURE__ */ h(function() {
|
|
297
299
|
return i.records.head;
|
|
298
300
|
}, "getHead"), X = {
|
|
299
|
-
commitType:
|
|
301
|
+
commitType: x,
|
|
300
302
|
getConfig: z,
|
|
301
|
-
setDirection:
|
|
302
|
-
setOptions:
|
|
303
|
-
getOptions:
|
|
303
|
+
setDirection: pr,
|
|
304
|
+
setOptions: xr,
|
|
305
|
+
getOptions: ur,
|
|
304
306
|
commit: br,
|
|
305
307
|
branch: mr,
|
|
306
308
|
merge: wr,
|
|
@@ -338,7 +340,7 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
338
340
|
}, "parseStatement"), Or = /* @__PURE__ */ h((t) => ({
|
|
339
341
|
id: t.id,
|
|
340
342
|
msg: t.message ?? "",
|
|
341
|
-
type: t.type !== void 0 ?
|
|
343
|
+
type: t.type !== void 0 ? x[t.type] : x.NORMAL,
|
|
342
344
|
tags: t.tags ?? void 0
|
|
343
345
|
}), "parseCommit"), zr = /* @__PURE__ */ h((t) => ({
|
|
344
346
|
name: t.name,
|
|
@@ -346,7 +348,7 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
346
348
|
}), "parseBranch"), Gr = /* @__PURE__ */ h((t) => ({
|
|
347
349
|
branch: t.branch,
|
|
348
350
|
id: t.id ?? "",
|
|
349
|
-
type: t.type !== void 0 ?
|
|
351
|
+
type: t.type !== void 0 ? x[t.type] : void 0,
|
|
350
352
|
tags: t.tags ?? void 0
|
|
351
353
|
}), "parseMerge"), Hr = /* @__PURE__ */ h((t) => t.branch, "parseCheckout"), Pr = /* @__PURE__ */ h((t) => {
|
|
352
354
|
var a;
|
|
@@ -361,8 +363,8 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
361
363
|
const r = await gr("gitGraph", t);
|
|
362
364
|
m.debug(r), Ir(r, X);
|
|
363
365
|
}, "parse")
|
|
364
|
-
}, S = rr(), b = S == null ? void 0 : S.gitGraph, R = 10, I = 40, k = 4, L = 2, O = 8, C = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), P = 30, G = /* @__PURE__ */ new Map(), W = [], M = 0,
|
|
365
|
-
C.clear(), E.clear(), G.clear(), M = 0, W = [],
|
|
366
|
+
}, S = rr(), b = S == null ? void 0 : S.gitGraph, R = 10, I = 40, k = 4, L = 2, O = 8, C = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), P = 30, G = /* @__PURE__ */ new Map(), W = [], M = 0, p = "LR", jr = /* @__PURE__ */ h(() => {
|
|
367
|
+
C.clear(), E.clear(), G.clear(), M = 0, W = [], p = "LR";
|
|
366
368
|
}, "clear"), J = /* @__PURE__ */ h((t) => {
|
|
367
369
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
368
370
|
return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((s) => {
|
|
@@ -371,9 +373,9 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
371
373
|
}), r;
|
|
372
374
|
}, "drawText"), Q = /* @__PURE__ */ h((t) => {
|
|
373
375
|
let r, a, s;
|
|
374
|
-
return
|
|
376
|
+
return p === "BT" ? (a = /* @__PURE__ */ h((e, n) => e <= n, "comparisonFunc"), s = 1 / 0) : (a = /* @__PURE__ */ h((e, n) => e >= n, "comparisonFunc"), s = 0), t.forEach((e) => {
|
|
375
377
|
var c, o;
|
|
376
|
-
const n =
|
|
378
|
+
const n = p === "TB" || p == "BT" ? (c = E.get(e)) == null ? void 0 : c.y : (o = E.get(e)) == null ? void 0 : o.x;
|
|
377
379
|
n !== void 0 && a(n, s) && (r = e, s = n);
|
|
378
380
|
}), r;
|
|
379
381
|
}, "findClosestParent"), Sr = /* @__PURE__ */ h((t) => {
|
|
@@ -423,7 +425,7 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
423
425
|
const e = r + a, n = s.pos;
|
|
424
426
|
E.set(t.id, { x: n, y: e });
|
|
425
427
|
}, "setRootPosition"), _r = /* @__PURE__ */ h((t, r, a, s, e, n) => {
|
|
426
|
-
if (n ===
|
|
428
|
+
if (n === x.HIGHLIGHT)
|
|
427
429
|
t.append("rect").attr("x", a.x - 10).attr("y", a.y - 10).attr("width", 20).attr("height", 20).attr(
|
|
428
430
|
"class",
|
|
429
431
|
`commit ${r.id} commit-highlight${e % O} ${s}-outer`
|
|
@@ -431,28 +433,28 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
431
433
|
"class",
|
|
432
434
|
`commit ${r.id} commit${e % O} ${s}-inner`
|
|
433
435
|
);
|
|
434
|
-
else if (n ===
|
|
436
|
+
else if (n === x.CHERRY_PICK)
|
|
435
437
|
t.append("circle").attr("cx", a.x).attr("cy", a.y).attr("r", 10).attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x - 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x + 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x + 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x - 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`);
|
|
436
438
|
else {
|
|
437
439
|
const c = t.append("circle");
|
|
438
|
-
if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type ===
|
|
440
|
+
if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type === x.MERGE ? 9 : 10), c.attr("class", `commit ${r.id} commit${e % O}`), n === x.MERGE) {
|
|
439
441
|
const o = t.append("circle");
|
|
440
442
|
o.attr("cx", a.x), o.attr("cy", a.y), o.attr("r", 6), o.attr(
|
|
441
443
|
"class",
|
|
442
444
|
`commit ${s} ${r.id} commit${e % O}`
|
|
443
445
|
);
|
|
444
446
|
}
|
|
445
|
-
n ===
|
|
447
|
+
n === x.REVERSE && t.append("path").attr(
|
|
446
448
|
"d",
|
|
447
449
|
`M ${a.x - 5},${a.y - 5}L${a.x + 5},${a.y + 5}M${a.x - 5},${a.y + 5}L${a.x + 5},${a.y - 5}`
|
|
448
450
|
).attr("class", `commit ${s} ${r.id} commit${e % O}`);
|
|
449
451
|
}
|
|
450
452
|
}, "drawCommitBullet"), Vr = /* @__PURE__ */ h((t, r, a, s) => {
|
|
451
453
|
var e;
|
|
452
|
-
if (r.type !==
|
|
454
|
+
if (r.type !== x.CHERRY_PICK && (r.customId && r.type === x.MERGE || r.type !== x.MERGE) && (b != null && b.showCommitLabel)) {
|
|
453
455
|
const n = t.append("g"), c = n.insert("rect").attr("class", "commit-label-bkg"), o = n.append("text").attr("x", s).attr("y", a.y + 25).attr("class", "commit-label").text(r.id), $ = (e = o.node()) == null ? void 0 : e.getBBox();
|
|
454
|
-
if ($ && (c.attr("x", a.posWithOffset - $.width / 2 - L).attr("y", a.y + 13.5).attr("width", $.width + 2 * L).attr("height", $.height + 2 * L),
|
|
455
|
-
if (
|
|
456
|
+
if ($ && (c.attr("x", a.posWithOffset - $.width / 2 - L).attr("y", a.y + 13.5).attr("width", $.width + 2 * L).attr("height", $.height + 2 * L), p === "TB" || p === "BT" ? (c.attr("x", a.x - ($.width + 4 * k + 5)).attr("y", a.y - 12), o.attr("x", a.x - ($.width + 4 * k)).attr("y", a.y + $.height - 12)) : o.attr("x", a.posWithOffset - $.width / 2), b.rotateCommitLabel))
|
|
457
|
+
if (p === "TB" || p === "BT")
|
|
456
458
|
o.attr(
|
|
457
459
|
"transform",
|
|
458
460
|
"rotate(-45, " + a.x + ", " + a.y + ")"
|
|
@@ -485,17 +487,17 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
485
487
|
}), n += 20;
|
|
486
488
|
}
|
|
487
489
|
for (const { tag: l, hole: f, rect: g, yOffset: d } of $) {
|
|
488
|
-
const y = o / 2,
|
|
490
|
+
const y = o / 2, u = a.y - 19.2 - d;
|
|
489
491
|
if (g.attr("class", "tag-label-bkg").attr(
|
|
490
492
|
"points",
|
|
491
493
|
`
|
|
492
|
-
${s - c / 2 - k / 2},${
|
|
493
|
-
${s - c / 2 - k / 2},${
|
|
494
|
-
${a.posWithOffset - c / 2 - k},${
|
|
495
|
-
${a.posWithOffset + c / 2 + k},${
|
|
496
|
-
${a.posWithOffset + c / 2 + k},${
|
|
497
|
-
${a.posWithOffset - c / 2 - k},${
|
|
498
|
-
), f.attr("cy",
|
|
494
|
+
${s - c / 2 - k / 2},${u + L}
|
|
495
|
+
${s - c / 2 - k / 2},${u - L}
|
|
496
|
+
${a.posWithOffset - c / 2 - k},${u - y - L}
|
|
497
|
+
${a.posWithOffset + c / 2 + k},${u - y - L}
|
|
498
|
+
${a.posWithOffset + c / 2 + k},${u + y + L}
|
|
499
|
+
${a.posWithOffset - c / 2 - k},${u + y + L}`
|
|
500
|
+
), f.attr("cy", u).attr("cx", s - c / 2 + k / 2).attr("r", 1.5).attr("class", "tag-hole"), p === "TB" || p === "BT") {
|
|
499
501
|
const w = s + d;
|
|
500
502
|
g.attr("class", "tag-label-bkg").attr(
|
|
501
503
|
"points",
|
|
@@ -512,15 +514,15 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
512
514
|
}
|
|
513
515
|
}, "drawCommitTags"), Jr = /* @__PURE__ */ h((t) => {
|
|
514
516
|
switch (t.customType ?? t.type) {
|
|
515
|
-
case
|
|
517
|
+
case x.NORMAL:
|
|
516
518
|
return "commit-normal";
|
|
517
|
-
case
|
|
519
|
+
case x.REVERSE:
|
|
518
520
|
return "commit-reverse";
|
|
519
|
-
case
|
|
521
|
+
case x.HIGHLIGHT:
|
|
520
522
|
return "commit-highlight";
|
|
521
|
-
case
|
|
523
|
+
case x.MERGE:
|
|
522
524
|
return "commit-merge";
|
|
523
|
-
case
|
|
525
|
+
case x.CHERRY_PICK:
|
|
524
526
|
return "commit-cherry-pick";
|
|
525
527
|
default:
|
|
526
528
|
return "commit-normal";
|
|
@@ -538,7 +540,7 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
538
540
|
return 0;
|
|
539
541
|
}, "calculatePosition"), Zr = /* @__PURE__ */ h((t, r, a) => {
|
|
540
542
|
var c, o;
|
|
541
|
-
const s =
|
|
543
|
+
const s = p === "BT" && a ? r : r + R, e = p === "TB" || p === "BT" ? s : (c = C.get(t.branch)) == null ? void 0 : c.pos, n = p === "TB" || p === "BT" ? (o = C.get(t.branch)) == null ? void 0 : o.pos : s;
|
|
542
544
|
if (n === void 0 || e === void 0)
|
|
543
545
|
throw new Error(`Position were undefined for commit ${t.id}`);
|
|
544
546
|
return { x: n, y: e, posWithOffset: s };
|
|
@@ -546,28 +548,28 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
546
548
|
if (!b)
|
|
547
549
|
throw new Error("GitGraph config not found");
|
|
548
550
|
const s = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
|
|
549
|
-
let n =
|
|
551
|
+
let n = p === "TB" || p === "BT" ? P : 0;
|
|
550
552
|
const c = [...r.keys()], o = (b == null ? void 0 : b.parallelCommits) ?? !1, $ = /* @__PURE__ */ h((f, g) => {
|
|
551
|
-
var
|
|
552
|
-
const d = (
|
|
553
|
+
var u, w;
|
|
554
|
+
const d = (u = r.get(f)) == null ? void 0 : u.seq, y = (w = r.get(g)) == null ? void 0 : w.seq;
|
|
553
555
|
return d !== void 0 && y !== void 0 ? d - y : 0;
|
|
554
556
|
}, "sortKeys");
|
|
555
557
|
let l = c.sort($);
|
|
556
|
-
|
|
558
|
+
p === "BT" && (o && Ar(l, r, n), l = l.reverse()), l.forEach((f) => {
|
|
557
559
|
var y;
|
|
558
560
|
const g = r.get(f);
|
|
559
561
|
if (!g)
|
|
560
562
|
throw new Error(`Commit not found for key ${f}`);
|
|
561
|
-
o && (n = Qr(g,
|
|
563
|
+
o && (n = Qr(g, p, n, E));
|
|
562
564
|
const d = Zr(g, n, o);
|
|
563
565
|
if (a) {
|
|
564
|
-
const
|
|
565
|
-
_r(s, g, d,
|
|
566
|
+
const u = Jr(g), w = g.customType ?? g.type, q = ((y = C.get(g.branch)) == null ? void 0 : y.index) ?? 0;
|
|
567
|
+
_r(s, g, d, u, q, w), Vr(e, g, d, n), Xr(e, g, d, n);
|
|
566
568
|
}
|
|
567
|
-
|
|
569
|
+
p === "TB" || p === "BT" ? E.set(g.id, { x: d.x, y: d.posWithOffset }) : E.set(g.id, { x: d.posWithOffset, y: d.y }), n = p === "BT" && o ? n + I : n + I + R, n > M && (M = n);
|
|
568
570
|
});
|
|
569
571
|
}, "drawCommits"), Fr = /* @__PURE__ */ h((t, r, a, s, e) => {
|
|
570
|
-
const c = (
|
|
572
|
+
const c = (p === "TB" || p === "BT" ? a.x < s.x : a.y < s.y) ? r.branch : t.branch, o = /* @__PURE__ */ h((l) => l.branch === c, "isOnBranchToGetCurve"), $ = /* @__PURE__ */ h((l) => l.seq > t.seq && l.seq < r.seq, "isBetweenCommits");
|
|
571
573
|
return [...e.values()].some((l) => $(l) && o(l));
|
|
572
574
|
}, "shouldRerouteArrow"), H = /* @__PURE__ */ h((t, r, a = 0) => {
|
|
573
575
|
const s = t + Math.abs(t - r) / 2;
|
|
@@ -578,20 +580,20 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
578
580
|
const n = Math.abs(t - r);
|
|
579
581
|
return H(t, r - n / 5, a + 1);
|
|
580
582
|
}, "findLane"), Ur = /* @__PURE__ */ h((t, r, a, s) => {
|
|
581
|
-
var y,
|
|
583
|
+
var y, u, w, q, Y;
|
|
582
584
|
const e = E.get(r.id), n = E.get(a.id);
|
|
583
585
|
if (e === void 0 || n === void 0)
|
|
584
586
|
throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);
|
|
585
587
|
const c = Fr(r, a, e, n, s);
|
|
586
588
|
let o = "", $ = "", l = 0, f = 0, g = (y = C.get(a.branch)) == null ? void 0 : y.index;
|
|
587
|
-
a.type ===
|
|
589
|
+
a.type === x.MERGE && r.id !== a.parents[0] && (g = (u = C.get(r.branch)) == null ? void 0 : u.index);
|
|
588
590
|
let d;
|
|
589
591
|
if (c) {
|
|
590
592
|
o = "A 10 10, 0, 0, 0,", $ = "A 10 10, 0, 0, 1,", l = 10, f = 10;
|
|
591
593
|
const T = e.y < n.y ? H(e.y, n.y) : H(n.y, e.y), v = e.x < n.x ? H(e.x, n.x) : H(n.x, e.x);
|
|
592
|
-
|
|
594
|
+
p === "TB" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${$} ${v} ${e.y + f} L ${v} ${n.y - l} ${o} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (w = C.get(r.branch)) == null ? void 0 : w.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${o} ${v} ${e.y + f} L ${v} ${n.y - l} ${$} ${v - f} ${n.y} L ${n.x} ${n.y}`) : p === "BT" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${o} ${v} ${e.y - f} L ${v} ${n.y + l} ${$} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (q = C.get(r.branch)) == null ? void 0 : q.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${$} ${v} ${e.y - f} L ${v} ${n.y + l} ${o} ${v - f} ${n.y} L ${n.x} ${n.y}`) : e.y < n.y ? d = `M ${e.x} ${e.y} L ${e.x} ${T - l} ${o} ${e.x + f} ${T} L ${n.x - l} ${T} ${$} ${n.x} ${T + f} L ${n.x} ${n.y}` : (g = (Y = C.get(r.branch)) == null ? void 0 : Y.index, d = `M ${e.x} ${e.y} L ${e.x} ${T + l} ${$} ${e.x + f} ${T} L ${n.x - l} ${T} ${o} ${n.x} ${T - f} L ${n.x} ${n.y}`);
|
|
593
595
|
} else
|
|
594
|
-
o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20,
|
|
596
|
+
o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, p === "TB" ? (e.x < n.x && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${$} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x + l} ${e.y} ${o} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : p === "BT" ? (e.x < n.x && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${o} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : (e.y < n.y && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y > n.y && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y === n.y && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`));
|
|
595
597
|
if (d === void 0)
|
|
596
598
|
throw new Error("Line definition not found");
|
|
597
599
|
t.append("path").attr("d", d).attr("class", "arrow arrow" + g % O);
|
|
@@ -606,22 +608,22 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
606
608
|
}, "drawArrows"), ee = /* @__PURE__ */ h((t, r) => {
|
|
607
609
|
const a = t.append("g");
|
|
608
610
|
r.forEach((s, e) => {
|
|
609
|
-
var
|
|
610
|
-
const n = e % O, c = (
|
|
611
|
+
var u;
|
|
612
|
+
const n = e % O, c = (u = C.get(s.name)) == null ? void 0 : u.pos;
|
|
611
613
|
if (c === void 0)
|
|
612
614
|
throw new Error(`Position not found for branch ${s.name}`);
|
|
613
615
|
const o = a.append("line");
|
|
614
|
-
o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n),
|
|
616
|
+
o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n), p === "TB" ? (o.attr("y1", P), o.attr("x1", c), o.attr("y2", M), o.attr("x2", c)) : p === "BT" && (o.attr("y1", M), o.attr("x1", c), o.attr("y2", P), o.attr("x2", c)), W.push(c);
|
|
615
617
|
const $ = s.name, l = J($), f = a.insert("rect"), d = a.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + n);
|
|
616
618
|
d.node().appendChild(l);
|
|
617
619
|
const y = l.getBBox();
|
|
618
620
|
f.attr("class", "branchLabelBkg label" + n).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), d.attr(
|
|
619
621
|
"transform",
|
|
620
622
|
"translate(" + (-y.width - 14 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (c - y.height / 2 - 1) + ")"
|
|
621
|
-
),
|
|
623
|
+
), p === "TB" ? (f.attr("x", c - y.width / 2 - 10).attr("y", 0), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", 0)")) : p === "BT" ? (f.attr("x", c - y.width / 2 - 10).attr("y", M), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", " + M + ")")) : f.attr("transform", "translate(-19, " + (c - y.height / 2) + ")");
|
|
622
624
|
});
|
|
623
625
|
}, "drawBranches"), te = /* @__PURE__ */ h(function(t, r, a, s, e) {
|
|
624
|
-
return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (
|
|
626
|
+
return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (p === "TB" || p === "BT" ? s.width / 2 : 0), r;
|
|
625
627
|
}, "setBranchPosition"), ae = /* @__PURE__ */ h(function(t, r, a, s) {
|
|
626
628
|
if (jr(), m.debug("in gitgraph renderer", t + `
|
|
627
629
|
`, "id:", r, a), !b)
|
|
@@ -629,15 +631,15 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
629
631
|
const e = b.rotateCommitLabel ?? !1, n = s.db;
|
|
630
632
|
G = n.getCommits();
|
|
631
633
|
const c = n.getBranchesAsObjArray();
|
|
632
|
-
|
|
634
|
+
p = n.getDirection();
|
|
633
635
|
const o = lr(`[id="${r}"]`);
|
|
634
636
|
let $ = 0;
|
|
635
637
|
c.forEach((l, f) => {
|
|
636
638
|
var q;
|
|
637
|
-
const g = J(l.name), d = o.append("g"), y = d.insert("g").attr("class", "branchLabel"),
|
|
638
|
-
(q =
|
|
639
|
+
const g = J(l.name), d = o.append("g"), y = d.insert("g").attr("class", "branchLabel"), u = y.insert("g").attr("class", "label branch-label");
|
|
640
|
+
(q = u.node()) == null || q.appendChild(g);
|
|
639
641
|
const w = g.getBBox();
|
|
640
|
-
$ = te(l.name, $, f, w, e),
|
|
642
|
+
$ = te(l.name, $, f, w, e), u.remove(), y.remove(), d.remove();
|
|
641
643
|
}), K(o, G, !1), b.showBranches && ee(o, c), re(o, G), K(o, G, !0), $r.insertTitle(
|
|
642
644
|
o,
|
|
643
645
|
"gitTitleText",
|
|
@@ -704,12 +706,12 @@ var Cr = /* @__PURE__ */ h(function() {
|
|
|
704
706
|
font-size: 18px;
|
|
705
707
|
fill: ${t.textColor};
|
|
706
708
|
}
|
|
707
|
-
`, "getStyles"), oe = se,
|
|
709
|
+
`, "getStyles"), oe = se, pe = {
|
|
708
710
|
parser: Wr,
|
|
709
711
|
db: X,
|
|
710
712
|
renderer: ne,
|
|
711
713
|
styles: oe
|
|
712
714
|
};
|
|
713
715
|
export {
|
|
714
|
-
|
|
716
|
+
pe as diagram
|
|
715
717
|
};
|