@schmitech/chatbot-widget 0.6.3 → 0.7.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/ChatWidget.d.ts +11 -0
- package/dist/{_baseUniq-BPMphbq5-xiRWQlDn.js → _baseUniq-BRKsqoH--HqBVqMpT.js} +126 -126
- package/dist/arc-pab_su9s-DkImmxyv.js +84 -0
- package/dist/architecture-U656AL7Q-CRlU-eNB-vFayp_Gk.js +7 -0
- package/dist/{architectureDiagram-VXUJARFQ-BiqZtsDe-rYpYn0Hz.js → architectureDiagram-VXUJARFQ-DqQ8r_6g-DTzMoAeY.js} +5 -5
- package/dist/{blockDiagram-VD42YOAC-zcRIdFTD-B54KiQJD.js → blockDiagram-VD42YOAC-B-dKfcH3-DKPGmrNb.js} +50 -50
- package/dist/{c4Diagram-YG6GDRKO-DYXNcDX4-B9fXQAMg.js → c4Diagram-YG6GDRKO-DMUPaBEl-CXjiCiKq.js} +63 -63
- package/dist/channel-HKsfPa5q-B30_3C0d.js +6 -0
- package/dist/chatbot-widget.bundle.js +11596 -0
- package/dist/chatbot-widget.es.js +1 -1
- package/dist/chatbot-widget.umd.js +4342 -3550
- package/dist/{chunk-4BX2VUAB-DAh9ktmY-CF6YTNXg.js → chunk-4BX2VUAB-CX67kh_B-JdLaNmBY.js} +1 -1
- package/dist/chunk-55IACEB6-BocSyyvr--btUJ1po.js +9 -0
- package/dist/{chunk-B4BG7PRW-BTUSpeKy-CXaYsx4a.js → chunk-B4BG7PRW-CO8QAyfE-p5mLBzD4.js} +30 -30
- package/dist/{chunk-DI55MBZ5-DKt4WII7-CjsnNRFb.js → chunk-DI55MBZ5-Dw1L6Eos-zQC2oI_e.js} +149 -149
- package/dist/{chunk-FMBD7UC4-DdcCR8w3-BbYkKjQZ.js → chunk-FMBD7UC4-dPK7Boav-C-fxYlU9.js} +1 -1
- package/dist/{chunk-QN33PNHL-v6AkzOl1-DrzKpDUJ.js → chunk-QN33PNHL-vP2PqfVG-ByquTp49.js} +5 -5
- package/dist/{chunk-QZHKN3VN-DVJOrqBZ-BQORk0pj.js → chunk-QZHKN3VN-Bcidzu63-ukwvi4Mt.js} +1 -1
- package/dist/{chunk-TZMSLE5B-G2jJHqli-B_BRSOS0.js → chunk-TZMSLE5B-BtljMjlg-DP4v1MME.js} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-CxmgTanh-ByLirDpd.js → classDiagram-2ON5EDUG-C7cYN9hv-CtX4c_16.js} +2 -2
- package/dist/{classDiagram-2ON5EDUG-CxmgTanh-ByLirDpd.js → classDiagram-v2-WZHVMYZB-C7cYN9hv-CtX4c_16.js} +2 -2
- package/dist/{clone-CsNB4mMi-B2bGL_Hr.js → clone-DoPb9X13-BkFPVisk.js} +1 -1
- package/dist/config/index.d.ts +81 -0
- package/dist/{cose-bilkent-S5V4N54A-BRr2Y6dg-C4O3AMLV.js → cose-bilkent-S5V4N54A-BGzO4EsH-BNoSF82N.js} +1 -1
- package/dist/{dagre-6UL2VRFP-DX8gNHmJ-BSzSR8Xh.js → dagre-6UL2VRFP-TzNvXCds-Dnr2OGZv.js} +45 -45
- package/dist/{diagram-PSM6KHXK-DNX818To-D60Hp_rL.js → diagram-PSM6KHXK-BqY4RpUg-BAHxSfLA.js} +119 -119
- package/dist/{diagram-QEK2KX5R-BDO6hKtm-BHvRInjZ.js → diagram-QEK2KX5R-CTjgBsne-D-9APhrR.js} +74 -74
- package/dist/{diagram-S2PKOQOG-IEqaDwzi-CZZkmLuc.js → diagram-S2PKOQOG-BqrhTIpA-DvsAaFEx.js} +21 -21
- package/dist/{erDiagram-Q2GNP2WA-DbLpN8Jp-902zC-_U.js → erDiagram-Q2GNP2WA-B2hsi_Tl-CQQl2KTS.js} +24 -24
- package/dist/{flowDiagram-NV44I4VS-pJlHae8Y-hM8e9jah.js → flowDiagram-NV44I4VS-C03vtt_F-Ds5DxRz1.js} +37 -37
- package/dist/{ganttDiagram-JELNMOA3-J0Tkq5TR-C8n0Mtt1.js → ganttDiagram-JELNMOA3-B3hAg964-D9cHQTuZ.js} +110 -110
- package/dist/gitGraph-F6HP7TQM-B-XXB6PA-CXOJho2m.js +7 -0
- package/dist/{gitGraphDiagram-NY62KEGX-DgYonpsZ-CAVA4-Vo.js → gitGraphDiagram-NY62KEGX-ByhMH0yZ-DTWIR_Gp.js} +238 -238
- package/dist/{graph-BpcfrHXY-Dllj_YdG.js → graph-BmNkcFEM-CTJN7Ty_.js} +67 -67
- package/dist/hooks/useAnimationManagement.d.ts +16 -0
- package/dist/hooks/useInputManagement.d.ts +21 -0
- package/dist/hooks/useScrollManagement.d.ts +17 -0
- package/dist/index-BXexqYFc-Bn0M0HQB.js +13693 -0
- package/dist/{index-DlxA4QQ9.js → index-DU3Jqd59.js} +80142 -50172
- package/dist/index.d.ts +19 -0
- package/dist/info-NVLQJR56-BJV_yXNb-CH_hMh0K.js +7 -0
- package/dist/infoDiagram-WHAUD3N6-is6Ho4-T-E3qEjHYs.js +25 -0
- package/dist/{journeyDiagram-XKPGCS4Q-CfjB2Qdf-nD3bX36U.js → journeyDiagram-XKPGCS4Q-CRTOL26C-VvuJ7JPc.js} +71 -71
- package/dist/{kanban-definition-3W4ZIXB7-CrW8yVmd-C_Okjmcp.js → kanban-definition-3W4ZIXB7-CNnO_t6O-BsqhwZAY.js} +88 -88
- package/dist/{layout-bsfAhWjc-fb3F3QBs.js → layout-C0kZPebx-CrIgKtBd.js} +109 -109
- package/dist/{mermaid-parser.core-3GIbpcw--KxsyRnD0.js → mermaid-parser.core-C88_DDui-CHG6v5qB.js} +10 -10
- package/dist/min-7Gb0pNxh-Cd_K7Lpk.js +39 -0
- package/dist/{mindmap-definition-VGOIOE7T-Dj37RkY_-BXffQH_4.js → mindmap-definition-VGOIOE7T-CJZ2wTTa-D4yK-MK1.js} +40 -40
- package/dist/packet-BFZMPI3H-DPt2EftX-Bgsdgnv-.js +7 -0
- package/dist/pie-7BOR55EZ-aEOtXZZV-CT0TLfil.js +7 -0
- package/dist/{pieDiagram-ADFJNKIX-BiQvDx8I-DnApOdvY.js → pieDiagram-ADFJNKIX-C9OSknjr-DguaGmOm.js} +49 -49
- package/dist/{quadrantDiagram-AYHSOK5B-D4b-YFzI-DrTslixM.js → quadrantDiagram-AYHSOK5B-CW8yuAqv-Dp9c_xnT.js} +54 -54
- package/dist/radar-NHE76QYJ-Dv7iPziq-DzohugO5.js +7 -0
- package/dist/{requirementDiagram-UZGBJVZJ-km07nlVd-C-mMa1KG.js → requirementDiagram-UZGBJVZJ-nGPhruO1-DINXeP9u.js} +5 -5
- package/dist/{sankeyDiagram-TZEHDZUN-LfuSRRbf-4X6kl_ss.js → sankeyDiagram-TZEHDZUN-CmL90u-m-YTiy7xgb.js} +146 -146
- package/dist/{sequenceDiagram-WL72ISMW-CQ4J-0_7-CEQiE3WJ.js → sequenceDiagram-WL72ISMW-B02VRcnM-B0n6W8Zi.js} +3 -3
- package/dist/shared/styles.d.ts +76 -0
- package/dist/{stateDiagram-FKZM4ZOC-JtogJwt6-YmKguJGd.js → stateDiagram-FKZM4ZOC-DjoyLUdz-BEUNa8-U.js} +14 -14
- package/dist/{stateDiagram-v2-4FDKWEC3-DuQ7UaeU-D6r92VaJ.js → stateDiagram-v2-4FDKWEC3-Bq76BTB7-DJxNsvnB.js} +2 -2
- package/dist/store/chatStore.d.ts +19 -0
- package/dist/{timeline-definition-IT6M3QCI-Cs3NnF2M-BigQwSNM.js → timeline-definition-IT6M3QCI-CTn0Gm3T-sHrk-A3B.js} +78 -78
- package/dist/treemap-KMMF4GRG-BjgLKKyi-CXHyJ_sr.js +7 -0
- package/dist/ui/ChatInput.d.ts +17 -0
- package/dist/ui/Message.d.ts +22 -0
- package/dist/ui/MessagesList.d.ts +32 -0
- package/dist/utils/contentFiltering.d.ts +12 -0
- package/dist/utils/sessionManager.d.ts +2 -0
- package/dist/{xychartDiagram-PRI3JC2R-JzAaXa5z-k94imfkQ.js → xychartDiagram-PRI3JC2R-Cgg6Uija-BysdxdV7.js} +79 -79
- package/package.json +9 -9
- package/dist/arc-D9rhTKV0-3XdW6Lry.js +0 -84
- package/dist/architecture-U656AL7Q-BFNI3st4-ChEUjpe5.js +0 -6
- package/dist/channel-CUIutAfm-COC3Ib4R.js +0 -6
- package/dist/chunk-55IACEB6-Cza7pcpr-C1E53ZSc.js +0 -9
- package/dist/gitGraph-F6HP7TQM-CD3YuciB-WOZqeAgY.js +0 -6
- package/dist/index-DvNpGWs7-CTu7Fgm8.js +0 -13251
- package/dist/info-NVLQJR56-yPC6AWqF-CQWIUnLc.js +0 -6
- package/dist/infoDiagram-WHAUD3N6-C3JLOAnb-o3ipZ1gK.js +0 -25
- package/dist/min-C2aDz5ZK-NndI1eE7.js +0 -39
- package/dist/packet-BFZMPI3H-3ROFuof--C96yO55O.js +0 -6
- package/dist/pie-7BOR55EZ-BZ_QeD6P-Bs0c_r6N.js +0 -6
- package/dist/radar-NHE76QYJ-BkSncUeS-jHSdaVBc.js +0 -6
- package/dist/treemap-KMMF4GRG-CkW25-tn-CkfndsG5.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as
|
|
2
|
-
import { e as
|
|
3
|
-
import {
|
|
4
|
-
import { j as yr } from "./mermaid-parser.core-
|
|
1
|
+
import { m as Q } from "./chunk-4BX2VUAB-CX67kh_B-JdLaNmBY.js";
|
|
2
|
+
import { e as X } from "./chunk-QZHKN3VN-Bcidzu63-ukwvi4Mt.js";
|
|
3
|
+
import { t as Z, s as rr, e as tr, f as er, g as or, h as nr, M as m, a as w, d as ar, r as cr, R as ir, N as sr, m as k, K as dr, _ as hr, P as $r, C as mr, Q as lr } from "./index-DU3Jqd59.js";
|
|
4
|
+
import { j as yr } from "./mermaid-parser.core-C88_DDui-CHG6v5qB.js";
|
|
5
5
|
typeof window < "u" && (window.global = window);
|
|
6
6
|
var u = {
|
|
7
7
|
NORMAL: 0,
|
|
@@ -9,10 +9,10 @@ var u = {
|
|
|
9
9
|
HIGHLIGHT: 2,
|
|
10
10
|
MERGE: 3,
|
|
11
11
|
CHERRY_PICK: 4
|
|
12
|
-
}, gr =
|
|
12
|
+
}, gr = hr.gitGraph, O = /* @__PURE__ */ m(() => dr({
|
|
13
13
|
...gr,
|
|
14
14
|
...$r().gitGraph
|
|
15
|
-
}), "getConfig"),
|
|
15
|
+
}), "getConfig"), s = new X(() => {
|
|
16
16
|
const t = O(), r = t.mainBranchName, e = t.mainBranchOrder;
|
|
17
17
|
return {
|
|
18
18
|
mainBranchName: r,
|
|
@@ -26,62 +26,62 @@ var u = {
|
|
|
26
26
|
options: {}
|
|
27
27
|
};
|
|
28
28
|
});
|
|
29
|
-
function
|
|
29
|
+
function N() {
|
|
30
30
|
return lr({ length: 7 });
|
|
31
31
|
}
|
|
32
|
-
m(
|
|
33
|
-
function
|
|
32
|
+
m(N, "getID");
|
|
33
|
+
function K(t, r) {
|
|
34
34
|
const e = /* @__PURE__ */ Object.create(null);
|
|
35
|
-
return t.reduce((
|
|
36
|
-
const
|
|
37
|
-
return e[
|
|
35
|
+
return t.reduce((a, c) => {
|
|
36
|
+
const i = r(c);
|
|
37
|
+
return e[i] || (e[i] = !0, a.push(c)), a;
|
|
38
38
|
}, []);
|
|
39
39
|
}
|
|
40
|
-
m(
|
|
40
|
+
m(K, "uniqBy");
|
|
41
41
|
var pr = /* @__PURE__ */ m(function(t) {
|
|
42
|
-
|
|
42
|
+
s.records.direction = t;
|
|
43
43
|
}, "setDirection"), fr = /* @__PURE__ */ m(function(t) {
|
|
44
44
|
w.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
|
|
45
45
|
try {
|
|
46
|
-
|
|
46
|
+
s.records.options = JSON.parse(t);
|
|
47
47
|
} catch (r) {
|
|
48
48
|
w.error("error while parsing gitGraph options", r.message);
|
|
49
49
|
}
|
|
50
50
|
}, "setOptions"), xr = /* @__PURE__ */ m(function() {
|
|
51
|
-
return
|
|
51
|
+
return s.records.options;
|
|
52
52
|
}, "getOptions"), ur = /* @__PURE__ */ m(function(t) {
|
|
53
53
|
let r = t.msg, e = t.id;
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
w.info("commit", r, e,
|
|
57
|
-
const
|
|
58
|
-
e =
|
|
54
|
+
const a = t.type;
|
|
55
|
+
let c = t.tags;
|
|
56
|
+
w.info("commit", r, e, a, c), w.debug("Entering commit:", r, e, a, c);
|
|
57
|
+
const i = O();
|
|
58
|
+
e = k.sanitizeText(e, i), r = k.sanitizeText(r, i), c = c == null ? void 0 : c.map((h) => k.sanitizeText(h, i));
|
|
59
59
|
const d = {
|
|
60
|
-
id: e ||
|
|
60
|
+
id: e || s.records.seq + "-" + N(),
|
|
61
61
|
message: r,
|
|
62
|
-
seq:
|
|
63
|
-
type:
|
|
64
|
-
tags:
|
|
65
|
-
parents:
|
|
66
|
-
branch:
|
|
62
|
+
seq: s.records.seq++,
|
|
63
|
+
type: a ?? u.NORMAL,
|
|
64
|
+
tags: c ?? [],
|
|
65
|
+
parents: s.records.head == null ? [] : [s.records.head.id],
|
|
66
|
+
branch: s.records.currBranch
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
s.records.head = d, w.info("main branch", i.mainBranchName), s.records.commits.has(d.id) && w.warn(`Commit ID ${d.id} already exists`), s.records.commits.set(d.id, d), s.records.branches.set(s.records.currBranch, d.id), w.debug("in pushCommit " + d.id);
|
|
69
69
|
}, "commit"), br = /* @__PURE__ */ m(function(t) {
|
|
70
70
|
let r = t.name;
|
|
71
71
|
const e = t.order;
|
|
72
|
-
if (r =
|
|
72
|
+
if (r = k.sanitizeText(r, O()), s.records.branches.has(r))
|
|
73
73
|
throw new Error(
|
|
74
74
|
`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
|
|
75
75
|
);
|
|
76
|
-
|
|
76
|
+
s.records.branches.set(r, s.records.head != null ? s.records.head.id : null), s.records.branchConfig.set(r, { name: r, order: e }), F(r), w.debug("in createBranch");
|
|
77
77
|
}, "branch"), wr = /* @__PURE__ */ m((t) => {
|
|
78
78
|
let r = t.branch, e = t.id;
|
|
79
|
-
const
|
|
80
|
-
r =
|
|
81
|
-
const d =
|
|
79
|
+
const a = t.type, c = t.tags, i = O();
|
|
80
|
+
r = k.sanitizeText(r, i), e && (e = k.sanitizeText(e, i));
|
|
81
|
+
const d = s.records.branches.get(s.records.currBranch), h = s.records.branches.get(r), l = d ? s.records.commits.get(d) : void 0, o = h ? s.records.commits.get(h) : void 0;
|
|
82
82
|
if (l && o && l.branch === r)
|
|
83
83
|
throw new Error(`Cannot merge branch '${r}' into itself.`);
|
|
84
|
-
if (
|
|
84
|
+
if (s.records.currBranch === r) {
|
|
85
85
|
const $ = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
|
|
86
86
|
throw $.hash = {
|
|
87
87
|
text: `merge ${r}`,
|
|
@@ -91,7 +91,7 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
91
91
|
}
|
|
92
92
|
if (l === void 0 || !l) {
|
|
93
93
|
const $ = new Error(
|
|
94
|
-
`Incorrect usage of "merge". Current branch (${
|
|
94
|
+
`Incorrect usage of "merge". Current branch (${s.records.currBranch})has no commits`
|
|
95
95
|
);
|
|
96
96
|
throw $.hash = {
|
|
97
97
|
text: `merge ${r}`,
|
|
@@ -99,7 +99,7 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
99
99
|
expected: ["commit"]
|
|
100
100
|
}, $;
|
|
101
101
|
}
|
|
102
|
-
if (!
|
|
102
|
+
if (!s.records.branches.has(r)) {
|
|
103
103
|
const $ = new Error(
|
|
104
104
|
'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
|
|
105
105
|
);
|
|
@@ -127,35 +127,35 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
127
127
|
expected: ["branch abc"]
|
|
128
128
|
}, $;
|
|
129
129
|
}
|
|
130
|
-
if (e &&
|
|
130
|
+
if (e && s.records.commits.has(e)) {
|
|
131
131
|
const $ = new Error(
|
|
132
132
|
'Incorrect usage of "merge". Commit with id:' + e + " already exists, use different custom id"
|
|
133
133
|
);
|
|
134
134
|
throw $.hash = {
|
|
135
|
-
text: `merge ${r} ${e} ${
|
|
136
|
-
token: `merge ${r} ${e} ${
|
|
135
|
+
text: `merge ${r} ${e} ${a} ${c == null ? void 0 : c.join(" ")}`,
|
|
136
|
+
token: `merge ${r} ${e} ${a} ${c == null ? void 0 : c.join(" ")}`,
|
|
137
137
|
expected: [
|
|
138
|
-
`merge ${r} ${e}_UNIQUE ${
|
|
138
|
+
`merge ${r} ${e}_UNIQUE ${a} ${c == null ? void 0 : c.join(" ")}`
|
|
139
139
|
]
|
|
140
140
|
}, $;
|
|
141
141
|
}
|
|
142
142
|
const n = h || "", x = {
|
|
143
|
-
id: e || `${
|
|
144
|
-
message: `merged branch ${r} into ${
|
|
145
|
-
seq:
|
|
146
|
-
parents:
|
|
147
|
-
branch:
|
|
143
|
+
id: e || `${s.records.seq}-${N()}`,
|
|
144
|
+
message: `merged branch ${r} into ${s.records.currBranch}`,
|
|
145
|
+
seq: s.records.seq++,
|
|
146
|
+
parents: s.records.head == null ? [] : [s.records.head.id, n],
|
|
147
|
+
branch: s.records.currBranch,
|
|
148
148
|
type: u.MERGE,
|
|
149
|
-
customType:
|
|
149
|
+
customType: a,
|
|
150
150
|
customId: !!e,
|
|
151
|
-
tags:
|
|
151
|
+
tags: c ?? []
|
|
152
152
|
};
|
|
153
|
-
|
|
153
|
+
s.records.head = x, s.records.commits.set(x.id, x), s.records.branches.set(s.records.currBranch, x.id), w.debug(s.records.branches), w.debug("in mergeBranch");
|
|
154
154
|
}, "merge"), Br = /* @__PURE__ */ m(function(t) {
|
|
155
|
-
let r = t.id, e = t.targetId,
|
|
156
|
-
w.debug("Entering cherryPick:", r, e,
|
|
157
|
-
const
|
|
158
|
-
if (r =
|
|
155
|
+
let r = t.id, e = t.targetId, a = t.tags, c = t.parent;
|
|
156
|
+
w.debug("Entering cherryPick:", r, e, a);
|
|
157
|
+
const i = O();
|
|
158
|
+
if (r = k.sanitizeText(r, i), e = k.sanitizeText(e, i), a = a == null ? void 0 : a.map((l) => k.sanitizeText(l, i)), c = k.sanitizeText(c, i), !r || !s.records.commits.has(r)) {
|
|
159
159
|
const l = new Error(
|
|
160
160
|
'Incorrect usage of "cherryPick". Source commit id should exist and provided'
|
|
161
161
|
);
|
|
@@ -165,20 +165,20 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
165
165
|
expected: ["cherry-pick abc"]
|
|
166
166
|
}, l;
|
|
167
167
|
}
|
|
168
|
-
const d =
|
|
168
|
+
const d = s.records.commits.get(r);
|
|
169
169
|
if (d === void 0 || !d)
|
|
170
170
|
throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
|
|
171
|
-
if (
|
|
171
|
+
if (c && !(Array.isArray(d.parents) && d.parents.includes(c)))
|
|
172
172
|
throw new Error(
|
|
173
173
|
"Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
|
|
174
174
|
);
|
|
175
175
|
const h = d.branch;
|
|
176
|
-
if (d.type === u.MERGE && !
|
|
176
|
+
if (d.type === u.MERGE && !c)
|
|
177
177
|
throw new Error(
|
|
178
178
|
"Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
|
|
179
179
|
);
|
|
180
|
-
if (!e || !
|
|
181
|
-
if (h ===
|
|
180
|
+
if (!e || !s.records.commits.has(e)) {
|
|
181
|
+
if (h === s.records.currBranch) {
|
|
182
182
|
const x = new Error(
|
|
183
183
|
'Incorrect usage of "cherryPick". Source commit is already on current branch'
|
|
184
184
|
);
|
|
@@ -188,10 +188,10 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
188
188
|
expected: ["cherry-pick abc"]
|
|
189
189
|
}, x;
|
|
190
190
|
}
|
|
191
|
-
const l =
|
|
191
|
+
const l = s.records.branches.get(s.records.currBranch);
|
|
192
192
|
if (l === void 0 || !l) {
|
|
193
193
|
const x = new Error(
|
|
194
|
-
`Incorrect usage of "cherry-pick". Current branch (${
|
|
194
|
+
`Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`
|
|
195
195
|
);
|
|
196
196
|
throw x.hash = {
|
|
197
197
|
text: `cherryPick ${r} ${e}`,
|
|
@@ -199,10 +199,10 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
199
199
|
expected: ["cherry-pick abc"]
|
|
200
200
|
}, x;
|
|
201
201
|
}
|
|
202
|
-
const o =
|
|
202
|
+
const o = s.records.commits.get(l);
|
|
203
203
|
if (o === void 0 || !o) {
|
|
204
204
|
const x = new Error(
|
|
205
|
-
`Incorrect usage of "cherry-pick". Current branch (${
|
|
205
|
+
`Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`
|
|
206
206
|
);
|
|
207
207
|
throw x.hash = {
|
|
208
208
|
text: `cherryPick ${r} ${e}`,
|
|
@@ -211,23 +211,23 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
211
211
|
}, x;
|
|
212
212
|
}
|
|
213
213
|
const n = {
|
|
214
|
-
id:
|
|
215
|
-
message: `cherry-picked ${d == null ? void 0 : d.message} into ${
|
|
216
|
-
seq:
|
|
217
|
-
parents:
|
|
218
|
-
branch:
|
|
214
|
+
id: s.records.seq + "-" + N(),
|
|
215
|
+
message: `cherry-picked ${d == null ? void 0 : d.message} into ${s.records.currBranch}`,
|
|
216
|
+
seq: s.records.seq++,
|
|
217
|
+
parents: s.records.head == null ? [] : [s.records.head.id, d.id],
|
|
218
|
+
branch: s.records.currBranch,
|
|
219
219
|
type: u.CHERRY_PICK,
|
|
220
|
-
tags:
|
|
221
|
-
`cherry-pick:${d.id}${d.type === u.MERGE ? `|parent:${
|
|
220
|
+
tags: a ? a.filter(Boolean) : [
|
|
221
|
+
`cherry-pick:${d.id}${d.type === u.MERGE ? `|parent:${c}` : ""}`
|
|
222
222
|
]
|
|
223
223
|
};
|
|
224
|
-
|
|
224
|
+
s.records.head = n, s.records.commits.set(n.id, n), s.records.branches.set(s.records.currBranch, n.id), w.debug(s.records.branches), w.debug("in cherryPick");
|
|
225
225
|
}
|
|
226
|
-
}, "cherryPick"),
|
|
227
|
-
if (t =
|
|
228
|
-
|
|
229
|
-
const r =
|
|
230
|
-
r === void 0 || !r ?
|
|
226
|
+
}, "cherryPick"), F = /* @__PURE__ */ m(function(t) {
|
|
227
|
+
if (t = k.sanitizeText(t, O()), s.records.branches.has(t)) {
|
|
228
|
+
s.records.currBranch = t;
|
|
229
|
+
const r = s.records.branches.get(s.records.currBranch);
|
|
230
|
+
r === void 0 || !r ? s.records.head = null : s.records.head = s.records.commits.get(r) ?? null;
|
|
231
231
|
} else {
|
|
232
232
|
const r = new Error(
|
|
233
233
|
`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
|
|
@@ -239,61 +239,61 @@ var pr = /* @__PURE__ */ m(function(t) {
|
|
|
239
239
|
}, r;
|
|
240
240
|
}
|
|
241
241
|
}, "checkout");
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
|
|
242
|
+
function D(t, r, e) {
|
|
243
|
+
const a = t.indexOf(r);
|
|
244
|
+
a === -1 ? t.push(e) : t.splice(a, 1, e);
|
|
245
245
|
}
|
|
246
|
-
m(
|
|
246
|
+
m(D, "upsert");
|
|
247
247
|
function j(t) {
|
|
248
|
-
const r = t.reduce((
|
|
248
|
+
const r = t.reduce((c, i) => c.seq > i.seq ? c : i, t[0]);
|
|
249
249
|
let e = "";
|
|
250
|
-
t.forEach(function(
|
|
251
|
-
|
|
250
|
+
t.forEach(function(c) {
|
|
251
|
+
c === r ? e += " *" : e += " |";
|
|
252
252
|
});
|
|
253
|
-
const
|
|
254
|
-
for (const
|
|
255
|
-
|
|
256
|
-
if (w.debug(
|
|
257
|
-
const
|
|
258
|
-
|
|
253
|
+
const a = [e, r.id, r.seq];
|
|
254
|
+
for (const c in s.records.branches)
|
|
255
|
+
s.records.branches.get(c) === r.id && a.push(c);
|
|
256
|
+
if (w.debug(a.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
|
|
257
|
+
const c = s.records.commits.get(r.parents[0]);
|
|
258
|
+
D(t, r, c), r.parents[1] && t.push(s.records.commits.get(r.parents[1]));
|
|
259
259
|
} else {
|
|
260
260
|
if (r.parents.length == 0)
|
|
261
261
|
return;
|
|
262
262
|
if (r.parents[0]) {
|
|
263
|
-
const
|
|
264
|
-
|
|
263
|
+
const c = s.records.commits.get(r.parents[0]);
|
|
264
|
+
D(t, r, c);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
t =
|
|
267
|
+
t = K(t, (c) => c.id), j(t);
|
|
268
268
|
}
|
|
269
269
|
m(j, "prettyPrintCommitHistory");
|
|
270
270
|
var Er = /* @__PURE__ */ m(function() {
|
|
271
|
-
w.debug(
|
|
271
|
+
w.debug(s.records.commits);
|
|
272
272
|
const t = Y()[0];
|
|
273
273
|
j([t]);
|
|
274
274
|
}, "prettyPrint"), vr = /* @__PURE__ */ m(function() {
|
|
275
|
-
|
|
276
|
-
}, "clear"),
|
|
277
|
-
return [...
|
|
275
|
+
s.reset(), sr();
|
|
276
|
+
}, "clear"), Cr = /* @__PURE__ */ m(function() {
|
|
277
|
+
return [...s.records.branchConfig.values()].map((t, r) => t.order !== null && t.order !== void 0 ? t : {
|
|
278
278
|
...t,
|
|
279
279
|
order: parseFloat(`0.${r}`)
|
|
280
280
|
}).sort((t, r) => (t.order ?? 0) - (r.order ?? 0)).map(({ name: t }) => ({ name: t }));
|
|
281
|
-
}, "getBranchesAsObjArray"),
|
|
282
|
-
return
|
|
281
|
+
}, "getBranchesAsObjArray"), kr = /* @__PURE__ */ m(function() {
|
|
282
|
+
return s.records.branches;
|
|
283
283
|
}, "getBranches"), Lr = /* @__PURE__ */ m(function() {
|
|
284
|
-
return
|
|
284
|
+
return s.records.commits;
|
|
285
285
|
}, "getCommits"), Y = /* @__PURE__ */ m(function() {
|
|
286
|
-
const t = [...
|
|
286
|
+
const t = [...s.records.commits.values()];
|
|
287
287
|
return t.forEach(function(r) {
|
|
288
288
|
w.debug(r.id);
|
|
289
289
|
}), t.sort((r, e) => r.seq - e.seq), t;
|
|
290
290
|
}, "getCommitsArray"), Tr = /* @__PURE__ */ m(function() {
|
|
291
|
-
return
|
|
291
|
+
return s.records.currBranch;
|
|
292
292
|
}, "getCurrentBranch"), Mr = /* @__PURE__ */ m(function() {
|
|
293
|
-
return
|
|
293
|
+
return s.records.direction;
|
|
294
294
|
}, "getDirection"), Pr = /* @__PURE__ */ m(function() {
|
|
295
|
-
return
|
|
296
|
-
}, "getHead"),
|
|
295
|
+
return s.records.head;
|
|
296
|
+
}, "getHead"), U = {
|
|
297
297
|
commitType: u,
|
|
298
298
|
getConfig: O,
|
|
299
299
|
setDirection: pr,
|
|
@@ -303,12 +303,12 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
303
303
|
branch: br,
|
|
304
304
|
merge: wr,
|
|
305
305
|
cherryPick: Br,
|
|
306
|
-
checkout:
|
|
306
|
+
checkout: F,
|
|
307
307
|
//reset,
|
|
308
308
|
prettyPrint: Er,
|
|
309
309
|
clear: vr,
|
|
310
|
-
getBranchesAsObjArray:
|
|
311
|
-
getBranches:
|
|
310
|
+
getBranchesAsObjArray: Cr,
|
|
311
|
+
getBranches: kr,
|
|
312
312
|
getCommits: Lr,
|
|
313
313
|
getCommitsArray: Y,
|
|
314
314
|
getCurrentBranch: Tr,
|
|
@@ -321,19 +321,19 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
321
321
|
setDiagramTitle: rr,
|
|
322
322
|
getDiagramTitle: Z
|
|
323
323
|
}, Rr = /* @__PURE__ */ m((t, r) => {
|
|
324
|
-
|
|
324
|
+
Q(t, r), t.dir && r.setDirection(t.dir);
|
|
325
325
|
for (const e of t.statements)
|
|
326
|
-
|
|
327
|
-
}, "populate"),
|
|
326
|
+
Ar(e, r);
|
|
327
|
+
}, "populate"), Ar = /* @__PURE__ */ m((t, r) => {
|
|
328
328
|
const e = {
|
|
329
|
-
Commit: /* @__PURE__ */ m((
|
|
330
|
-
Branch: /* @__PURE__ */ m((
|
|
331
|
-
Merge: /* @__PURE__ */ m((
|
|
332
|
-
Checkout: /* @__PURE__ */ m((
|
|
333
|
-
CherryPicking: /* @__PURE__ */ m((
|
|
329
|
+
Commit: /* @__PURE__ */ m((a) => r.commit(Ir(a)), "Commit"),
|
|
330
|
+
Branch: /* @__PURE__ */ m((a) => r.branch(Gr(a)), "Branch"),
|
|
331
|
+
Merge: /* @__PURE__ */ m((a) => r.merge(Or(a)), "Merge"),
|
|
332
|
+
Checkout: /* @__PURE__ */ m((a) => r.checkout(qr(a)), "Checkout"),
|
|
333
|
+
CherryPicking: /* @__PURE__ */ m((a) => r.cherryPick(Hr(a)), "CherryPicking")
|
|
334
334
|
}[t.$type];
|
|
335
335
|
e ? e(t) : w.error(`Unknown statement type: ${t.$type}`);
|
|
336
|
-
}, "parseStatement"),
|
|
336
|
+
}, "parseStatement"), Ir = /* @__PURE__ */ m((t) => ({
|
|
337
337
|
id: t.id,
|
|
338
338
|
msg: t.message ?? "",
|
|
339
339
|
type: t.type !== void 0 ? u[t.type] : u.NORMAL,
|
|
@@ -357,98 +357,98 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
357
357
|
}, "parseCherryPicking"), zr = {
|
|
358
358
|
parse: /* @__PURE__ */ m(async (t) => {
|
|
359
359
|
const r = await yr("gitGraph", t);
|
|
360
|
-
w.debug(r), Rr(r,
|
|
360
|
+
w.debug(r), Rr(r, U);
|
|
361
361
|
}, "parse")
|
|
362
|
-
}, W =
|
|
363
|
-
v.clear(),
|
|
362
|
+
}, W = mr(), E = W == null ? void 0 : W.gitGraph, A = 10, I = 40, L = 4, M = 2, G = 8, v = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), z = 30, q = /* @__PURE__ */ new Map(), S = [], R = 0, f = "LR", Sr = /* @__PURE__ */ m(() => {
|
|
363
|
+
v.clear(), C.clear(), q.clear(), R = 0, S = [], f = "LR";
|
|
364
364
|
}, "clear"), V = /* @__PURE__ */ m((t) => {
|
|
365
365
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
366
366
|
return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((e) => {
|
|
367
|
-
const
|
|
368
|
-
|
|
367
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
368
|
+
a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), a.setAttribute("dy", "1em"), a.setAttribute("x", "0"), a.setAttribute("class", "row"), a.textContent = e.trim(), r.appendChild(a);
|
|
369
369
|
}), r;
|
|
370
|
-
}, "drawText"),
|
|
371
|
-
let r, e,
|
|
372
|
-
return f === "BT" ? (e = /* @__PURE__ */ m((
|
|
373
|
-
var
|
|
374
|
-
const h = f === "TB" || f == "BT" ? (
|
|
375
|
-
h !== void 0 && e(h,
|
|
370
|
+
}, "drawText"), J = /* @__PURE__ */ m((t) => {
|
|
371
|
+
let r, e, a;
|
|
372
|
+
return f === "BT" ? (e = /* @__PURE__ */ m((c, i) => c <= i, "comparisonFunc"), a = 1 / 0) : (e = /* @__PURE__ */ m((c, i) => c >= i, "comparisonFunc"), a = 0), t.forEach((c) => {
|
|
373
|
+
var i, d;
|
|
374
|
+
const h = f === "TB" || f == "BT" ? (i = C.get(c)) == null ? void 0 : i.y : (d = C.get(c)) == null ? void 0 : d.x;
|
|
375
|
+
h !== void 0 && e(h, a) && (r = c, a = h);
|
|
376
376
|
}), r;
|
|
377
|
-
}, "findClosestParent"),
|
|
377
|
+
}, "findClosestParent"), Nr = /* @__PURE__ */ m((t) => {
|
|
378
378
|
let r = "", e = 1 / 0;
|
|
379
|
-
return t.forEach((
|
|
380
|
-
const
|
|
381
|
-
|
|
379
|
+
return t.forEach((a) => {
|
|
380
|
+
const c = C.get(a).y;
|
|
381
|
+
c <= e && (r = a, e = c);
|
|
382
382
|
}), r || void 0;
|
|
383
|
-
}, "findClosestParentBT"),
|
|
384
|
-
let
|
|
385
|
-
const
|
|
383
|
+
}, "findClosestParentBT"), Dr = /* @__PURE__ */ m((t, r, e) => {
|
|
384
|
+
let a = e, c = e;
|
|
385
|
+
const i = [];
|
|
386
386
|
t.forEach((d) => {
|
|
387
387
|
const h = r.get(d);
|
|
388
388
|
if (!h)
|
|
389
389
|
throw new Error(`Commit not found for key ${d}`);
|
|
390
|
-
h.parents.length ? (
|
|
391
|
-
}),
|
|
392
|
-
|
|
390
|
+
h.parents.length ? (a = Wr(h), c = Math.max(a, c)) : i.push(h), _r(h, a);
|
|
391
|
+
}), a = c, i.forEach((d) => {
|
|
392
|
+
Kr(d, a, e);
|
|
393
393
|
}), t.forEach((d) => {
|
|
394
394
|
const h = r.get(d);
|
|
395
395
|
if (h != null && h.parents.length) {
|
|
396
|
-
const l =
|
|
397
|
-
|
|
398
|
-
const o = v.get(h.branch).pos, n =
|
|
399
|
-
|
|
396
|
+
const l = Nr(h.parents);
|
|
397
|
+
a = C.get(l).y - I, a <= c && (c = a);
|
|
398
|
+
const o = v.get(h.branch).pos, n = a - A;
|
|
399
|
+
C.set(h.id, { x: o, y: n });
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
402
|
}, "setParallelBTPos"), jr = /* @__PURE__ */ m((t) => {
|
|
403
403
|
var r;
|
|
404
|
-
const e =
|
|
404
|
+
const e = J(t.parents.filter((c) => c !== null));
|
|
405
405
|
if (!e)
|
|
406
406
|
throw new Error(`Closest parent not found for commit ${t.id}`);
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
407
|
+
const a = (r = C.get(e)) == null ? void 0 : r.y;
|
|
408
|
+
if (a === void 0)
|
|
409
409
|
throw new Error(`Closest parent position not found for commit ${t.id}`);
|
|
410
|
-
return
|
|
411
|
-
}, "findClosestParentPos"), Wr = /* @__PURE__ */ m((t) => jr(t) +
|
|
410
|
+
return a;
|
|
411
|
+
}, "findClosestParentPos"), Wr = /* @__PURE__ */ m((t) => jr(t) + I, "calculateCommitPosition"), _r = /* @__PURE__ */ m((t, r) => {
|
|
412
412
|
const e = v.get(t.branch);
|
|
413
413
|
if (!e)
|
|
414
414
|
throw new Error(`Branch not found for commit ${t.id}`);
|
|
415
|
-
const
|
|
416
|
-
return
|
|
417
|
-
}, "setCommitPosition"),
|
|
418
|
-
const
|
|
419
|
-
if (!
|
|
415
|
+
const a = e.pos, c = r + A;
|
|
416
|
+
return C.set(t.id, { x: a, y: c }), { x: a, y: c };
|
|
417
|
+
}, "setCommitPosition"), Kr = /* @__PURE__ */ m((t, r, e) => {
|
|
418
|
+
const a = v.get(t.branch);
|
|
419
|
+
if (!a)
|
|
420
420
|
throw new Error(`Branch not found for commit ${t.id}`);
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
}, "setRootPosition"),
|
|
424
|
-
if (
|
|
421
|
+
const c = r + e, i = a.pos;
|
|
422
|
+
C.set(t.id, { x: i, y: c });
|
|
423
|
+
}, "setRootPosition"), Fr = /* @__PURE__ */ m((t, r, e, a, c, i) => {
|
|
424
|
+
if (i === u.HIGHLIGHT)
|
|
425
425
|
t.append("rect").attr("x", e.x - 10).attr("y", e.y - 10).attr("width", 20).attr("height", 20).attr(
|
|
426
426
|
"class",
|
|
427
|
-
`commit ${r.id} commit-highlight${
|
|
427
|
+
`commit ${r.id} commit-highlight${c % G} ${a}-outer`
|
|
428
428
|
), t.append("rect").attr("x", e.x - 6).attr("y", e.y - 6).attr("width", 12).attr("height", 12).attr(
|
|
429
429
|
"class",
|
|
430
|
-
`commit ${r.id} commit${
|
|
430
|
+
`commit ${r.id} commit${c % G} ${a}-inner`
|
|
431
431
|
);
|
|
432
|
-
else if (
|
|
433
|
-
t.append("circle").attr("cx", e.x).attr("cy", e.y).attr("r", 10).attr("class", `commit ${r.id} ${
|
|
432
|
+
else if (i === u.CHERRY_PICK)
|
|
433
|
+
t.append("circle").attr("cx", e.x).attr("cy", e.y).attr("r", 10).attr("class", `commit ${r.id} ${a}`), t.append("circle").attr("cx", e.x - 3).attr("cy", e.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${a}`), t.append("circle").attr("cx", e.x + 3).attr("cy", e.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${a}`), t.append("line").attr("x1", e.x + 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${a}`), t.append("line").attr("x1", e.x - 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${a}`);
|
|
434
434
|
else {
|
|
435
435
|
const d = t.append("circle");
|
|
436
|
-
if (d.attr("cx", e.x), d.attr("cy", e.y), d.attr("r", r.type === u.MERGE ? 9 : 10), d.attr("class", `commit ${r.id} commit${
|
|
436
|
+
if (d.attr("cx", e.x), d.attr("cy", e.y), d.attr("r", r.type === u.MERGE ? 9 : 10), d.attr("class", `commit ${r.id} commit${c % G}`), i === u.MERGE) {
|
|
437
437
|
const h = t.append("circle");
|
|
438
438
|
h.attr("cx", e.x), h.attr("cy", e.y), h.attr("r", 6), h.attr(
|
|
439
439
|
"class",
|
|
440
|
-
`commit ${
|
|
440
|
+
`commit ${a} ${r.id} commit${c % G}`
|
|
441
441
|
);
|
|
442
442
|
}
|
|
443
|
-
|
|
443
|
+
i === u.REVERSE && t.append("path").attr(
|
|
444
444
|
"d",
|
|
445
445
|
`M ${e.x - 5},${e.y - 5}L${e.x + 5},${e.y + 5}M${e.x - 5},${e.y + 5}L${e.x + 5},${e.y - 5}`
|
|
446
|
-
).attr("class", `commit ${
|
|
446
|
+
).attr("class", `commit ${a} ${r.id} commit${c % G}`);
|
|
447
447
|
}
|
|
448
|
-
}, "drawCommitBullet"), Yr = /* @__PURE__ */ m((t, r, e,
|
|
449
|
-
var
|
|
448
|
+
}, "drawCommitBullet"), Yr = /* @__PURE__ */ m((t, r, e, a) => {
|
|
449
|
+
var c;
|
|
450
450
|
if (r.type !== u.CHERRY_PICK && (r.customId && r.type === u.MERGE || r.type !== u.MERGE) && E != null && E.showCommitLabel) {
|
|
451
|
-
const
|
|
451
|
+
const i = t.append("g"), d = i.insert("rect").attr("class", "commit-label-bkg"), h = i.append("text").attr("x", a).attr("y", e.y + 25).attr("class", "commit-label").text(r.id), l = (c = h.node()) == null ? void 0 : c.getBBox();
|
|
452
452
|
if (l && (d.attr("x", e.posWithOffset - l.width / 2 - M).attr("y", e.y + 13.5).attr("width", l.width + 2 * M).attr("height", l.height + 2 * M), f === "TB" || f === "BT" ? (d.attr("x", e.x - (l.width + 4 * L + 5)).attr("y", e.y - 12), h.attr("x", e.x - (l.width + 4 * L)).attr("y", e.y + l.height - 12)) : h.attr("x", e.posWithOffset - l.width / 2), E.rotateCommitLabel))
|
|
453
453
|
if (f === "TB" || f === "BT")
|
|
454
454
|
h.attr(
|
|
@@ -460,51 +460,51 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
460
460
|
);
|
|
461
461
|
else {
|
|
462
462
|
const o = -7.5 - (l.width + 10) / 25 * 9.5, n = 10 + l.width / 25 * 8.5;
|
|
463
|
-
|
|
463
|
+
i.attr(
|
|
464
464
|
"transform",
|
|
465
|
-
"translate(" + o + ", " + n + ") rotate(-45, " +
|
|
465
|
+
"translate(" + o + ", " + n + ") rotate(-45, " + a + ", " + e.y + ")"
|
|
466
466
|
);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
}, "drawCommitLabel"),
|
|
470
|
-
var
|
|
469
|
+
}, "drawCommitLabel"), Ur = /* @__PURE__ */ m((t, r, e, a) => {
|
|
470
|
+
var c;
|
|
471
471
|
if (r.tags.length > 0) {
|
|
472
|
-
let
|
|
472
|
+
let i = 0, d = 0, h = 0;
|
|
473
473
|
const l = [];
|
|
474
474
|
for (const o of r.tags.reverse()) {
|
|
475
|
-
const n = t.insert("polygon"), x = t.append("circle"), $ = t.append("text").attr("y", e.y - 16 -
|
|
475
|
+
const n = t.insert("polygon"), x = t.append("circle"), $ = t.append("text").attr("y", e.y - 16 - i).attr("class", "tag-label").text(o), y = (c = $.node()) == null ? void 0 : c.getBBox();
|
|
476
476
|
if (!y)
|
|
477
477
|
throw new Error("Tag bbox not found");
|
|
478
478
|
d = Math.max(d, y.width), h = Math.max(h, y.height), $.attr("x", e.posWithOffset - y.width / 2), l.push({
|
|
479
479
|
tag: $,
|
|
480
480
|
hole: x,
|
|
481
481
|
rect: n,
|
|
482
|
-
yOffset:
|
|
483
|
-
}),
|
|
482
|
+
yOffset: i
|
|
483
|
+
}), i += 20;
|
|
484
484
|
}
|
|
485
485
|
for (const { tag: o, hole: n, rect: x, yOffset: $ } of l) {
|
|
486
486
|
const y = h / 2, p = e.y - 19.2 - $;
|
|
487
487
|
if (x.attr("class", "tag-label-bkg").attr(
|
|
488
488
|
"points",
|
|
489
489
|
`
|
|
490
|
-
${
|
|
491
|
-
${
|
|
490
|
+
${a - d / 2 - L / 2},${p + M}
|
|
491
|
+
${a - d / 2 - L / 2},${p - M}
|
|
492
492
|
${e.posWithOffset - d / 2 - L},${p - y - M}
|
|
493
493
|
${e.posWithOffset + d / 2 + L},${p - y - M}
|
|
494
494
|
${e.posWithOffset + d / 2 + L},${p + y + M}
|
|
495
495
|
${e.posWithOffset - d / 2 - L},${p + y + M}`
|
|
496
|
-
), n.attr("cy", p).attr("cx",
|
|
497
|
-
const g =
|
|
496
|
+
), n.attr("cy", p).attr("cx", a - d / 2 + L / 2).attr("r", 1.5).attr("class", "tag-hole"), f === "TB" || f === "BT") {
|
|
497
|
+
const g = a + $;
|
|
498
498
|
x.attr("class", "tag-label-bkg").attr(
|
|
499
499
|
"points",
|
|
500
500
|
`
|
|
501
501
|
${e.x},${g + 2}
|
|
502
502
|
${e.x},${g - 2}
|
|
503
|
-
${e.x +
|
|
504
|
-
${e.x +
|
|
505
|
-
${e.x +
|
|
506
|
-
${e.x +
|
|
507
|
-
).attr("transform", "translate(12,12) rotate(45, " + e.x + "," +
|
|
503
|
+
${e.x + A},${g - y - 2}
|
|
504
|
+
${e.x + A + d + 4},${g - y - 2}
|
|
505
|
+
${e.x + A + d + 4},${g + y + 2}
|
|
506
|
+
${e.x + A},${g + y + 2}`
|
|
507
|
+
).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + a + ")"), n.attr("cx", e.x + L / 2).attr("cy", g).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + a + ")"), o.attr("x", e.x + 5).attr("y", g + 3).attr("transform", "translate(14,14) rotate(45, " + e.x + "," + a + ")");
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
}
|
|
@@ -523,66 +523,66 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
523
523
|
default:
|
|
524
524
|
return "commit-normal";
|
|
525
525
|
}
|
|
526
|
-
}, "getCommitClassType"),
|
|
527
|
-
const
|
|
526
|
+
}, "getCommitClassType"), Jr = /* @__PURE__ */ m((t, r, e, a) => {
|
|
527
|
+
const c = { x: 0, y: 0 };
|
|
528
528
|
if (t.parents.length > 0) {
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
531
|
-
const d =
|
|
532
|
-
return r === "TB" ? d.y +
|
|
529
|
+
const i = J(t.parents);
|
|
530
|
+
if (i) {
|
|
531
|
+
const d = a.get(i) ?? c;
|
|
532
|
+
return r === "TB" ? d.y + I : r === "BT" ? (a.get(t.id) ?? c).y - I : d.x + I;
|
|
533
533
|
}
|
|
534
534
|
} else
|
|
535
|
-
return r === "TB" ? z : r === "BT" ? (
|
|
535
|
+
return r === "TB" ? z : r === "BT" ? (a.get(t.id) ?? c).y - I : 0;
|
|
536
536
|
return 0;
|
|
537
|
-
}, "calculatePosition"),
|
|
538
|
-
var
|
|
539
|
-
const
|
|
537
|
+
}, "calculatePosition"), Qr = /* @__PURE__ */ m((t, r, e) => {
|
|
538
|
+
var a, c;
|
|
539
|
+
const i = f === "BT" && e ? r : r + A, d = f === "TB" || f === "BT" ? i : (a = v.get(t.branch)) == null ? void 0 : a.pos, h = f === "TB" || f === "BT" ? (c = v.get(t.branch)) == null ? void 0 : c.pos : i;
|
|
540
540
|
if (h === void 0 || d === void 0)
|
|
541
541
|
throw new Error(`Position were undefined for commit ${t.id}`);
|
|
542
|
-
return { x: h, y: d, posWithOffset:
|
|
543
|
-
}, "getCommitPosition"),
|
|
542
|
+
return { x: h, y: d, posWithOffset: i };
|
|
543
|
+
}, "getCommitPosition"), _ = /* @__PURE__ */ m((t, r, e) => {
|
|
544
544
|
if (!E)
|
|
545
545
|
throw new Error("GitGraph config not found");
|
|
546
|
-
const
|
|
547
|
-
let
|
|
546
|
+
const a = t.append("g").attr("class", "commit-bullets"), c = t.append("g").attr("class", "commit-labels");
|
|
547
|
+
let i = f === "TB" || f === "BT" ? z : 0;
|
|
548
548
|
const d = [...r.keys()], h = (E == null ? void 0 : E.parallelCommits) ?? !1, l = /* @__PURE__ */ m((n, x) => {
|
|
549
549
|
var $, y;
|
|
550
550
|
const p = ($ = r.get(n)) == null ? void 0 : $.seq, g = (y = r.get(x)) == null ? void 0 : y.seq;
|
|
551
551
|
return p !== void 0 && g !== void 0 ? p - g : 0;
|
|
552
552
|
}, "sortKeys");
|
|
553
553
|
let o = d.sort(l);
|
|
554
|
-
f === "BT" && (h &&
|
|
554
|
+
f === "BT" && (h && Dr(o, r, i), o = o.reverse()), o.forEach((n) => {
|
|
555
555
|
var x;
|
|
556
556
|
const $ = r.get(n);
|
|
557
557
|
if (!$)
|
|
558
558
|
throw new Error(`Commit not found for key ${n}`);
|
|
559
|
-
h && (
|
|
560
|
-
const y =
|
|
559
|
+
h && (i = Jr($, f, i, C));
|
|
560
|
+
const y = Qr($, i, h);
|
|
561
561
|
if (e) {
|
|
562
562
|
const p = Vr($), g = $.customType ?? $.type, T = ((x = v.get($.branch)) == null ? void 0 : x.index) ?? 0;
|
|
563
|
-
|
|
563
|
+
Fr(a, $, y, p, T, g), Yr(c, $, y, i), Ur(c, $, y, i);
|
|
564
564
|
}
|
|
565
|
-
f === "TB" || f === "BT" ?
|
|
565
|
+
f === "TB" || f === "BT" ? C.set($.id, { x: y.x, y: y.posWithOffset }) : C.set($.id, { x: y.posWithOffset, y: y.y }), i = f === "BT" && h ? i + I : i + I + A, i > R && (R = i);
|
|
566
566
|
});
|
|
567
|
-
}, "drawCommits"),
|
|
568
|
-
const
|
|
569
|
-
return [...
|
|
567
|
+
}, "drawCommits"), Xr = /* @__PURE__ */ m((t, r, e, a, c) => {
|
|
568
|
+
const i = (f === "TB" || f === "BT" ? e.x < a.x : e.y < a.y) ? r.branch : t.branch, d = /* @__PURE__ */ m((l) => l.branch === i, "isOnBranchToGetCurve"), h = /* @__PURE__ */ m((l) => l.seq > t.seq && l.seq < r.seq, "isBetweenCommits");
|
|
569
|
+
return [...c.values()].some((l) => h(l) && d(l));
|
|
570
570
|
}, "shouldRerouteArrow"), H = /* @__PURE__ */ m((t, r, e = 0) => {
|
|
571
|
-
const
|
|
571
|
+
const a = t + Math.abs(t - r) / 2;
|
|
572
572
|
if (e > 5)
|
|
573
|
-
return
|
|
574
|
-
if (S.every((
|
|
575
|
-
return S.push(
|
|
576
|
-
const
|
|
577
|
-
return H(t, r -
|
|
578
|
-
}, "findLane"), Zr = /* @__PURE__ */ m((t, r, e,
|
|
579
|
-
var
|
|
580
|
-
const o =
|
|
573
|
+
return a;
|
|
574
|
+
if (S.every((i) => Math.abs(i - a) >= 10))
|
|
575
|
+
return S.push(a), a;
|
|
576
|
+
const c = Math.abs(t - r);
|
|
577
|
+
return H(t, r - c / 5, e + 1);
|
|
578
|
+
}, "findLane"), Zr = /* @__PURE__ */ m((t, r, e, a) => {
|
|
579
|
+
var c, i, d, h, l;
|
|
580
|
+
const o = C.get(r.id), n = C.get(e.id);
|
|
581
581
|
if (o === void 0 || n === void 0)
|
|
582
582
|
throw new Error(`Commit positions not found for commits ${r.id} and ${e.id}`);
|
|
583
|
-
const x =
|
|
584
|
-
let $ = "", y = "", p = 0, g = 0, T = (
|
|
585
|
-
e.type === u.MERGE && r.id !== e.parents[0] && (T = (
|
|
583
|
+
const x = Xr(r, e, o, n, a);
|
|
584
|
+
let $ = "", y = "", p = 0, g = 0, T = (c = v.get(e.branch)) == null ? void 0 : c.index;
|
|
585
|
+
e.type === u.MERGE && r.id !== e.parents[0] && (T = (i = v.get(r.branch)) == null ? void 0 : i.index);
|
|
586
586
|
let b;
|
|
587
587
|
if (x) {
|
|
588
588
|
$ = "A 10 10, 0, 0, 0,", y = "A 10 10, 0, 0, 1,", p = 10, g = 10;
|
|
@@ -595,22 +595,22 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
595
595
|
t.append("path").attr("d", b).attr("class", "arrow arrow" + T % G);
|
|
596
596
|
}, "drawArrow"), rt = /* @__PURE__ */ m((t, r) => {
|
|
597
597
|
const e = t.append("g").attr("class", "commit-arrows");
|
|
598
|
-
[...r.keys()].forEach((
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
Zr(e, r.get(
|
|
598
|
+
[...r.keys()].forEach((a) => {
|
|
599
|
+
const c = r.get(a);
|
|
600
|
+
c.parents && c.parents.length > 0 && c.parents.forEach((i) => {
|
|
601
|
+
Zr(e, r.get(i), c, r);
|
|
602
602
|
});
|
|
603
603
|
});
|
|
604
604
|
}, "drawArrows"), tt = /* @__PURE__ */ m((t, r) => {
|
|
605
605
|
const e = t.append("g");
|
|
606
|
-
r.forEach((
|
|
607
|
-
var
|
|
608
|
-
const d =
|
|
606
|
+
r.forEach((a, c) => {
|
|
607
|
+
var i;
|
|
608
|
+
const d = c % G, h = (i = v.get(a.name)) == null ? void 0 : i.pos;
|
|
609
609
|
if (h === void 0)
|
|
610
|
-
throw new Error(`Position not found for branch ${
|
|
610
|
+
throw new Error(`Position not found for branch ${a.name}`);
|
|
611
611
|
const l = e.append("line");
|
|
612
612
|
l.attr("x1", 0), l.attr("y1", h), l.attr("x2", R), l.attr("y2", h), l.attr("class", "branch branch" + d), f === "TB" ? (l.attr("y1", z), l.attr("x1", h), l.attr("y2", R), l.attr("x2", h)) : f === "BT" && (l.attr("y1", R), l.attr("x1", h), l.attr("y2", z), l.attr("x2", h)), S.push(h);
|
|
613
|
-
const o =
|
|
613
|
+
const o = a.name, n = V(o), x = e.insert("rect"), $ = e.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + d);
|
|
614
614
|
$.node().appendChild(n);
|
|
615
615
|
const y = n.getBBox();
|
|
616
616
|
x.attr("class", "branchLabelBkg label" + d).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - ((E == null ? void 0 : E.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), $.attr(
|
|
@@ -618,16 +618,16 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
618
618
|
"translate(" + (-y.width - 14 - ((E == null ? void 0 : E.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (h - y.height / 2 - 1) + ")"
|
|
619
619
|
), f === "TB" ? (x.attr("x", h - y.width / 2 - 10).attr("y", 0), $.attr("transform", "translate(" + (h - y.width / 2 - 5) + ", 0)")) : f === "BT" ? (x.attr("x", h - y.width / 2 - 10).attr("y", R), $.attr("transform", "translate(" + (h - y.width / 2 - 5) + ", " + R + ")")) : x.attr("transform", "translate(-19, " + (h - y.height / 2) + ")");
|
|
620
620
|
});
|
|
621
|
-
}, "drawBranches"), et = /* @__PURE__ */ m(function(t, r, e,
|
|
622
|
-
return v.set(t, { pos: r, index: e }), r += 50 + (
|
|
623
|
-
}, "setBranchPosition"), ot = /* @__PURE__ */ m(function(t, r, e,
|
|
621
|
+
}, "drawBranches"), et = /* @__PURE__ */ m(function(t, r, e, a, c) {
|
|
622
|
+
return v.set(t, { pos: r, index: e }), r += 50 + (c ? 40 : 0) + (f === "TB" || f === "BT" ? a.width / 2 : 0), r;
|
|
623
|
+
}, "setBranchPosition"), ot = /* @__PURE__ */ m(function(t, r, e, a) {
|
|
624
624
|
if (Sr(), w.debug("in gitgraph renderer", t + `
|
|
625
625
|
`, "id:", r, e), !E)
|
|
626
626
|
throw new Error("GitGraph config not found");
|
|
627
|
-
const
|
|
628
|
-
q =
|
|
629
|
-
const d =
|
|
630
|
-
f =
|
|
627
|
+
const c = E.rotateCommitLabel ?? !1, i = a.db;
|
|
628
|
+
q = i.getCommits();
|
|
629
|
+
const d = i.getBranchesAsObjArray();
|
|
630
|
+
f = i.getDirection();
|
|
631
631
|
const h = ar(`[id="${r}"]`);
|
|
632
632
|
let l = 0;
|
|
633
633
|
d.forEach((o, n) => {
|
|
@@ -635,12 +635,12 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
635
635
|
const $ = V(o.name), y = h.append("g"), p = y.insert("g").attr("class", "branchLabel"), g = p.insert("g").attr("class", "label branch-label");
|
|
636
636
|
(x = g.node()) == null || x.appendChild($);
|
|
637
637
|
const T = $.getBBox();
|
|
638
|
-
l = et(o.name, l, n, T,
|
|
639
|
-
}),
|
|
638
|
+
l = et(o.name, l, n, T, c), g.remove(), p.remove(), y.remove();
|
|
639
|
+
}), _(h, q, !1), E.showBranches && tt(h, d), rt(h, q), _(h, q, !0), cr.insertTitle(
|
|
640
640
|
h,
|
|
641
641
|
"gitTitleText",
|
|
642
642
|
E.titleTopMargin ?? 0,
|
|
643
|
-
|
|
643
|
+
i.getDiagramTitle()
|
|
644
644
|
), ir(
|
|
645
645
|
void 0,
|
|
646
646
|
h,
|
|
@@ -649,7 +649,7 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
649
649
|
);
|
|
650
650
|
}, "draw"), nt = {
|
|
651
651
|
draw: ot
|
|
652
|
-
},
|
|
652
|
+
}, at = /* @__PURE__ */ m((t) => `
|
|
653
653
|
.commit-id,
|
|
654
654
|
.commit-msg,
|
|
655
655
|
.branch-label {
|
|
@@ -702,11 +702,11 @@ var Er = /* @__PURE__ */ m(function() {
|
|
|
702
702
|
font-size: 18px;
|
|
703
703
|
fill: ${t.textColor};
|
|
704
704
|
}
|
|
705
|
-
`, "getStyles"),
|
|
705
|
+
`, "getStyles"), ct = at, $t = {
|
|
706
706
|
parser: zr,
|
|
707
|
-
db:
|
|
707
|
+
db: U,
|
|
708
708
|
renderer: nt,
|
|
709
|
-
styles:
|
|
709
|
+
styles: ct
|
|
710
710
|
};
|
|
711
711
|
export {
|
|
712
712
|
$t as diagram
|