@omg-dev/app 0.5.1 → 0.6.1
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-lib/{ChangelogPage-BzsTWlhq.js → ChangelogPage-Cjj_DiYL.js} +33 -1
- package/dist-lib/{File-B-qYa2zY.js → File-DQRr5F_e.js} +1761 -1826
- package/dist-lib/FileEditor-BrI3dfcp.js +6895 -0
- package/dist-lib/FileTreePane-J8P-OiHb.js +8413 -0
- package/dist-lib/{FileViewer-Clmf04v1.js → FileViewer-DRrfus7c.js} +1 -1
- package/dist-lib/{SessionFilesPanel-K4lGGdJ4.js → SessionFilesPanel-DxVJ43fE.js} +69 -69
- package/dist-lib/{TermView-CWr-zJmM.js → TermView-B4V-DyD-.js} +521 -530
- package/dist-lib/{abnfDiagram-VRR7QNED-Chn1Z_p9.js → abnfDiagram-VRR7QNED-CiXfOnAu.js} +4 -4
- package/dist-lib/{arc-B652oHQ-.js → arc-QOMNKQA5.js} +1 -1
- package/dist-lib/{architectureDiagram-ZJ3FMSHR-CMatArpz.js → architectureDiagram-ZJ3FMSHR-BcFBTmfD.js} +2059 -2064
- package/dist-lib/{blockDiagram-677ZJIJ3-CEOPfI9A.js → blockDiagram-677ZJIJ3-Qj8-RIV3.js} +920 -925
- package/dist-lib/{c4Diagram-LMCZKHZV-DcUHrESL.js → c4Diagram-LMCZKHZV-BpinEmj4.js} +598 -593
- package/dist-lib/{channel-B5lJFbed.js → channel-D6YHMmF7.js} +1 -1
- package/dist-lib/{chat-engine-P0yDhFOX.js → chat-engine-CUiDTHFP.js} +1173 -1218
- package/dist-lib/chunk-2Q5K7J3B-CFSi414U.js +18 -0
- package/dist-lib/{chunk-32BRIVSS-IYmNSvH8.js → chunk-32BRIVSS-DvywQiCk.js} +1 -1
- package/dist-lib/{chunk-5VM5RSS4-DO2g-xIj.js → chunk-5VM5RSS4-xd6XuI9Q.js} +1 -1
- package/dist-lib/{chunk-BO2N2NFS-kYiI5SD9.js → chunk-BO2N2NFS-BbJdm-59.js} +4892 -4903
- package/dist-lib/{chunk-EX3LRPZG-N96wfks9.js → chunk-EX3LRPZG-BLDKx-Yg.js} +507 -514
- package/dist-lib/chunk-JWPE2WC7-DnwG7Xzp.js +8 -0
- package/dist-lib/chunk-MOJQB5TN-BrENeFT5.js +670 -0
- package/dist-lib/chunk-RYQCIY6F-I-J4fVFd.js +313 -0
- package/dist-lib/{chunk-V7JOEXUC-DQwf2vkP.js → chunk-V7JOEXUC-Bkakcs1-.js} +458 -453
- package/dist-lib/chunk-VR4S4FIN-BDq3jZ0m.js +19 -0
- package/dist-lib/{chunk-XXDRQBXY-Ccv4aRcn.js → chunk-XXDRQBXY-DRKeYnrF.js} +1 -1
- package/dist-lib/{classDiagram-v2-EOCWNBFH-DOn-rhuL.js → classDiagram-OUVF2IWQ-DISUfvR5.js} +2 -2
- package/dist-lib/{classDiagram-OUVF2IWQ-DOn-rhuL.js → classDiagram-v2-EOCWNBFH-DISUfvR5.js} +2 -2
- package/dist-lib/{coding-agents-page-DCafIpWL.js → coding-agents-page-DtxZ0nbQ.js} +152 -131
- package/dist-lib/computer-page-DIJeFOZz.js +8860 -0
- package/dist-lib/{cose-bilkent-JH36ORCC-C-tACTrT.js → cose-bilkent-JH36ORCC-DCfmoChv.js} +281 -281
- package/dist-lib/{create-BrnHvSDE.js → create-CBk9uwJH.js} +2 -2
- package/dist-lib/cynefin-VYW2F7L2-XAY3mHv8.js +24430 -0
- package/dist-lib/{cynefinDiagram-TSTJHNR4-Be7CamD2.js → cynefinDiagram-TSTJHNR4-CrgvPEr1.js} +3 -3
- package/dist-lib/{cytoscape.esm-B0ledd6M.js → cytoscape.esm-BB6Ga9He.js} +3 -3
- package/dist-lib/dagre-VKFMJZFB-CE5k06mJ.js +343 -0
- package/dist-lib/{diagram-FQU43EPY-Jg12ow4Z.js → diagram-FQU43EPY-gOcCiJEN.js} +136 -139
- package/dist-lib/diagram-G47NLZAW-BVJLfRsd.js +531 -0
- package/dist-lib/diagram-NH7WQ7WH-u6QnHasL.js +145 -0
- package/dist-lib/diagram-OA4YK3LP-D4Kcl3uM.js +350 -0
- package/dist-lib/{diagram-WEI45ONY-D1kKPOc_.js → diagram-WEI45ONY-6a__oIb0.js} +38 -42
- package/dist-lib/{ebnfDiagram-CCIWWBDH-BhQWrGMc.js → ebnfDiagram-CCIWWBDH-PXSrB6lG.js} +4 -4
- package/dist-lib/{embedded-CLYU5z7h.js → embedded-PUsgcSTE.js} +10592 -10725
- package/dist-lib/{engine-compile-BeDRSL6Y.js → engine-compile-D_stzVMa.js} +2939 -2991
- package/dist-lib/{erDiagram-Q63AITRT-D2q6Nmwa.js → erDiagram-Q63AITRT-BbsttUCs.js} +286 -284
- package/dist-lib/flowDiagram-23GEKE2U-CX5x3zVA.js +1641 -0
- package/dist-lib/{ganttDiagram-NO4QXBWP-C_Lj-cJB.js → ganttDiagram-NO4QXBWP-Bq0aSPs8.js} +2 -2
- package/dist-lib/gitGraphDiagram-IHSO6WYX-BjAezjIv.js +815 -0
- package/dist-lib/{graph-B68L3K2T.js → graph-DAHC4kPm.js} +2 -2
- package/dist-lib/{highlighted-body-OFNGDK62-C2DGVKV8.js → highlighted-body-OFNGDK62-DWhG_ijx.js} +1 -1
- package/dist-lib/index-B0neMIbR.js +16520 -0
- package/dist-lib/index-BBC0E3Qg.js +4994 -0
- package/dist-lib/{index-Dtkd4mEk.js → index-CE7H8LiZ.js} +2 -2
- package/dist-lib/{index-DWkBvb-9.js → index-FgVvPpIY.js} +2 -2
- package/dist-lib/index.js +1 -1
- package/dist-lib/{infoDiagram-FWYZ7A6U-BbUkT0KS.js → infoDiagram-FWYZ7A6U-Bo_FNR91.js} +2 -2
- package/dist-lib/ishikawaDiagram-FXEZZL3T-C5bGD-Eb.js +624 -0
- package/dist-lib/{journeyDiagram-5HDEW3XC-CgykmVSC.js → journeyDiagram-5HDEW3XC-C8qM7SxF.js} +4 -4
- package/dist-lib/kanban-definition-HUTT4EX6-C-EK5Puz.js +724 -0
- package/dist-lib/{katex-jHfnQmlp.js → katex-DoRnZ_sp.js} +1 -1
- package/dist-lib/{layout-BGrtsiRL.js → layout-DBbo_M5I.js} +2 -2
- package/dist-lib/{linear-B5ZSwawJ.js → linear-zGzX0-I0.js} +1 -1
- package/dist-lib/{map-hbfFlSln.js → map-DRdzG8Ho.js} +1 -1
- package/dist-lib/mermaid-GHXKKRXX-hOE9C3qW.js +4 -0
- package/dist-lib/{mindmap-definition-LN4V7U3C-CfhfeEht.js → mindmap-definition-LN4V7U3C-DlVCRx6k.js} +310 -311
- package/dist-lib/{pegDiagram-2B236MQR-CYDAJHPF.js → pegDiagram-2B236MQR-DrKNikeG.js} +4 -4
- package/dist-lib/{pieDiagram-ENE6RG2P-udKxQm4p.js → pieDiagram-ENE6RG2P-Fm_jc0HL.js} +83 -84
- package/dist-lib/quadrantDiagram-ABIIQ3AL-zDRY0VtB.js +1029 -0
- package/dist-lib/{railroadDiagram-RFXS5EU6-q0Svkmuy.js → railroadDiagram-RFXS5EU6-BQuFX39y.js} +4 -4
- package/dist-lib/{requirementDiagram-TGXJPOKE-tNxRI1gc.js → requirementDiagram-TGXJPOKE-BWwBQZXn.js} +269 -268
- package/dist-lib/{resume-session-sheet-CHwpwguS.js → resume-session-sheet-DTe_2QtJ.js} +2 -3
- package/dist-lib/sankeyDiagram-HTMAVEWB-BjRyuB6L.js +859 -0
- package/dist-lib/{sequenceDiagram-DBY2YBRQ-Dvl2_CXL.js → sequenceDiagram-DBY2YBRQ-69pcw_2M.js} +892 -899
- package/dist-lib/{session-token-usage-BUz6b-IB.js → session-token-usage-DY4vFlfs.js} +82 -83
- package/dist-lib/{shadow-text-size-CBCTdbYU.js → shadow-text-size-smWA4wIU.js} +1 -2
- package/dist-lib/{shipped-page-CXy85bsL.js → shipped-page-B-ruG8li.js} +233 -236
- package/dist-lib/sizeCapture-X5ZJPWSS-DqkV8s1N.js +46 -0
- package/dist-lib/{stateDiagram-2N3HPSRC-CnWB7HvU.js → stateDiagram-2N3HPSRC-0vE3REl_.js} +4 -4
- package/dist-lib/{stateDiagram-v2-6OUMAXLB-DnZ0UI2p.js → stateDiagram-v2-6OUMAXLB-u_56Obsh.js} +2 -2
- package/dist-lib/{streamdown-response-CUB9sK6V.js → streamdown-response-BQy3geXs.js} +290 -297
- package/dist-lib/styles.css +1 -1
- package/dist-lib/swimlanes-5IMT3BWC-H0raIBd1.js +5332 -0
- package/dist-lib/{swimlanesDiagram-G3AALYLV-CKyOeqF_.js → swimlanesDiagram-G3AALYLV-By52HaDu.js} +2 -2
- package/dist-lib/timeline-definition-FHXFAJF6-h1LLYUQk.js +1055 -0
- package/dist-lib/vennDiagram-L72KCM5P-B4wDw_Kh.js +1578 -0
- package/dist-lib/wardleyDiagram-EHGQE667-DLMBGiwD.js +678 -0
- package/dist-lib/{xychartDiagram-FW5EYKEG-m3s7caPv.js → xychartDiagram-FW5EYKEG-BHvf5Noj.js} +526 -496
- package/package.json +4 -3
- package/dist-lib/FileEditor-BIz0qCyW.js +0 -6892
- package/dist-lib/FileTreePane-BG2k7gTc.js +0 -8422
- package/dist-lib/chunk-2Q5K7J3B-Ex8Ly28R.js +0 -15
- package/dist-lib/chunk-JWPE2WC7-DFPBClX_.js +0 -9
- package/dist-lib/chunk-MOJQB5TN-dusfI9ob.js +0 -664
- package/dist-lib/chunk-RYQCIY6F-fkeERzIG.js +0 -315
- package/dist-lib/chunk-VR4S4FIN-hOZG7eF3.js +0 -20
- package/dist-lib/cynefin-VYW2F7L2-DQXPWaog.js +0 -23853
- package/dist-lib/dagre-VKFMJZFB-BhCjK7XQ.js +0 -346
- package/dist-lib/diagram-G47NLZAW-C3_z2t6T.js +0 -530
- package/dist-lib/diagram-NH7WQ7WH-DUdK08IT.js +0 -143
- package/dist-lib/diagram-OA4YK3LP-TUUyRYY3.js +0 -353
- package/dist-lib/flowDiagram-23GEKE2U-DU3S3biU.js +0 -1645
- package/dist-lib/gitGraphDiagram-IHSO6WYX-CvGu0XAR.js +0 -828
- package/dist-lib/index-DcwavxA1.js +0 -5062
- package/dist-lib/index-JkCQXUYs.js +0 -16566
- package/dist-lib/ishikawaDiagram-FXEZZL3T-D_Y6Tuyb.js +0 -622
- package/dist-lib/kanban-definition-HUTT4EX6-CPFLTskY.js +0 -726
- package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +0 -4
- package/dist-lib/quadrantDiagram-ABIIQ3AL-BmDmLczk.js +0 -1025
- package/dist-lib/sankeyDiagram-HTMAVEWB-B9Bl7f2P.js +0 -847
- package/dist-lib/sizeCapture-X5ZJPWSS-B1EeO3N9.js +0 -47
- package/dist-lib/swimlanes-5IMT3BWC-CvqDJcS9.js +0 -5353
- package/dist-lib/timeline-definition-FHXFAJF6-b15X0Oru.js +0 -1066
- package/dist-lib/vennDiagram-L72KCM5P-C4lh5m77.js +0 -1585
- package/dist-lib/wardleyDiagram-EHGQE667-Cev6fT_D.js +0 -684
|
@@ -0,0 +1,815 @@
|
|
|
1
|
+
import { I as le } from "./chunk-2Q5K7J3B-CFSi414U.js";
|
|
2
|
+
import { p as he } from "./chunk-JWPE2WC7-DnwG7Xzp.js";
|
|
3
|
+
import { p as $e, o as fe, s as ge, g as ue, a as ye, b as xe, _ as h, z as J, l as w, d as me, c as W, y as pe, A as be, q as we, k as B, B as ke, D as ve, E as Ce } from "./index-B0neMIbR.js";
|
|
4
|
+
import { p as Ee } from "./cynefin-VYW2F7L2-XAY3mHv8.js";
|
|
5
|
+
var m = {
|
|
6
|
+
NORMAL: 0,
|
|
7
|
+
REVERSE: 1,
|
|
8
|
+
HIGHLIGHT: 2,
|
|
9
|
+
MERGE: 3,
|
|
10
|
+
CHERRY_PICK: 4
|
|
11
|
+
}, Be = ve.gitGraph, S = /* @__PURE__ */ h(() => ke({
|
|
12
|
+
...Be,
|
|
13
|
+
...J().gitGraph
|
|
14
|
+
}), "getConfig"), d = new le(() => {
|
|
15
|
+
const e = S(), r = e.mainBranchName, t = e.mainBranchOrder;
|
|
16
|
+
return {
|
|
17
|
+
mainBranchName: r,
|
|
18
|
+
commits: /* @__PURE__ */ new Map(),
|
|
19
|
+
head: null,
|
|
20
|
+
branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: t }]]),
|
|
21
|
+
branches: /* @__PURE__ */ new Map([[r, null]]),
|
|
22
|
+
currBranch: r,
|
|
23
|
+
direction: "LR",
|
|
24
|
+
seq: 0,
|
|
25
|
+
options: {}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
function Y() {
|
|
29
|
+
return Ce({ length: 7 });
|
|
30
|
+
}
|
|
31
|
+
h(Y, "getID");
|
|
32
|
+
function te(e, r) {
|
|
33
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
34
|
+
return e.reduce((s, o) => {
|
|
35
|
+
const i = r(o);
|
|
36
|
+
return t[i] || (t[i] = !0, s.push(o)), s;
|
|
37
|
+
}, []);
|
|
38
|
+
}
|
|
39
|
+
h(te, "uniqBy");
|
|
40
|
+
var Te = /* @__PURE__ */ h(function(e) {
|
|
41
|
+
d.records.direction = e;
|
|
42
|
+
}, "setDirection"), Le = /* @__PURE__ */ h(function(e) {
|
|
43
|
+
w.debug("options str", e), e = e?.trim(), e = e || "{}";
|
|
44
|
+
try {
|
|
45
|
+
d.records.options = JSON.parse(e);
|
|
46
|
+
} catch (r) {
|
|
47
|
+
w.error("error while parsing gitGraph options", r.message);
|
|
48
|
+
}
|
|
49
|
+
}, "setOptions"), Me = /* @__PURE__ */ h(function() {
|
|
50
|
+
return d.records.options;
|
|
51
|
+
}, "getOptions"), Re = /* @__PURE__ */ h(function(e) {
|
|
52
|
+
let r = e.msg, t = e.id;
|
|
53
|
+
const s = e.type;
|
|
54
|
+
let o = e.tags;
|
|
55
|
+
w.info("commit", r, t, s, o), w.debug("Entering commit:", r, t, s, o);
|
|
56
|
+
const i = S();
|
|
57
|
+
t = B.sanitizeText(t, i), r = B.sanitizeText(r, i), o = o?.map((a) => B.sanitizeText(a, i));
|
|
58
|
+
const n = {
|
|
59
|
+
id: t || d.records.seq + "-" + Y(),
|
|
60
|
+
message: r,
|
|
61
|
+
seq: d.records.seq++,
|
|
62
|
+
type: s ?? m.NORMAL,
|
|
63
|
+
tags: o ?? [],
|
|
64
|
+
parents: d.records.head == null ? [] : [d.records.head.id],
|
|
65
|
+
branch: d.records.currBranch
|
|
66
|
+
};
|
|
67
|
+
d.records.head = n, w.info("main branch", i.mainBranchName), d.records.commits.has(n.id) && w.warn(`Commit ID ${n.id} already exists`), d.records.commits.set(n.id, n), d.records.branches.set(d.records.currBranch, n.id), w.debug("in pushCommit " + n.id);
|
|
68
|
+
}, "commit"), Ie = /* @__PURE__ */ h(function(e) {
|
|
69
|
+
let r = e.name;
|
|
70
|
+
const t = e.order;
|
|
71
|
+
if (r = B.sanitizeText(r, S()), d.records.branches.has(r))
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
|
|
74
|
+
);
|
|
75
|
+
d.records.branches.set(r, d.records.head != null ? d.records.head.id : null), d.records.branchConfig.set(r, { name: r, order: t }), ae(r), w.debug("in createBranch");
|
|
76
|
+
}, "branch"), Oe = /* @__PURE__ */ h((e) => {
|
|
77
|
+
let r = e.branch, t = e.id;
|
|
78
|
+
const s = e.type, o = e.tags, i = S();
|
|
79
|
+
r = B.sanitizeText(r, i), t && (t = B.sanitizeText(t, i));
|
|
80
|
+
const n = d.records.branches.get(d.records.currBranch), a = d.records.branches.get(r), l = n ? d.records.commits.get(n) : void 0, f = a ? d.records.commits.get(a) : void 0;
|
|
81
|
+
if (l && f && l.branch === r)
|
|
82
|
+
throw new Error(`Cannot merge branch '${r}' into itself.`);
|
|
83
|
+
if (d.records.currBranch === r) {
|
|
84
|
+
const c = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
|
|
85
|
+
throw c.hash = {
|
|
86
|
+
text: `merge ${r}`,
|
|
87
|
+
token: `merge ${r}`,
|
|
88
|
+
expected: ["branch abc"]
|
|
89
|
+
}, c;
|
|
90
|
+
}
|
|
91
|
+
if (l === void 0 || !l) {
|
|
92
|
+
const c = new Error(
|
|
93
|
+
`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`
|
|
94
|
+
);
|
|
95
|
+
throw c.hash = {
|
|
96
|
+
text: `merge ${r}`,
|
|
97
|
+
token: `merge ${r}`,
|
|
98
|
+
expected: ["commit"]
|
|
99
|
+
}, c;
|
|
100
|
+
}
|
|
101
|
+
if (!d.records.branches.has(r)) {
|
|
102
|
+
const c = new Error(
|
|
103
|
+
'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
|
|
104
|
+
);
|
|
105
|
+
throw c.hash = {
|
|
106
|
+
text: `merge ${r}`,
|
|
107
|
+
token: `merge ${r}`,
|
|
108
|
+
expected: [`branch ${r}`]
|
|
109
|
+
}, c;
|
|
110
|
+
}
|
|
111
|
+
if (f === void 0 || !f) {
|
|
112
|
+
const c = new Error(
|
|
113
|
+
'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
|
|
114
|
+
);
|
|
115
|
+
throw c.hash = {
|
|
116
|
+
text: `merge ${r}`,
|
|
117
|
+
token: `merge ${r}`,
|
|
118
|
+
expected: ['"commit"']
|
|
119
|
+
}, c;
|
|
120
|
+
}
|
|
121
|
+
if (l === f) {
|
|
122
|
+
const c = new Error('Incorrect usage of "merge". Both branches have same head');
|
|
123
|
+
throw c.hash = {
|
|
124
|
+
text: `merge ${r}`,
|
|
125
|
+
token: `merge ${r}`,
|
|
126
|
+
expected: ["branch abc"]
|
|
127
|
+
}, c;
|
|
128
|
+
}
|
|
129
|
+
if (t && d.records.commits.has(t)) {
|
|
130
|
+
const c = new Error(
|
|
131
|
+
'Incorrect usage of "merge". Commit with id:' + t + " already exists, use different custom id"
|
|
132
|
+
);
|
|
133
|
+
throw c.hash = {
|
|
134
|
+
text: `merge ${r} ${t} ${s} ${o?.join(" ")}`,
|
|
135
|
+
token: `merge ${r} ${t} ${s} ${o?.join(" ")}`,
|
|
136
|
+
expected: [
|
|
137
|
+
`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`
|
|
138
|
+
]
|
|
139
|
+
}, c;
|
|
140
|
+
}
|
|
141
|
+
const g = a || "", $ = {
|
|
142
|
+
id: t || `${d.records.seq}-${Y()}`,
|
|
143
|
+
message: `merged branch ${r} into ${d.records.currBranch}`,
|
|
144
|
+
seq: d.records.seq++,
|
|
145
|
+
parents: d.records.head == null ? [] : [d.records.head.id, g],
|
|
146
|
+
branch: d.records.currBranch,
|
|
147
|
+
type: m.MERGE,
|
|
148
|
+
customType: s,
|
|
149
|
+
customId: !!t,
|
|
150
|
+
tags: o ?? []
|
|
151
|
+
};
|
|
152
|
+
d.records.head = $, d.records.commits.set($.id, $), d.records.branches.set(d.records.currBranch, $.id), w.debug(d.records.branches), w.debug("in mergeBranch");
|
|
153
|
+
}, "merge"), _e = /* @__PURE__ */ h(function(e) {
|
|
154
|
+
let r = e.id, t = e.targetId, s = e.tags, o = e.parent;
|
|
155
|
+
w.debug("Entering cherryPick:", r, t, s);
|
|
156
|
+
const i = S();
|
|
157
|
+
if (r = B.sanitizeText(r, i), t = B.sanitizeText(t, i), s = s?.map((l) => B.sanitizeText(l, i)), o = B.sanitizeText(o, i), !r || !d.records.commits.has(r)) {
|
|
158
|
+
const l = new Error(
|
|
159
|
+
'Incorrect usage of "cherryPick". Source commit id should exist and provided'
|
|
160
|
+
);
|
|
161
|
+
throw l.hash = {
|
|
162
|
+
text: `cherryPick ${r} ${t}`,
|
|
163
|
+
token: `cherryPick ${r} ${t}`,
|
|
164
|
+
expected: ["cherry-pick abc"]
|
|
165
|
+
}, l;
|
|
166
|
+
}
|
|
167
|
+
const n = d.records.commits.get(r);
|
|
168
|
+
if (n === void 0 || !n)
|
|
169
|
+
throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
|
|
170
|
+
if (o && !(Array.isArray(n.parents) && n.parents.includes(o)))
|
|
171
|
+
throw new Error(
|
|
172
|
+
"Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
|
|
173
|
+
);
|
|
174
|
+
const a = n.branch;
|
|
175
|
+
if (n.type === m.MERGE && !o)
|
|
176
|
+
throw new Error(
|
|
177
|
+
"Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
|
|
178
|
+
);
|
|
179
|
+
if (!t || !d.records.commits.has(t)) {
|
|
180
|
+
if (a === d.records.currBranch) {
|
|
181
|
+
const $ = new Error(
|
|
182
|
+
'Incorrect usage of "cherryPick". Source commit is already on current branch'
|
|
183
|
+
);
|
|
184
|
+
throw $.hash = {
|
|
185
|
+
text: `cherryPick ${r} ${t}`,
|
|
186
|
+
token: `cherryPick ${r} ${t}`,
|
|
187
|
+
expected: ["cherry-pick abc"]
|
|
188
|
+
}, $;
|
|
189
|
+
}
|
|
190
|
+
const l = d.records.branches.get(d.records.currBranch);
|
|
191
|
+
if (l === void 0 || !l) {
|
|
192
|
+
const $ = new Error(
|
|
193
|
+
`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`
|
|
194
|
+
);
|
|
195
|
+
throw $.hash = {
|
|
196
|
+
text: `cherryPick ${r} ${t}`,
|
|
197
|
+
token: `cherryPick ${r} ${t}`,
|
|
198
|
+
expected: ["cherry-pick abc"]
|
|
199
|
+
}, $;
|
|
200
|
+
}
|
|
201
|
+
const f = d.records.commits.get(l);
|
|
202
|
+
if (f === void 0 || !f) {
|
|
203
|
+
const $ = new Error(
|
|
204
|
+
`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`
|
|
205
|
+
);
|
|
206
|
+
throw $.hash = {
|
|
207
|
+
text: `cherryPick ${r} ${t}`,
|
|
208
|
+
token: `cherryPick ${r} ${t}`,
|
|
209
|
+
expected: ["cherry-pick abc"]
|
|
210
|
+
}, $;
|
|
211
|
+
}
|
|
212
|
+
const g = {
|
|
213
|
+
id: d.records.seq + "-" + Y(),
|
|
214
|
+
message: `cherry-picked ${n?.message} into ${d.records.currBranch}`,
|
|
215
|
+
seq: d.records.seq++,
|
|
216
|
+
parents: d.records.head == null ? [] : [d.records.head.id, n.id],
|
|
217
|
+
branch: d.records.currBranch,
|
|
218
|
+
type: m.CHERRY_PICK,
|
|
219
|
+
tags: s ? s.filter(Boolean) : [
|
|
220
|
+
`cherry-pick:${n.id}${n.type === m.MERGE ? `|parent:${o}` : ""}`
|
|
221
|
+
]
|
|
222
|
+
};
|
|
223
|
+
d.records.head = g, d.records.commits.set(g.id, g), d.records.branches.set(d.records.currBranch, g.id), w.debug(d.records.branches), w.debug("in cherryPick");
|
|
224
|
+
}
|
|
225
|
+
}, "cherryPick"), ae = /* @__PURE__ */ h(function(e) {
|
|
226
|
+
if (e = B.sanitizeText(e, S()), d.records.branches.has(e)) {
|
|
227
|
+
d.records.currBranch = e;
|
|
228
|
+
const r = d.records.branches.get(d.records.currBranch);
|
|
229
|
+
r === void 0 || !r ? d.records.head = null : d.records.head = d.records.commits.get(r) ?? null;
|
|
230
|
+
} else {
|
|
231
|
+
const r = new Error(
|
|
232
|
+
`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`
|
|
233
|
+
);
|
|
234
|
+
throw r.hash = {
|
|
235
|
+
text: `checkout ${e}`,
|
|
236
|
+
token: `checkout ${e}`,
|
|
237
|
+
expected: [`branch ${e}`]
|
|
238
|
+
}, r;
|
|
239
|
+
}
|
|
240
|
+
}, "checkout");
|
|
241
|
+
function V(e, r, t) {
|
|
242
|
+
const s = e.indexOf(r);
|
|
243
|
+
s === -1 ? e.push(t) : e.splice(s, 1, t);
|
|
244
|
+
}
|
|
245
|
+
h(V, "upsert");
|
|
246
|
+
function Q(e) {
|
|
247
|
+
const r = e.reduce((o, i) => o.seq > i.seq ? o : i, e[0]);
|
|
248
|
+
let t = "";
|
|
249
|
+
e.forEach(function(o) {
|
|
250
|
+
o === r ? t += " *" : t += " |";
|
|
251
|
+
});
|
|
252
|
+
const s = [t, r.id, r.seq];
|
|
253
|
+
for (const o in d.records.branches)
|
|
254
|
+
d.records.branches.get(o) === r.id && s.push(o);
|
|
255
|
+
if (w.debug(s.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
|
|
256
|
+
const o = d.records.commits.get(r.parents[0]);
|
|
257
|
+
V(e, r, o), r.parents[1] && e.push(d.records.commits.get(r.parents[1]));
|
|
258
|
+
} else {
|
|
259
|
+
if (r.parents.length == 0)
|
|
260
|
+
return;
|
|
261
|
+
if (r.parents[0]) {
|
|
262
|
+
const o = d.records.commits.get(r.parents[0]);
|
|
263
|
+
V(e, r, o);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
e = te(e, (o) => o.id), Q(e);
|
|
267
|
+
}
|
|
268
|
+
h(Q, "prettyPrintCommitHistory");
|
|
269
|
+
var Ge = /* @__PURE__ */ h(function() {
|
|
270
|
+
w.debug(d.records.commits);
|
|
271
|
+
const e = ne()[0];
|
|
272
|
+
Q([e]);
|
|
273
|
+
}, "prettyPrint"), He = /* @__PURE__ */ h(function() {
|
|
274
|
+
d.reset(), we();
|
|
275
|
+
}, "clear"), Se = /* @__PURE__ */ h(function() {
|
|
276
|
+
return [...d.records.branchConfig.values()].map((r, t) => r.order !== null && r.order !== void 0 ? r : {
|
|
277
|
+
...r,
|
|
278
|
+
order: parseFloat(`0.${t}`)
|
|
279
|
+
}).sort((r, t) => (r.order ?? 0) - (t.order ?? 0)).map(({ name: r }) => ({ name: r }));
|
|
280
|
+
}, "getBranchesAsObjArray"), Ae = /* @__PURE__ */ h(function() {
|
|
281
|
+
return d.records.branches;
|
|
282
|
+
}, "getBranches"), De = /* @__PURE__ */ h(function() {
|
|
283
|
+
return d.records.commits;
|
|
284
|
+
}, "getCommits"), ne = /* @__PURE__ */ h(function() {
|
|
285
|
+
const e = [...d.records.commits.values()];
|
|
286
|
+
return e.forEach(function(r) {
|
|
287
|
+
w.debug(r.id);
|
|
288
|
+
}), e.sort((r, t) => r.seq - t.seq), e;
|
|
289
|
+
}, "getCommitsArray"), qe = /* @__PURE__ */ h(function() {
|
|
290
|
+
return d.records.currBranch;
|
|
291
|
+
}, "getCurrentBranch"), Pe = /* @__PURE__ */ h(function() {
|
|
292
|
+
return d.records.direction;
|
|
293
|
+
}, "getDirection"), We = /* @__PURE__ */ h(function() {
|
|
294
|
+
return d.records.head;
|
|
295
|
+
}, "getHead"), se = {
|
|
296
|
+
commitType: m,
|
|
297
|
+
getConfig: S,
|
|
298
|
+
setDirection: Te,
|
|
299
|
+
setOptions: Le,
|
|
300
|
+
getOptions: Me,
|
|
301
|
+
commit: Re,
|
|
302
|
+
branch: Ie,
|
|
303
|
+
merge: Oe,
|
|
304
|
+
cherryPick: _e,
|
|
305
|
+
checkout: ae,
|
|
306
|
+
//reset,
|
|
307
|
+
prettyPrint: Ge,
|
|
308
|
+
clear: He,
|
|
309
|
+
getBranchesAsObjArray: Se,
|
|
310
|
+
getBranches: Ae,
|
|
311
|
+
getCommits: De,
|
|
312
|
+
getCommitsArray: ne,
|
|
313
|
+
getCurrentBranch: qe,
|
|
314
|
+
getDirection: Pe,
|
|
315
|
+
getHead: We,
|
|
316
|
+
setAccTitle: xe,
|
|
317
|
+
getAccTitle: ye,
|
|
318
|
+
getAccDescription: ue,
|
|
319
|
+
setAccDescription: ge,
|
|
320
|
+
setDiagramTitle: fe,
|
|
321
|
+
getDiagramTitle: $e
|
|
322
|
+
}, Ne = /* @__PURE__ */ h((e, r) => {
|
|
323
|
+
he(e, r), e.dir && r.setDirection(e.dir);
|
|
324
|
+
for (const t of e.statements)
|
|
325
|
+
Fe(t, r);
|
|
326
|
+
}, "populate"), Fe = /* @__PURE__ */ h((e, r) => {
|
|
327
|
+
const s = {
|
|
328
|
+
Commit: /* @__PURE__ */ h((o) => r.commit(ze(o)), "Commit"),
|
|
329
|
+
Branch: /* @__PURE__ */ h((o) => r.branch(Ye(o)), "Branch"),
|
|
330
|
+
Merge: /* @__PURE__ */ h((o) => r.merge(je(o)), "Merge"),
|
|
331
|
+
Checkout: /* @__PURE__ */ h((o) => r.checkout(Ue(o)), "Checkout"),
|
|
332
|
+
CherryPicking: /* @__PURE__ */ h((o) => r.cherryPick(Ke(o)), "CherryPicking")
|
|
333
|
+
}[e.$type];
|
|
334
|
+
s ? s(e) : w.error(`Unknown statement type: ${e.$type}`);
|
|
335
|
+
}, "parseStatement"), ze = /* @__PURE__ */ h((e) => ({
|
|
336
|
+
id: e.id,
|
|
337
|
+
msg: e.message ?? "",
|
|
338
|
+
type: e.type !== void 0 ? m[e.type] : m.NORMAL,
|
|
339
|
+
tags: e.tags ?? void 0
|
|
340
|
+
}), "parseCommit"), Ye = /* @__PURE__ */ h((e) => ({
|
|
341
|
+
name: e.name,
|
|
342
|
+
order: e.order ?? 0
|
|
343
|
+
}), "parseBranch"), je = /* @__PURE__ */ h((e) => ({
|
|
344
|
+
branch: e.branch,
|
|
345
|
+
id: e.id ?? "",
|
|
346
|
+
type: e.type !== void 0 ? m[e.type] : void 0,
|
|
347
|
+
tags: e.tags ?? void 0
|
|
348
|
+
}), "parseMerge"), Ue = /* @__PURE__ */ h((e) => e.branch, "parseCheckout"), Ke = /* @__PURE__ */ h((e) => ({
|
|
349
|
+
id: e.id,
|
|
350
|
+
targetId: "",
|
|
351
|
+
tags: e.tags?.length === 0 ? void 0 : e.tags,
|
|
352
|
+
parent: e.parent
|
|
353
|
+
}), "parseCherryPicking"), Ve = {
|
|
354
|
+
parse: /* @__PURE__ */ h(async (e) => {
|
|
355
|
+
const r = await Ee("gitGraph", e);
|
|
356
|
+
w.debug(r), Ne(r, se);
|
|
357
|
+
}, "parse")
|
|
358
|
+
}, O = 10, _ = 40, L = 4, R = 2, G = 8, j = /* @__PURE__ */ new Set(["redux", "redux-dark", "redux-color", "redux-dark-color"]), X = 12, Z = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Xe = /* @__PURE__ */ new Set(["dark", "redux-dark", "redux-dark-color", "neo-dark"]), H = /* @__PURE__ */ h((e, r, t = !1) => t && e > 0 ? (e - 1) % (r - 1) + 1 : e % r, "calcColorIndex"), C = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), F = 30, q = /* @__PURE__ */ new Map(), z = [], I = 0, y = "LR", Je = /* @__PURE__ */ h(() => {
|
|
359
|
+
C.clear(), E.clear(), q.clear(), I = 0, z = [], y = "LR";
|
|
360
|
+
}, "clear"), oe = /* @__PURE__ */ h((e) => {
|
|
361
|
+
const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
362
|
+
return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((s) => {
|
|
363
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
364
|
+
o.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), o.setAttribute("dy", "1em"), o.setAttribute("x", "0"), o.setAttribute("class", "row"), o.textContent = s.trim(), r.appendChild(o);
|
|
365
|
+
}), r;
|
|
366
|
+
}, "drawText"), ce = /* @__PURE__ */ h((e) => {
|
|
367
|
+
let r, t, s;
|
|
368
|
+
return y === "BT" ? (t = /* @__PURE__ */ h((o, i) => o <= i, "comparisonFunc"), s = 1 / 0) : (t = /* @__PURE__ */ h((o, i) => o >= i, "comparisonFunc"), s = 0), e.forEach((o) => {
|
|
369
|
+
const i = y === "TB" || y == "BT" ? E.get(o)?.y : E.get(o)?.x;
|
|
370
|
+
i !== void 0 && t(i, s) && (r = o, s = i);
|
|
371
|
+
}), r;
|
|
372
|
+
}, "findClosestParent"), Qe = /* @__PURE__ */ h((e) => {
|
|
373
|
+
let r = "", t = 1 / 0;
|
|
374
|
+
return e.forEach((s) => {
|
|
375
|
+
const o = E.get(s).y;
|
|
376
|
+
o <= t && (r = s, t = o);
|
|
377
|
+
}), r || void 0;
|
|
378
|
+
}, "findClosestParentBT"), Ze = /* @__PURE__ */ h((e, r, t) => {
|
|
379
|
+
let s = t, o = t;
|
|
380
|
+
const i = [];
|
|
381
|
+
e.forEach((n) => {
|
|
382
|
+
const a = r.get(n);
|
|
383
|
+
if (!a)
|
|
384
|
+
throw new Error(`Commit not found for key ${n}`);
|
|
385
|
+
a.parents.length ? (s = rr(a), o = Math.max(s, o)) : i.push(a), tr(a, s);
|
|
386
|
+
}), s = o, i.forEach((n) => {
|
|
387
|
+
ar(n, s, t);
|
|
388
|
+
}), e.forEach((n) => {
|
|
389
|
+
const a = r.get(n);
|
|
390
|
+
if (a?.parents.length) {
|
|
391
|
+
const l = Qe(a.parents);
|
|
392
|
+
s = E.get(l).y - _, s <= o && (o = s);
|
|
393
|
+
const f = C.get(a.branch).pos, g = s - O;
|
|
394
|
+
E.set(a.id, { x: f, y: g });
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}, "setParallelBTPos"), er = /* @__PURE__ */ h((e) => {
|
|
398
|
+
const r = ce(e.parents.filter((s) => s !== null));
|
|
399
|
+
if (!r)
|
|
400
|
+
throw new Error(`Closest parent not found for commit ${e.id}`);
|
|
401
|
+
const t = E.get(r)?.y;
|
|
402
|
+
if (t === void 0)
|
|
403
|
+
throw new Error(`Closest parent position not found for commit ${e.id}`);
|
|
404
|
+
return t;
|
|
405
|
+
}, "findClosestParentPos"), rr = /* @__PURE__ */ h((e) => er(e) + _, "calculateCommitPosition"), tr = /* @__PURE__ */ h((e, r) => {
|
|
406
|
+
const t = C.get(e.branch);
|
|
407
|
+
if (!t)
|
|
408
|
+
throw new Error(`Branch not found for commit ${e.id}`);
|
|
409
|
+
const s = t.pos, o = r + O;
|
|
410
|
+
return E.set(e.id, { x: s, y: o }), { x: s, y: o };
|
|
411
|
+
}, "setCommitPosition"), ar = /* @__PURE__ */ h((e, r, t) => {
|
|
412
|
+
const s = C.get(e.branch);
|
|
413
|
+
if (!s)
|
|
414
|
+
throw new Error(`Branch not found for commit ${e.id}`);
|
|
415
|
+
const o = r + t, i = s.pos;
|
|
416
|
+
E.set(e.id, { x: i, y: o });
|
|
417
|
+
}, "setRootPosition"), nr = /* @__PURE__ */ h((e, r, t, s, o, i) => {
|
|
418
|
+
const { theme: n } = W(), a = j.has(n ?? ""), l = Z.has(n ?? ""), f = Xe.has(n ?? "");
|
|
419
|
+
if (i === m.HIGHLIGHT)
|
|
420
|
+
e.append("rect").attr("x", t.x - 10 + (a ? 3 : 0)).attr("y", t.y - 10 + (a ? 3 : 0)).attr("width", a ? 14 : 20).attr("height", a ? 14 : 20).attr(
|
|
421
|
+
"class",
|
|
422
|
+
`commit ${r.id} commit-highlight${H(o, G, l)} ${s}-outer`
|
|
423
|
+
), e.append("rect").attr("x", t.x - 6 + (a ? 2 : 0)).attr("y", t.y - 6 + (a ? 2 : 0)).attr("width", a ? 8 : 12).attr("height", a ? 8 : 12).attr(
|
|
424
|
+
"class",
|
|
425
|
+
`commit ${r.id} commit${H(o, G, l)} ${s}-inner`
|
|
426
|
+
);
|
|
427
|
+
else if (i === m.CHERRY_PICK)
|
|
428
|
+
e.append("circle").attr("cx", t.x).attr("cy", t.y).attr("r", a ? 7 : 10).attr("class", `commit ${r.id} ${s}`), e.append("circle").attr("cx", t.x - 3).attr("cy", t.y + 2).attr("r", a ? 2.5 : 2.75).attr("fill", f ? "#000000" : "#fff").attr("class", `commit ${r.id} ${s}`), e.append("circle").attr("cx", t.x + 3).attr("cy", t.y + 2).attr("r", a ? 2.5 : 2.75).attr("fill", f ? "#000000" : "#fff").attr("class", `commit ${r.id} ${s}`), e.append("line").attr("x1", t.x + 3).attr("y1", t.y + 1).attr("x2", t.x).attr("y2", t.y - 5).attr("stroke", f ? "#000000" : "#fff").attr("class", `commit ${r.id} ${s}`), e.append("line").attr("x1", t.x - 3).attr("y1", t.y + 1).attr("x2", t.x).attr("y2", t.y - 5).attr("stroke", f ? "#000000" : "#fff").attr("class", `commit ${r.id} ${s}`);
|
|
429
|
+
else {
|
|
430
|
+
const g = e.append("circle");
|
|
431
|
+
if (g.attr("cx", t.x), g.attr("cy", t.y), g.attr("r", a ? 7 : 10), g.attr(
|
|
432
|
+
"class",
|
|
433
|
+
`commit ${r.id} commit${H(o, G, l)}`
|
|
434
|
+
), i === m.MERGE) {
|
|
435
|
+
const $ = e.append("circle");
|
|
436
|
+
$.attr("cx", t.x), $.attr("cy", t.y), $.attr("r", a ? 5 : 6), $.attr(
|
|
437
|
+
"class",
|
|
438
|
+
`commit ${s} ${r.id} commit${H(o, G, l)}`
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
if (i === m.REVERSE) {
|
|
442
|
+
const $ = e.append("path"), c = a ? 4 : 5;
|
|
443
|
+
$.attr(
|
|
444
|
+
"d",
|
|
445
|
+
`M ${t.x - c},${t.y - c}L${t.x + c},${t.y + c}M${t.x - c},${t.y + c}L${t.x + c},${t.y - c}`
|
|
446
|
+
).attr(
|
|
447
|
+
"class",
|
|
448
|
+
`commit ${s} ${r.id} commit${H(o, G, l)}`
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}, "drawCommitBullet"), sr = /* @__PURE__ */ h((e, r, t, s, o) => {
|
|
453
|
+
if (r.type !== m.CHERRY_PICK && (r.customId && r.type === m.MERGE || r.type !== m.MERGE) && o.showCommitLabel) {
|
|
454
|
+
const i = e.append("g"), n = i.insert("rect").attr("class", "commit-label-bkg"), a = i.append("text").attr("x", s).attr("y", t.y + 25).attr("class", "commit-label").text(r.id), l = a.node()?.getBBox();
|
|
455
|
+
if (l && (n.attr("x", t.posWithOffset - l.width / 2 - R).attr("y", t.y + 13.5).attr("width", l.width + 2 * R).attr("height", l.height + 2 * R), y === "TB" || y === "BT" ? (n.attr("x", t.x - (l.width + 4 * L + 5)).attr("y", t.y - 12), a.attr("x", t.x - (l.width + 4 * L)).attr("y", t.y + l.height - 12)) : a.attr("x", t.posWithOffset - l.width / 2), o.rotateCommitLabel))
|
|
456
|
+
if (y === "TB" || y === "BT")
|
|
457
|
+
a.attr(
|
|
458
|
+
"transform",
|
|
459
|
+
"rotate(-45, " + t.x + ", " + t.y + ")"
|
|
460
|
+
), n.attr(
|
|
461
|
+
"transform",
|
|
462
|
+
"rotate(-45, " + t.x + ", " + t.y + ")"
|
|
463
|
+
);
|
|
464
|
+
else {
|
|
465
|
+
const f = -7.5 - (l.width + 10) / 25 * 9.5, g = 10 + l.width / 25 * 8.5;
|
|
466
|
+
i.attr(
|
|
467
|
+
"transform",
|
|
468
|
+
"translate(" + f + ", " + g + ") rotate(-45, " + s + ", " + t.y + ")"
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}, "drawCommitLabel"), or = /* @__PURE__ */ h((e, r, t, s) => {
|
|
473
|
+
if (r.tags.length > 0) {
|
|
474
|
+
let o = 0, i = 0, n = 0;
|
|
475
|
+
const a = [];
|
|
476
|
+
for (const l of r.tags.reverse()) {
|
|
477
|
+
const f = e.insert("polygon"), g = e.append("circle"), $ = e.append("text").attr("y", t.y - 16 - o).attr("class", "tag-label").text(l), c = $.node()?.getBBox();
|
|
478
|
+
if (!c)
|
|
479
|
+
throw new Error("Tag bbox not found");
|
|
480
|
+
i = Math.max(i, c.width), n = Math.max(n, c.height), $.attr("x", t.posWithOffset - c.width / 2), a.push({
|
|
481
|
+
tag: $,
|
|
482
|
+
hole: g,
|
|
483
|
+
rect: f,
|
|
484
|
+
yOffset: o
|
|
485
|
+
}), o += 20;
|
|
486
|
+
}
|
|
487
|
+
for (const { tag: l, hole: f, rect: g, yOffset: $ } of a) {
|
|
488
|
+
const c = n / 2, x = t.y - 19.2 - $;
|
|
489
|
+
if (g.attr("class", "tag-label-bkg").attr(
|
|
490
|
+
"points",
|
|
491
|
+
`
|
|
492
|
+
${s - i / 2 - L / 2},${x + R}
|
|
493
|
+
${s - i / 2 - L / 2},${x - R}
|
|
494
|
+
${t.posWithOffset - i / 2 - L},${x - c - R}
|
|
495
|
+
${t.posWithOffset + i / 2 + L},${x - c - R}
|
|
496
|
+
${t.posWithOffset + i / 2 + L},${x + c + R}
|
|
497
|
+
${t.posWithOffset - i / 2 - L},${x + c + R}`
|
|
498
|
+
), f.attr("cy", x).attr("cx", s - i / 2 + L / 2).attr("r", 1.5).attr("class", "tag-hole"), y === "TB" || y === "BT") {
|
|
499
|
+
const u = s + $;
|
|
500
|
+
g.attr("class", "tag-label-bkg").attr(
|
|
501
|
+
"points",
|
|
502
|
+
`
|
|
503
|
+
${t.x},${u + 2}
|
|
504
|
+
${t.x},${u - 2}
|
|
505
|
+
${t.x + O},${u - c - 2}
|
|
506
|
+
${t.x + O + i + 4},${u - c - 2}
|
|
507
|
+
${t.x + O + i + 4},${u + c + 2}
|
|
508
|
+
${t.x + O},${u + c + 2}`
|
|
509
|
+
).attr("transform", "translate(12,12) rotate(45, " + t.x + "," + s + ")"), f.attr("cx", t.x + L / 2).attr("cy", u).attr("transform", "translate(12,12) rotate(45, " + t.x + "," + s + ")"), l.attr("x", t.x + 5).attr("y", u + 3).attr("transform", "translate(14,14) rotate(45, " + t.x + "," + s + ")");
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}, "drawCommitTags"), cr = /* @__PURE__ */ h((e) => {
|
|
514
|
+
switch (e.customType ?? e.type) {
|
|
515
|
+
case m.NORMAL:
|
|
516
|
+
return "commit-normal";
|
|
517
|
+
case m.REVERSE:
|
|
518
|
+
return "commit-reverse";
|
|
519
|
+
case m.HIGHLIGHT:
|
|
520
|
+
return "commit-highlight";
|
|
521
|
+
case m.MERGE:
|
|
522
|
+
return "commit-merge";
|
|
523
|
+
case m.CHERRY_PICK:
|
|
524
|
+
return "commit-cherry-pick";
|
|
525
|
+
default:
|
|
526
|
+
return "commit-normal";
|
|
527
|
+
}
|
|
528
|
+
}, "getCommitClassType"), ir = /* @__PURE__ */ h((e, r, t, s) => {
|
|
529
|
+
const o = { x: 0, y: 0 };
|
|
530
|
+
if (e.parents.length > 0) {
|
|
531
|
+
const i = ce(e.parents);
|
|
532
|
+
if (i) {
|
|
533
|
+
const n = s.get(i) ?? o;
|
|
534
|
+
return r === "TB" ? n.y + _ : r === "BT" ? (s.get(e.id) ?? o).y - _ : n.x + _;
|
|
535
|
+
}
|
|
536
|
+
} else
|
|
537
|
+
return r === "TB" ? F : r === "BT" ? (s.get(e.id) ?? o).y - _ : 0;
|
|
538
|
+
return 0;
|
|
539
|
+
}, "calculatePosition"), dr = /* @__PURE__ */ h((e, r, t) => {
|
|
540
|
+
const s = y === "BT" && t ? r : r + O, o = C.get(e.branch)?.pos, i = y === "TB" || y === "BT" ? C.get(e.branch)?.pos : s;
|
|
541
|
+
if (i === void 0 || o === void 0)
|
|
542
|
+
throw new Error(`Position were undefined for commit ${e.id}`);
|
|
543
|
+
const n = j.has(W().theme ?? ""), a = y === "TB" || y === "BT" ? s : o + (n ? X / 2 + 1 : -2);
|
|
544
|
+
return { x: i, y: a, posWithOffset: s };
|
|
545
|
+
}, "getCommitPosition"), re = /* @__PURE__ */ h((e, r, t, s) => {
|
|
546
|
+
const o = e.append("g").attr("class", "commit-bullets"), i = e.append("g").attr("class", "commit-labels");
|
|
547
|
+
let n = y === "TB" || y === "BT" ? F : 0;
|
|
548
|
+
const a = [...r.keys()], l = s.parallelCommits ?? !1, f = /* @__PURE__ */ h(($, c) => {
|
|
549
|
+
const x = r.get($)?.seq, u = r.get(c)?.seq;
|
|
550
|
+
return x !== void 0 && u !== void 0 ? x - u : 0;
|
|
551
|
+
}, "sortKeys");
|
|
552
|
+
let g = a.sort(f);
|
|
553
|
+
y === "BT" && (l && Ze(g, r, n), g = g.reverse()), g.forEach(($) => {
|
|
554
|
+
const c = r.get($);
|
|
555
|
+
if (!c)
|
|
556
|
+
throw new Error(`Commit not found for key ${$}`);
|
|
557
|
+
l && (n = ir(c, y, n, E));
|
|
558
|
+
const x = dr(c, n, l);
|
|
559
|
+
if (t) {
|
|
560
|
+
const u = cr(c), p = c.customType ?? c.type, b = C.get(c.branch)?.index ?? 0;
|
|
561
|
+
nr(o, c, x, u, b, p), sr(i, c, x, n, s), or(i, c, x, n);
|
|
562
|
+
}
|
|
563
|
+
y === "TB" || y === "BT" ? E.set(c.id, { x: x.x, y: x.posWithOffset }) : E.set(c.id, { x: x.posWithOffset, y: x.y }), n = y === "BT" && l ? n + _ : n + _ + O, n > I && (I = n);
|
|
564
|
+
});
|
|
565
|
+
}, "drawCommits"), lr = /* @__PURE__ */ h((e, r, t, s, o) => {
|
|
566
|
+
const n = (y === "TB" || y === "BT" ? t.x < s.x : t.y < s.y) ? r.branch : e.branch, a = /* @__PURE__ */ h((f) => f.branch === n, "isOnBranchToGetCurve"), l = /* @__PURE__ */ h((f) => f.seq > e.seq && f.seq < r.seq, "isBetweenCommits");
|
|
567
|
+
return [...o.values()].some((f) => l(f) && a(f));
|
|
568
|
+
}, "shouldRerouteArrow"), P = /* @__PURE__ */ h((e, r, t = 0) => {
|
|
569
|
+
const s = e + Math.abs(e - r) / 2;
|
|
570
|
+
if (t > 5)
|
|
571
|
+
return s;
|
|
572
|
+
if (z.every((n) => Math.abs(n - s) >= 10))
|
|
573
|
+
return z.push(s), s;
|
|
574
|
+
const i = Math.abs(e - r);
|
|
575
|
+
return P(e, r - i / 5, t + 1);
|
|
576
|
+
}, "findLane"), hr = /* @__PURE__ */ h((e, r, t, s) => {
|
|
577
|
+
const { theme: o } = W(), i = Z.has(o ?? ""), n = E.get(r.id), a = E.get(t.id);
|
|
578
|
+
if (n === void 0 || a === void 0)
|
|
579
|
+
throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);
|
|
580
|
+
const l = lr(r, t, n, a, s);
|
|
581
|
+
let f = "", g = "", $ = 0, c = 0, x = C.get(t.branch)?.index;
|
|
582
|
+
t.type === m.MERGE && r.id !== t.parents[0] && (x = C.get(r.branch)?.index);
|
|
583
|
+
let u;
|
|
584
|
+
if (l) {
|
|
585
|
+
f = "A 10 10, 0, 0, 0,", g = "A 10 10, 0, 0, 1,", $ = 10, c = 10;
|
|
586
|
+
const p = n.y < a.y ? P(n.y, a.y) : P(a.y, n.y), b = n.x < a.x ? P(n.x, a.x) : P(a.x, n.x);
|
|
587
|
+
y === "TB" ? n.x < a.x ? u = `M ${n.x} ${n.y} L ${b - $} ${n.y} ${g} ${b} ${n.y + c} L ${b} ${a.y - $} ${f} ${b + c} ${a.y} L ${a.x} ${a.y}` : (x = C.get(r.branch)?.index, u = `M ${n.x} ${n.y} L ${b + $} ${n.y} ${f} ${b} ${n.y + c} L ${b} ${a.y - $} ${g} ${b - c} ${a.y} L ${a.x} ${a.y}`) : y === "BT" ? n.x < a.x ? u = `M ${n.x} ${n.y} L ${b - $} ${n.y} ${f} ${b} ${n.y - c} L ${b} ${a.y + $} ${g} ${b + c} ${a.y} L ${a.x} ${a.y}` : (x = C.get(r.branch)?.index, u = `M ${n.x} ${n.y} L ${b + $} ${n.y} ${g} ${b} ${n.y - c} L ${b} ${a.y + $} ${f} ${b - c} ${a.y} L ${a.x} ${a.y}`) : n.y < a.y ? u = `M ${n.x} ${n.y} L ${n.x} ${p - $} ${f} ${n.x + c} ${p} L ${a.x - $} ${p} ${g} ${a.x} ${p + c} L ${a.x} ${a.y}` : (x = C.get(r.branch)?.index, u = `M ${n.x} ${n.y} L ${n.x} ${p + $} ${g} ${n.x + c} ${p} L ${a.x - $} ${p} ${f} ${a.x} ${p - c} L ${a.x} ${a.y}`);
|
|
588
|
+
} else
|
|
589
|
+
f = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", $ = 20, c = 20, y === "TB" ? (n.x < a.x && (t.type === m.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y - $} ${f} ${n.x + c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x - $} ${n.y} ${g} ${a.x} ${n.y + c} L ${a.x} ${a.y}`), n.x > a.x && (f = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", $ = 20, c = 20, t.type === m.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y - $} ${g} ${n.x - c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x + $} ${n.y} ${f} ${a.x} ${n.y + c} L ${a.x} ${a.y}`), n.x === a.x && (u = `M ${n.x} ${n.y} L ${a.x} ${a.y}`)) : y === "BT" ? (n.x < a.x && (t.type === m.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y + $} ${g} ${n.x + c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x - $} ${n.y} ${f} ${a.x} ${n.y - c} L ${a.x} ${a.y}`), n.x > a.x && (f = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", $ = 20, c = 20, t.type === m.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y + $} ${f} ${n.x - c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x + $} ${n.y} ${g} ${a.x} ${n.y - c} L ${a.x} ${a.y}`), n.x === a.x && (u = `M ${n.x} ${n.y} L ${a.x} ${a.y}`)) : (n.y < a.y && (t.type === m.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${a.x - $} ${n.y} ${g} ${a.x} ${n.y + c} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${n.x} ${a.y - $} ${f} ${n.x + c} ${a.y} L ${a.x} ${a.y}`), n.y > a.y && (t.type === m.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${a.x - $} ${n.y} ${f} ${a.x} ${n.y - c} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${n.x} ${a.y + $} ${g} ${n.x + c} ${a.y} L ${a.x} ${a.y}`), n.y === a.y && (u = `M ${n.x} ${n.y} L ${a.x} ${a.y}`));
|
|
590
|
+
if (u === void 0)
|
|
591
|
+
throw new Error("Line definition not found");
|
|
592
|
+
e.append("path").attr("d", u).attr(
|
|
593
|
+
"class",
|
|
594
|
+
"arrow arrow" + H(x, G, i)
|
|
595
|
+
);
|
|
596
|
+
}, "drawArrow"), $r = /* @__PURE__ */ h((e, r) => {
|
|
597
|
+
const t = e.append("g").attr("class", "commit-arrows");
|
|
598
|
+
[...r.keys()].forEach((s) => {
|
|
599
|
+
const o = r.get(s);
|
|
600
|
+
o.parents && o.parents.length > 0 && o.parents.forEach((i) => {
|
|
601
|
+
hr(t, r.get(i), o, r);
|
|
602
|
+
});
|
|
603
|
+
});
|
|
604
|
+
}, "drawArrows"), fr = /* @__PURE__ */ h((e, r, t, s) => {
|
|
605
|
+
const { look: o, theme: i, themeVariables: n } = W(), { dropShadow: a, THEME_COLOR_LIMIT: l } = n, f = j.has(i ?? ""), g = Z.has(i ?? ""), $ = e.append("g");
|
|
606
|
+
r.forEach((c, x) => {
|
|
607
|
+
const u = H(
|
|
608
|
+
x,
|
|
609
|
+
f ? l : G,
|
|
610
|
+
g
|
|
611
|
+
), p = C.get(c.name)?.pos;
|
|
612
|
+
if (p === void 0)
|
|
613
|
+
throw new Error(`Position not found for branch ${c.name}`);
|
|
614
|
+
const b = y === "TB" || y === "BT" ? p : f ? p + X / 2 + 1 : p - 2, k = $.append("line");
|
|
615
|
+
k.attr("x1", 0), k.attr("y1", b), k.attr("x2", I), k.attr("y2", b), k.attr("class", "branch branch" + u), y === "TB" ? (k.attr("y1", F), k.attr("x1", p), k.attr("y2", I), k.attr("x2", p)) : y === "BT" && (k.attr("y1", I), k.attr("x1", p), k.attr("y2", F), k.attr("x2", p)), z.push(b);
|
|
616
|
+
const U = c.name, D = oe(U), T = $.insert("rect"), M = $.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + u);
|
|
617
|
+
M.node().appendChild(D);
|
|
618
|
+
const v = D.getBBox(), ee = f ? 0 : 4, N = f ? 16 : 0, A = f ? X : 0;
|
|
619
|
+
o === "neo" && T.attr("data-look", "neo"), T.attr("class", "branchLabelBkg label" + u).attr(
|
|
620
|
+
"style",
|
|
621
|
+
o === "neo" ? `filter:${f ? `url(#${s}-drop-shadow)` : a}` : ""
|
|
622
|
+
).attr("rx", ee).attr("ry", ee).attr("x", -v.width - 4 - (t.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -v.height / 2 + 10).attr("width", v.width + 18 + N).attr("height", v.height + 4 + A), M.attr(
|
|
623
|
+
"transform",
|
|
624
|
+
"translate(" + (-v.width - 14 - (t.rotateCommitLabel === !0 ? 30 : 0) + N / 2) + ", " + (b - v.height / 2 - 2) + ")"
|
|
625
|
+
), y === "TB" ? (T.attr("x", p - v.width / 2 - 10).attr("y", 0), M.attr("transform", "translate(" + (p - v.width / 2 - 5) + ", 0)"), f && (T.attr("transform", `translate(${-N / 2 - 3}, ${-A - 10})`), M.attr(
|
|
626
|
+
"transform",
|
|
627
|
+
"translate(" + (p - v.width / 2 - 5) + ", " + (-A * 2 + 7) + ")"
|
|
628
|
+
))) : y === "BT" ? (T.attr("x", p - v.width / 2 - 10).attr("y", I), M.attr("transform", "translate(" + (p - v.width / 2 - 5) + ", " + I + ")"), f && (T.attr("transform", `translate(${-N / 2 - 3}, ${A + 10})`), M.attr(
|
|
629
|
+
"transform",
|
|
630
|
+
"translate(" + (p - v.width / 2 - 5) + ", " + (I + A * 2 + 4) + ")"
|
|
631
|
+
))) : T.attr("transform", "translate(-19, " + (b - 12 - A / 2) + ")");
|
|
632
|
+
});
|
|
633
|
+
}, "drawBranches"), gr = /* @__PURE__ */ h(function(e, r, t, s, o) {
|
|
634
|
+
return C.set(e, { pos: r, index: t }), r += 50 + (o ? 40 : 0) + (y === "TB" || y === "BT" ? s.width / 2 : 0), r;
|
|
635
|
+
}, "setBranchPosition"), ur = /* @__PURE__ */ h(function(e, r, t, s) {
|
|
636
|
+
Je(), w.debug("in gitgraph renderer", e + `
|
|
637
|
+
`, "id:", r, t);
|
|
638
|
+
const o = s.db;
|
|
639
|
+
if (!o.getConfig) {
|
|
640
|
+
w.error("getConfig method is not available on db");
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const i = o.getConfig(), n = i.rotateCommitLabel ?? !1;
|
|
644
|
+
q = o.getCommits();
|
|
645
|
+
const a = o.getBranchesAsObjArray();
|
|
646
|
+
y = o.getDirection();
|
|
647
|
+
const l = me(`[id="${r}"]`), { look: f, theme: g, themeVariables: $ } = W(), { useGradient: c, gradientStart: x, gradientStop: u, filterColor: p } = $;
|
|
648
|
+
if (c) {
|
|
649
|
+
const k = l.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
|
|
650
|
+
k.append("stop").attr("offset", "0%").attr("stop-color", x).attr("stop-opacity", 1), k.append("stop").attr("offset", "100%").attr("stop-color", u).attr("stop-opacity", 1);
|
|
651
|
+
}
|
|
652
|
+
f === "neo" && j.has(g ?? "") && l.append("defs").append("filter").attr("id", r + "-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", p);
|
|
653
|
+
let b = 0;
|
|
654
|
+
a.forEach((k, U) => {
|
|
655
|
+
const D = oe(k.name), T = l.append("g"), K = T.insert("g").attr("class", "branchLabel"), M = K.insert("g").attr("class", "label branch-label");
|
|
656
|
+
M.node()?.appendChild(D);
|
|
657
|
+
const v = D.getBBox();
|
|
658
|
+
b = gr(k.name, b, U, v, n), M.remove(), K.remove(), T.remove();
|
|
659
|
+
}), re(l, q, !1, i), i.showBranches && fr(l, a, i, r), $r(l, q), re(l, q, !0, i), pe.insertTitle(
|
|
660
|
+
l,
|
|
661
|
+
"gitTitleText",
|
|
662
|
+
i.titleTopMargin ?? 0,
|
|
663
|
+
o.getDiagramTitle()
|
|
664
|
+
), be(void 0, l, i.diagramPadding, i.useMaxWidth);
|
|
665
|
+
}, "draw"), yr = {
|
|
666
|
+
draw: ur
|
|
667
|
+
}, ie = 8, de = /* @__PURE__ */ new Set(["redux", "redux-dark", "redux-color", "redux-dark-color"]), xr = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), mr = /* @__PURE__ */ new Set(["neo", "neo-dark"]), pr = /* @__PURE__ */ new Set(["dark", "redux-dark", "redux-dark-color", "neo-dark"]), br = /* @__PURE__ */ new Set([
|
|
668
|
+
"redux",
|
|
669
|
+
"redux-dark",
|
|
670
|
+
"redux-color",
|
|
671
|
+
"redux-dark-color",
|
|
672
|
+
"neo",
|
|
673
|
+
"neo-dark"
|
|
674
|
+
]), wr = /* @__PURE__ */ h((e) => {
|
|
675
|
+
const { svgId: r } = e;
|
|
676
|
+
let t = "";
|
|
677
|
+
if (e.useGradient && r)
|
|
678
|
+
for (let s = 0; s < e.THEME_COLOR_LIMIT; s++)
|
|
679
|
+
t += `
|
|
680
|
+
.label${s} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
|
|
681
|
+
`;
|
|
682
|
+
return t;
|
|
683
|
+
}, "genGitGraphGradient"), kr = /* @__PURE__ */ h((e) => {
|
|
684
|
+
const r = J(), { theme: t, themeVariables: s } = r, { borderColorArray: o } = s, i = de.has(t);
|
|
685
|
+
if (mr.has(t)) {
|
|
686
|
+
let n = "";
|
|
687
|
+
for (let a = 0; a < e.THEME_COLOR_LIMIT; a++)
|
|
688
|
+
if (a === 0)
|
|
689
|
+
n += `
|
|
690
|
+
.branch-label${a} { fill: ${e.nodeBorder};}
|
|
691
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
692
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
693
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
694
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
695
|
+
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
|
|
696
|
+
${wr(e)}`;
|
|
697
|
+
else {
|
|
698
|
+
const l = a % ie;
|
|
699
|
+
n += `
|
|
700
|
+
.branch-label${a} { fill: ${e["gitBranchLabel" + l]}; }
|
|
701
|
+
.commit${a} { stroke: ${e["git" + l]}; fill: ${e["git" + l]}; }
|
|
702
|
+
.commit-highlight${a} { stroke: ${e["gitInv" + l]}; fill: ${e["gitInv" + l]}; }
|
|
703
|
+
.arrow${a} { stroke: ${e["git" + l]}; }
|
|
704
|
+
`;
|
|
705
|
+
}
|
|
706
|
+
return n;
|
|
707
|
+
} else if (xr.has(t)) {
|
|
708
|
+
let n = "";
|
|
709
|
+
for (let a = 0; a < e.THEME_COLOR_LIMIT; a++)
|
|
710
|
+
if (a === 0)
|
|
711
|
+
n += `
|
|
712
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
713
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
714
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
|
|
715
|
+
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
716
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
717
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
718
|
+
`;
|
|
719
|
+
else {
|
|
720
|
+
const l = a % o.length;
|
|
721
|
+
n += `
|
|
722
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
723
|
+
.commit${a} { stroke: ${o[l]}; fill: ${o[l]}; }
|
|
724
|
+
.commit-highlight${a} { stroke: ${o[l]}; fill: ${o[l]}; }
|
|
725
|
+
.label${a} { fill: ${pr.has(t) ? e.mainBkg : o[l]}; stroke: ${o[l]}; stroke-width: ${e.strokeWidth}; }
|
|
726
|
+
.arrow${a} { stroke: ${o[l]}; }
|
|
727
|
+
`;
|
|
728
|
+
}
|
|
729
|
+
return n;
|
|
730
|
+
} else {
|
|
731
|
+
let n = "";
|
|
732
|
+
for (let a = 0; a < e.THEME_COLOR_LIMIT; a++)
|
|
733
|
+
n += `
|
|
734
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
735
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
736
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
737
|
+
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""}}
|
|
738
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
739
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
740
|
+
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
|
|
741
|
+
`;
|
|
742
|
+
return n;
|
|
743
|
+
}
|
|
744
|
+
}, "genColor"), vr = /* @__PURE__ */ h((e) => `${Array.from({ length: e.THEME_COLOR_LIMIT }, (r, t) => t).map((r) => {
|
|
745
|
+
const t = r % ie;
|
|
746
|
+
return `
|
|
747
|
+
.branch-label${r} { fill: ${e["gitBranchLabel" + t]}; }
|
|
748
|
+
.commit${r} { stroke: ${e["git" + t]}; fill: ${e["git" + t]}; }
|
|
749
|
+
.commit-highlight${r} { stroke: ${e["gitInv" + t]}; fill: ${e["gitInv" + t]}; }
|
|
750
|
+
.label${r} { fill: ${e["git" + t]}; }
|
|
751
|
+
.arrow${r} { stroke: ${e["git" + t]}; }
|
|
752
|
+
`;
|
|
753
|
+
}).join(`
|
|
754
|
+
`)}`, "normalTheme"), Cr = /* @__PURE__ */ h((e) => {
|
|
755
|
+
const r = J(), { theme: t } = r, s = br.has(t);
|
|
756
|
+
return `
|
|
757
|
+
.commit-id,
|
|
758
|
+
.commit-msg,
|
|
759
|
+
.branch-label {
|
|
760
|
+
fill: lightgrey;
|
|
761
|
+
color: lightgrey;
|
|
762
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
763
|
+
font-family: var(--mermaid-font-family);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
${s ? kr(e) : vr(e)}
|
|
767
|
+
|
|
768
|
+
.branch {
|
|
769
|
+
stroke-width: ${e.strokeWidth};
|
|
770
|
+
stroke: ${e.commitLineColor ?? e.lineColor};
|
|
771
|
+
stroke-dasharray: ${s ? "4 2" : "2"};
|
|
772
|
+
}
|
|
773
|
+
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s ? e.nodeBorder : e.commitLabelColor}; ${s ? `font-weight:${e.noteFontWeight};` : ""}}
|
|
774
|
+
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s ? "transparent" : e.commitLabelBackground}; opacity: ${s ? "" : 0.5}; }
|
|
775
|
+
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
|
776
|
+
.tag-label-bkg { fill: ${s ? e.mainBkg : e.tagLabelBackground}; stroke: ${s ? e.nodeBorder : e.tagLabelBorder}; ${s ? `filter:${e.dropShadow}` : ""} }
|
|
777
|
+
.tag-hole { fill: ${e.textColor}; }
|
|
778
|
+
|
|
779
|
+
.commit-merge {
|
|
780
|
+
stroke: ${s ? e.mainBkg : e.primaryColor};
|
|
781
|
+
fill: ${s ? e.mainBkg : e.primaryColor};
|
|
782
|
+
}
|
|
783
|
+
.commit-reverse {
|
|
784
|
+
stroke: ${s ? e.mainBkg : e.primaryColor};
|
|
785
|
+
fill: ${s ? e.mainBkg : e.primaryColor};
|
|
786
|
+
stroke-width: ${s ? e.strokeWidth : 3};
|
|
787
|
+
}
|
|
788
|
+
.commit-highlight-outer {
|
|
789
|
+
}
|
|
790
|
+
.commit-highlight-inner {
|
|
791
|
+
stroke: ${s ? e.mainBkg : e.primaryColor};
|
|
792
|
+
fill: ${s ? e.mainBkg : e.primaryColor};
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
.arrow {
|
|
796
|
+
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
|
|
797
|
+
stroke-width: ${de.has(t) ? e.strokeWidth : 8};
|
|
798
|
+
stroke-linecap: round;
|
|
799
|
+
fill: none
|
|
800
|
+
}
|
|
801
|
+
.gitTitleText {
|
|
802
|
+
text-anchor: middle;
|
|
803
|
+
font-size: 18px;
|
|
804
|
+
fill: ${e.textColor};
|
|
805
|
+
}
|
|
806
|
+
`;
|
|
807
|
+
}, "getStyles"), Er = Cr, Rr = {
|
|
808
|
+
parser: Ve,
|
|
809
|
+
db: se,
|
|
810
|
+
renderer: yr,
|
|
811
|
+
styles: Er
|
|
812
|
+
};
|
|
813
|
+
export {
|
|
814
|
+
Rr as diagram
|
|
815
|
+
};
|