@smarter.sh/ui-chat 0.8.0 → 0.9.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/README.md +328 -107
- package/dist/embed/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/embed/mermaid/abnfDiagram-VCTEODGH-CGtrctwA.js +89 -0
- package/dist/embed/mermaid/arc-DlzgcAgU.js +82 -0
- package/dist/embed/mermaid/architecture-7GRP2DOG-D66ObL4C.js +3 -0
- package/dist/embed/mermaid/architectureDiagram-5GKGNRK7-CgMNWdVn.js +4148 -0
- package/dist/embed/mermaid/array-CApNbSU9.js +6 -0
- package/dist/embed/mermaid/blockDiagram-I7D4REHJ-Q2YOF2Nl.js +1922 -0
- package/dist/embed/mermaid/c4Diagram-7LVT6UL2-DI7_cX7n.js +3010 -0
- package/dist/embed/mermaid/channel-CxRe6Ync.js +5 -0
- package/dist/embed/mermaid/chunk-2E4U76K2-DPc-jkQd.js +348 -0
- package/dist/embed/mermaid/chunk-2Q5K7J3B-C1pX24ft.js +15 -0
- package/dist/embed/mermaid/chunk-4HAMMTFA-DY_JmJA2.js +4188 -0
- package/dist/embed/mermaid/chunk-5VM5RSS4-BFskf6Qk.js +5 -0
- package/dist/embed/mermaid/chunk-75Z2AOVW-BugNeXEB.js +1330 -0
- package/dist/embed/mermaid/chunk-CLGD4ZFX-BOKCMNQY.js +14 -0
- package/dist/embed/mermaid/chunk-DU6HZSFF-C09wkxIu.js +3897 -0
- package/dist/embed/mermaid/chunk-F27PBJKO-C69L38at.js +61 -0
- package/dist/embed/mermaid/chunk-FOHPRMQF-CLLDWcGe.js +21458 -0
- package/dist/embed/mermaid/chunk-GMAD6QVW-NxqJJwNT.js +1863 -0
- package/dist/embed/mermaid/chunk-GVQU2GXP-D4WoQcNg.js +37 -0
- package/dist/embed/mermaid/chunk-IMKFNOWR-DE94S7XC.js +2042 -0
- package/dist/embed/mermaid/chunk-JWPE2WC7-BGVSGRTC.js +8 -0
- package/dist/embed/mermaid/chunk-L3NEJ4N5-CqdtyK-9.js +245 -0
- package/dist/embed/mermaid/chunk-LNGE3PJU-DqC_0r8u.js +1521 -0
- package/dist/embed/mermaid/chunk-OSK3NFVY-B1KjtHOy.js +672 -0
- package/dist/embed/mermaid/chunk-P2QGCYS3-CP_jp-eQ.js +67 -0
- package/dist/embed/mermaid/chunk-POPQ4Y6H-CSwFrYKY.js +26 -0
- package/dist/embed/mermaid/chunk-PWAF6VOD-qhXJD1mO.js +275 -0
- package/dist/embed/mermaid/chunk-SHT3W25Y-a5ik03bR.js +4183 -0
- package/dist/embed/mermaid/chunk-SVP7TREG-67QXjHHx.js +490 -0
- package/dist/embed/mermaid/chunk-TICWLB2K-DHg0COuy.js +3357 -0
- package/dist/embed/mermaid/chunk-TLUHSLCS-BwEhuf5d.js +59 -0
- package/dist/embed/mermaid/chunk-XXDRQBXY-BJjzBm4h.js +9 -0
- package/dist/embed/mermaid/chunk-Y2CYZVJY-BAad7w_K.js +12 -0
- package/dist/embed/mermaid/classDiagram-ZZMXUADV-BlIPVBOk.js +30 -0
- package/dist/embed/mermaid/classDiagram-v2-VYDZK3BY-BavoJkSK.js +30 -0
- package/dist/embed/mermaid/cose-bilkent-JH36ORCC-Cx3-7Rca.js +2248 -0
- package/dist/embed/mermaid/cynefin-OW5HDTMX-Cfa1-YuM.js +3 -0
- package/dist/embed/mermaid/cynefinDiagram-5FMLGOSQ-CsV1I6A_.js +355 -0
- package/dist/embed/mermaid/cytoscape.esm-CLcfvFJ6.js +18145 -0
- package/dist/embed/mermaid/dagre-COnXXJRS.js +1934 -0
- package/dist/embed/mermaid/dagre-GXQ25YYZ-BzZWpDkI.js +425 -0
- package/dist/embed/mermaid/defaultLocale-CQ4Nl88y.js +198 -0
- package/dist/embed/mermaid/diagram-S7CK7UJ4-CShsH_ul.js +301 -0
- package/dist/embed/mermaid/diagram-UQ7AKVKN-Bb0mFpt2.js +214 -0
- package/dist/embed/mermaid/diagram-VSXAHHWV-DUq5PKM1.js +432 -0
- package/dist/embed/mermaid/diagram-VX7I27RA-Co2uyrw2.js +527 -0
- package/dist/embed/mermaid/diagram-Z3DM3KII-CTdPPkZs.js +134 -0
- package/dist/embed/mermaid/dist-CjR2JtV-.js +59 -0
- package/dist/embed/mermaid/ebnfDiagram-PWID7BFC-CAQNT7Vt.js +100 -0
- package/dist/embed/mermaid/erDiagram-RLTQ6QDP-DluYOFtk.js +1966 -0
- package/dist/embed/mermaid/eventmodeling-NTZA5JFV-DFSPvGS4.js +3 -0
- package/dist/embed/mermaid/flowDiagram-HODETNUW-BKXSV8xL.js +17 -0
- package/dist/embed/mermaid/ganttDiagram-EL5Y4UJY-D2BBzcpY.js +3072 -0
- package/dist/embed/mermaid/gitGraph-4MIJSDKK-BTHPY7Tg.js +3 -0
- package/dist/embed/mermaid/gitGraphDiagram-WWUBYQGX-BzZ3sE3s.js +733 -0
- package/dist/embed/mermaid/graphlib-D8JS7ydf.js +1267 -0
- package/dist/embed/mermaid/info-A6RAGUB7-4Mm0OyB8.js +3 -0
- package/dist/embed/mermaid/infoDiagram-27XIBGKW-DcbKIVvy.js +20 -0
- package/dist/embed/mermaid/init-CFNf60QB.js +13 -0
- package/dist/embed/mermaid/ishikawaDiagram-5VMMS53U-B6q3rvke.js +719 -0
- package/dist/embed/mermaid/journeyDiagram-3NMN7TZE-CDDY2Xma.js +884 -0
- package/dist/embed/mermaid/kanban-definition-UXKFOSKX-w7v22sq3.js +976 -0
- package/dist/embed/mermaid/katex-BqirFtOb.js +21977 -0
- package/dist/embed/mermaid/line-DoUHpRzu.js +34 -0
- package/dist/embed/mermaid/linear-CLS335Sc.js +287 -0
- package/dist/embed/mermaid/mermaid-parser.core-BoI6HFCg.js +638 -0
- package/dist/embed/mermaid/mermaid.js +1092 -0
- package/dist/embed/mermaid/mindmap-definition-YA3MSWOX-1bs_tKMD.js +1006 -0
- package/dist/embed/mermaid/ordinal-Da0rnhxr.js +65 -0
- package/dist/embed/mermaid/packet-AYTQ26CC-BAodtDR3.js +3 -0
- package/dist/embed/mermaid/path-hN9ktzbr.js +84 -0
- package/dist/embed/mermaid/pegDiagram-XKGWAZYB-DsrQs7Qo.js +94 -0
- package/dist/embed/mermaid/pie-WAS4IAKB-Yw-9-2EN.js +3 -0
- package/dist/embed/mermaid/pieDiagram-E7YTZNPT-BvkRs6Xl.js +203 -0
- package/dist/embed/mermaid/quadrantDiagram-AXDQQJYC-DDSDkbcq.js +2001 -0
- package/dist/embed/mermaid/radar-RG4KPBEZ-BtjjaEPe.js +3 -0
- package/dist/embed/mermaid/railroad-74A4TZTK-Du7TjeaO.js +3 -0
- package/dist/embed/mermaid/railroad-abnf-HS5TGJTU-D3flpty6.js +3 -0
- package/dist/embed/mermaid/railroad-ebnf-LZEXJU2U-DWpeYHWC.js +3 -0
- package/dist/embed/mermaid/railroad-peg-WCYAUIDC-DKiyz9fh.js +3 -0
- package/dist/embed/mermaid/railroadDiagram-O6MQD6OU-T__Cw3ez.js +76 -0
- package/dist/embed/mermaid/requirementDiagram-BXWQKSXE-ADir8pgL.js +2224 -0
- package/dist/embed/mermaid/rough.esm-XhrPyaQA.js +1361 -0
- package/dist/embed/mermaid/sankeyDiagram-P5KCCOFB-YTgoqhmd.js +972 -0
- package/dist/embed/mermaid/sequenceDiagram-WJ2MYXX4-Dpn6ph0n.js +4156 -0
- package/dist/embed/mermaid/sizeCapture-INFHLROL-C2wlw8KF.js +46 -0
- package/dist/embed/mermaid/src-CH4XuqUv.js +2147 -0
- package/dist/embed/mermaid/stateDiagram-D77RDMKH-V_8TbftV.js +220 -0
- package/dist/embed/mermaid/stateDiagram-v2-MP3YSRHH-us7SNDcU.js +30 -0
- package/dist/embed/mermaid/swimlanes-42K2YHIH-wzihXC1V.js +4979 -0
- package/dist/embed/mermaid/swimlanesDiagram-VR7AAH4N-BML-4Vp0.js +31 -0
- package/dist/embed/mermaid/timeline-definition-24CTP7MA-C3BzP6RA.js +1069 -0
- package/dist/embed/mermaid/treeView-Q6P3EWNA-Ba1dLcIR.js +3 -0
- package/dist/embed/mermaid/treemap-WGGIJYW6-D9G3ZsOW.js +3 -0
- package/dist/embed/mermaid/vennDiagram-4TSXK5OY-Cq1JumSe.js +1880 -0
- package/dist/embed/mermaid/wardley-WFR3VGLG-gAtip5-G.js +3 -0
- package/dist/embed/mermaid/wardleyDiagram-VM6X3IG4-HtzestuU.js +645 -0
- package/dist/embed/mermaid/xychartDiagram-S5SC5T6Z-BE-W0B_D.js +2210 -0
- package/dist/embed.js +903 -0
- package/dist/embed.js.map +1 -0
- package/dist/smarter-chat-library.es.js +1592 -1583
- package/dist/smarter-chat-library.es.js.map +1 -1
- package/dist/smarter-chat-library.umd.js +43 -43
- package/dist/smarter-chat-library.umd.js.map +1 -1
- package/dist/types/src/components/SmarterChat/Component.d.ts +1 -1
- package/dist/types/src/contract.gen.d.ts +41 -26
- package/dist/types/src/embed/EmbedApp.d.ts +10 -0
- package/dist/types/src/embed/assets.d.ts +7 -0
- package/dist/types/src/embed/autoMount.d.ts +18 -0
- package/dist/types/src/embed/css.d.ts +15 -0
- package/dist/types/src/embed/element.d.ts +19 -0
- package/dist/types/src/embed/index.d.ts +17 -0
- package/dist/types/src/embed/mermaid.d.ts +2 -0
- package/dist/types/src/embed/mermaidImport.d.ts +1 -0
- package/dist/types/src/embed/options.d.ts +69 -0
- package/dist/types/src/lib/cookie.d.ts +4 -3
- package/dist/types/src/lib/mermaidImport.d.ts +8 -0
- package/dist/types/src/types.d.ts +7 -0
- package/dist/ui-chat.css +1 -1
- package/package.json +10 -4
|
@@ -0,0 +1,733 @@
|
|
|
1
|
+
import { m as e, p as t } from "./src-CH4XuqUv.js";
|
|
2
|
+
import { n } from "./chunk-Y2CYZVJY-BAad7w_K.js";
|
|
3
|
+
import { H as r, K as i, U as a, Y as o, a as s, b as c, f as l, s as u, v as d, w as f, x as p, y as m } from "./chunk-DU6HZSFF-C09wkxIu.js";
|
|
4
|
+
import { g as h, i as g, m as _ } from "./chunk-75Z2AOVW-BugNeXEB.js";
|
|
5
|
+
import { n as v } from "./mermaid-parser.core-BoI6HFCg.js";
|
|
6
|
+
import { t as y } from "./chunk-JWPE2WC7-BGVSGRTC.js";
|
|
7
|
+
import { t as b } from "./chunk-2Q5K7J3B-C1pX24ft.js";
|
|
8
|
+
//#region ../../node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-WWUBYQGX.mjs
|
|
9
|
+
var x = {
|
|
10
|
+
NORMAL: 0,
|
|
11
|
+
REVERSE: 1,
|
|
12
|
+
HIGHLIGHT: 2,
|
|
13
|
+
MERGE: 3,
|
|
14
|
+
CHERRY_PICK: 4
|
|
15
|
+
}, ee = l.gitGraph, S = /* @__PURE__ */ n(() => g({
|
|
16
|
+
...ee,
|
|
17
|
+
...c().gitGraph
|
|
18
|
+
}), "getConfig"), C = new b(() => {
|
|
19
|
+
let e = S(), t = e.mainBranchName, n = e.mainBranchOrder;
|
|
20
|
+
return {
|
|
21
|
+
mainBranchName: t,
|
|
22
|
+
commits: /* @__PURE__ */ new Map(),
|
|
23
|
+
head: null,
|
|
24
|
+
branchConfig: /* @__PURE__ */ new Map([[t, {
|
|
25
|
+
name: t,
|
|
26
|
+
order: n
|
|
27
|
+
}]]),
|
|
28
|
+
branches: /* @__PURE__ */ new Map([[t, null]]),
|
|
29
|
+
currBranch: t,
|
|
30
|
+
direction: "LR",
|
|
31
|
+
seq: 0,
|
|
32
|
+
options: {}
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
function w() {
|
|
36
|
+
return _({ length: 7 });
|
|
37
|
+
}
|
|
38
|
+
n(w, "getID");
|
|
39
|
+
function T(e, t) {
|
|
40
|
+
let n = /* @__PURE__ */ Object.create(null);
|
|
41
|
+
return e.reduce((e, r) => {
|
|
42
|
+
let i = t(r);
|
|
43
|
+
return n[i] || (n[i] = !0, e.push(r)), e;
|
|
44
|
+
}, []);
|
|
45
|
+
}
|
|
46
|
+
n(T, "uniqBy");
|
|
47
|
+
var te = /* @__PURE__ */ n(function(e) {
|
|
48
|
+
C.records.direction = e;
|
|
49
|
+
}, "setDirection"), ne = /* @__PURE__ */ n(function(t) {
|
|
50
|
+
e.debug("options str", t), t = t?.trim(), t ||= "{}";
|
|
51
|
+
try {
|
|
52
|
+
C.records.options = JSON.parse(t);
|
|
53
|
+
} catch (t) {
|
|
54
|
+
e.error("error while parsing gitGraph options", t.message);
|
|
55
|
+
}
|
|
56
|
+
}, "setOptions"), re = /* @__PURE__ */ n(function() {
|
|
57
|
+
return C.records.options;
|
|
58
|
+
}, "getOptions"), ie = /* @__PURE__ */ n(function(t) {
|
|
59
|
+
let n = t.msg, r = t.id, i = t.type, a = t.tags;
|
|
60
|
+
e.info("commit", n, r, i, a), e.debug("Entering commit:", n, r, i, a);
|
|
61
|
+
let o = S();
|
|
62
|
+
r = u.sanitizeText(r, o), n = u.sanitizeText(n, o), a = a?.map((e) => u.sanitizeText(e, o));
|
|
63
|
+
let s = {
|
|
64
|
+
id: r || C.records.seq + "-" + w(),
|
|
65
|
+
message: n,
|
|
66
|
+
seq: C.records.seq++,
|
|
67
|
+
type: i ?? x.NORMAL,
|
|
68
|
+
tags: a ?? [],
|
|
69
|
+
parents: C.records.head == null ? [] : [C.records.head.id],
|
|
70
|
+
branch: C.records.currBranch
|
|
71
|
+
};
|
|
72
|
+
C.records.head = s, e.info("main branch", o.mainBranchName), C.records.commits.has(s.id) && e.warn(`Commit ID ${s.id} already exists`), C.records.commits.set(s.id, s), C.records.branches.set(C.records.currBranch, s.id), e.debug("in pushCommit " + s.id);
|
|
73
|
+
}, "commit"), ae = /* @__PURE__ */ n(function(t) {
|
|
74
|
+
let n = t.name, r = t.order;
|
|
75
|
+
if (n = u.sanitizeText(n, S()), C.records.branches.has(n)) throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${n}")`);
|
|
76
|
+
C.records.branches.set(n, C.records.head == null ? null : C.records.head.id), C.records.branchConfig.set(n, {
|
|
77
|
+
name: n,
|
|
78
|
+
order: r
|
|
79
|
+
}), E(n), e.debug("in createBranch");
|
|
80
|
+
}, "branch"), oe = /* @__PURE__ */ n((t) => {
|
|
81
|
+
let n = t.branch, r = t.id, i = t.type, a = t.tags, o = S();
|
|
82
|
+
n = u.sanitizeText(n, o), r &&= u.sanitizeText(r, o);
|
|
83
|
+
let s = C.records.branches.get(C.records.currBranch), c = C.records.branches.get(n), l = s ? C.records.commits.get(s) : void 0, d = c ? C.records.commits.get(c) : void 0;
|
|
84
|
+
if (l && d && l.branch === n) throw Error(`Cannot merge branch '${n}' into itself.`);
|
|
85
|
+
if (C.records.currBranch === n) {
|
|
86
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Cannot merge a branch to itself");
|
|
87
|
+
throw e.hash = {
|
|
88
|
+
text: `merge ${n}`,
|
|
89
|
+
token: `merge ${n}`,
|
|
90
|
+
expected: ["branch abc"]
|
|
91
|
+
}, e;
|
|
92
|
+
}
|
|
93
|
+
if (l === void 0 || !l) {
|
|
94
|
+
let e = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);
|
|
95
|
+
throw e.hash = {
|
|
96
|
+
text: `merge ${n}`,
|
|
97
|
+
token: `merge ${n}`,
|
|
98
|
+
expected: ["commit"]
|
|
99
|
+
}, e;
|
|
100
|
+
}
|
|
101
|
+
if (!C.records.branches.has(n)) {
|
|
102
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") does not exist");
|
|
103
|
+
throw e.hash = {
|
|
104
|
+
text: `merge ${n}`,
|
|
105
|
+
token: `merge ${n}`,
|
|
106
|
+
expected: [`branch ${n}`]
|
|
107
|
+
}, e;
|
|
108
|
+
}
|
|
109
|
+
if (d === void 0 || !d) {
|
|
110
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") has no commits");
|
|
111
|
+
throw e.hash = {
|
|
112
|
+
text: `merge ${n}`,
|
|
113
|
+
token: `merge ${n}`,
|
|
114
|
+
expected: ["\"commit\""]
|
|
115
|
+
}, e;
|
|
116
|
+
}
|
|
117
|
+
if (l === d) {
|
|
118
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Both branches have same head");
|
|
119
|
+
throw e.hash = {
|
|
120
|
+
text: `merge ${n}`,
|
|
121
|
+
token: `merge ${n}`,
|
|
122
|
+
expected: ["branch abc"]
|
|
123
|
+
}, e;
|
|
124
|
+
}
|
|
125
|
+
if (r && C.records.commits.has(r)) {
|
|
126
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" + r + " already exists, use different custom id");
|
|
127
|
+
throw e.hash = {
|
|
128
|
+
text: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
|
|
129
|
+
token: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
|
|
130
|
+
expected: [`merge ${n} ${r}_UNIQUE ${i} ${a?.join(" ")}`]
|
|
131
|
+
}, e;
|
|
132
|
+
}
|
|
133
|
+
let f = c || "", p = {
|
|
134
|
+
id: r || `${C.records.seq}-${w()}`,
|
|
135
|
+
message: `merged branch ${n} into ${C.records.currBranch}`,
|
|
136
|
+
seq: C.records.seq++,
|
|
137
|
+
parents: C.records.head == null ? [] : [C.records.head.id, f],
|
|
138
|
+
branch: C.records.currBranch,
|
|
139
|
+
type: x.MERGE,
|
|
140
|
+
customType: i,
|
|
141
|
+
customId: !!r,
|
|
142
|
+
tags: a ?? []
|
|
143
|
+
};
|
|
144
|
+
C.records.head = p, C.records.commits.set(p.id, p), C.records.branches.set(C.records.currBranch, p.id), e.debug(C.records.branches), e.debug("in mergeBranch");
|
|
145
|
+
}, "merge"), se = /* @__PURE__ */ n(function(t) {
|
|
146
|
+
let n = t.id, r = t.targetId, i = t.tags, a = t.parent;
|
|
147
|
+
e.debug("Entering cherryPick:", n, r, i);
|
|
148
|
+
let o = S();
|
|
149
|
+
if (n = u.sanitizeText(n, o), r = u.sanitizeText(r, o), i = i?.map((e) => u.sanitizeText(e, o)), a = u.sanitizeText(a, o), !n || !C.records.commits.has(n)) {
|
|
150
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
151
|
+
throw e.hash = {
|
|
152
|
+
text: `cherryPick ${n} ${r}`,
|
|
153
|
+
token: `cherryPick ${n} ${r}`,
|
|
154
|
+
expected: ["cherry-pick abc"]
|
|
155
|
+
}, e;
|
|
156
|
+
}
|
|
157
|
+
let s = C.records.commits.get(n);
|
|
158
|
+
if (s === void 0 || !s) throw Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
159
|
+
if (a && !(Array.isArray(s.parents) && s.parents.includes(a))) throw /* @__PURE__ */ Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");
|
|
160
|
+
let c = s.branch;
|
|
161
|
+
if (s.type === x.MERGE && !a) throw /* @__PURE__ */ Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");
|
|
162
|
+
if (!r || !C.records.commits.has(r)) {
|
|
163
|
+
if (c === C.records.currBranch) {
|
|
164
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit is already on current branch");
|
|
165
|
+
throw e.hash = {
|
|
166
|
+
text: `cherryPick ${n} ${r}`,
|
|
167
|
+
token: `cherryPick ${n} ${r}`,
|
|
168
|
+
expected: ["cherry-pick abc"]
|
|
169
|
+
}, e;
|
|
170
|
+
}
|
|
171
|
+
let t = C.records.branches.get(C.records.currBranch);
|
|
172
|
+
if (t === void 0 || !t) {
|
|
173
|
+
let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);
|
|
174
|
+
throw e.hash = {
|
|
175
|
+
text: `cherryPick ${n} ${r}`,
|
|
176
|
+
token: `cherryPick ${n} ${r}`,
|
|
177
|
+
expected: ["cherry-pick abc"]
|
|
178
|
+
}, e;
|
|
179
|
+
}
|
|
180
|
+
let o = C.records.commits.get(t);
|
|
181
|
+
if (o === void 0 || !o) {
|
|
182
|
+
let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);
|
|
183
|
+
throw e.hash = {
|
|
184
|
+
text: `cherryPick ${n} ${r}`,
|
|
185
|
+
token: `cherryPick ${n} ${r}`,
|
|
186
|
+
expected: ["cherry-pick abc"]
|
|
187
|
+
}, e;
|
|
188
|
+
}
|
|
189
|
+
let l = {
|
|
190
|
+
id: C.records.seq + "-" + w(),
|
|
191
|
+
message: `cherry-picked ${s?.message} into ${C.records.currBranch}`,
|
|
192
|
+
seq: C.records.seq++,
|
|
193
|
+
parents: C.records.head == null ? [] : [C.records.head.id, s.id],
|
|
194
|
+
branch: C.records.currBranch,
|
|
195
|
+
type: x.CHERRY_PICK,
|
|
196
|
+
tags: i ? i.filter(Boolean) : [`cherry-pick:${s.id}${s.type === x.MERGE ? `|parent:${a}` : ""}`]
|
|
197
|
+
};
|
|
198
|
+
C.records.head = l, C.records.commits.set(l.id, l), C.records.branches.set(C.records.currBranch, l.id), e.debug(C.records.branches), e.debug("in cherryPick");
|
|
199
|
+
}
|
|
200
|
+
}, "cherryPick"), E = /* @__PURE__ */ n(function(e) {
|
|
201
|
+
if (e = u.sanitizeText(e, S()), C.records.branches.has(e)) {
|
|
202
|
+
C.records.currBranch = e;
|
|
203
|
+
let t = C.records.branches.get(C.records.currBranch);
|
|
204
|
+
t === void 0 || !t ? C.records.head = null : C.records.head = C.records.commits.get(t) ?? null;
|
|
205
|
+
} else {
|
|
206
|
+
let t = /* @__PURE__ */ Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);
|
|
207
|
+
throw t.hash = {
|
|
208
|
+
text: `checkout ${e}`,
|
|
209
|
+
token: `checkout ${e}`,
|
|
210
|
+
expected: [`branch ${e}`]
|
|
211
|
+
}, t;
|
|
212
|
+
}
|
|
213
|
+
}, "checkout");
|
|
214
|
+
function D(e, t, n) {
|
|
215
|
+
let r = e.indexOf(t);
|
|
216
|
+
r === -1 ? e.push(n) : e.splice(r, 1, n);
|
|
217
|
+
}
|
|
218
|
+
n(D, "upsert");
|
|
219
|
+
function O(t) {
|
|
220
|
+
let n = t.reduce((e, t) => e.seq > t.seq ? e : t, t[0]), r = "";
|
|
221
|
+
t.forEach(function(e) {
|
|
222
|
+
r += e === n ? " *" : " |";
|
|
223
|
+
});
|
|
224
|
+
let i = [
|
|
225
|
+
r,
|
|
226
|
+
n.id,
|
|
227
|
+
n.seq
|
|
228
|
+
];
|
|
229
|
+
for (let e in C.records.branches) C.records.branches.get(e) === n.id && i.push(e);
|
|
230
|
+
if (e.debug(i.join(" ")), n.parents && n.parents.length == 2 && n.parents[0] && n.parents[1]) {
|
|
231
|
+
let e = C.records.commits.get(n.parents[0]);
|
|
232
|
+
D(t, n, e), n.parents[1] && t.push(C.records.commits.get(n.parents[1]));
|
|
233
|
+
} else if (n.parents.length == 0) return;
|
|
234
|
+
else if (n.parents[0]) {
|
|
235
|
+
let e = C.records.commits.get(n.parents[0]);
|
|
236
|
+
D(t, n, e);
|
|
237
|
+
}
|
|
238
|
+
t = T(t, (e) => e.id), O(t);
|
|
239
|
+
}
|
|
240
|
+
n(O, "prettyPrintCommitHistory");
|
|
241
|
+
var ce = /* @__PURE__ */ n(function() {
|
|
242
|
+
e.debug(C.records.commits);
|
|
243
|
+
let t = k()[0];
|
|
244
|
+
O([t]);
|
|
245
|
+
}, "prettyPrint"), le = /* @__PURE__ */ n(function() {
|
|
246
|
+
C.reset(), s();
|
|
247
|
+
}, "clear"), ue = /* @__PURE__ */ n(function() {
|
|
248
|
+
return [...C.records.branchConfig.values()].map((e, t) => e.order !== null && e.order !== void 0 ? e : {
|
|
249
|
+
...e,
|
|
250
|
+
order: parseFloat(`0.${t}`)
|
|
251
|
+
}).sort((e, t) => (e.order ?? 0) - (t.order ?? 0)).map(({ name: e }) => ({ name: e }));
|
|
252
|
+
}, "getBranchesAsObjArray"), de = /* @__PURE__ */ n(function() {
|
|
253
|
+
return C.records.branches;
|
|
254
|
+
}, "getBranches"), fe = /* @__PURE__ */ n(function() {
|
|
255
|
+
return C.records.commits;
|
|
256
|
+
}, "getCommits"), k = /* @__PURE__ */ n(function() {
|
|
257
|
+
let t = [...C.records.commits.values()];
|
|
258
|
+
return t.forEach(function(t) {
|
|
259
|
+
e.debug(t.id);
|
|
260
|
+
}), t.sort((e, t) => e.seq - t.seq), t;
|
|
261
|
+
}, "getCommitsArray"), A = {
|
|
262
|
+
commitType: x,
|
|
263
|
+
getConfig: S,
|
|
264
|
+
setDirection: te,
|
|
265
|
+
setOptions: ne,
|
|
266
|
+
getOptions: re,
|
|
267
|
+
commit: ie,
|
|
268
|
+
branch: ae,
|
|
269
|
+
merge: oe,
|
|
270
|
+
cherryPick: se,
|
|
271
|
+
checkout: E,
|
|
272
|
+
prettyPrint: ce,
|
|
273
|
+
clear: le,
|
|
274
|
+
getBranchesAsObjArray: ue,
|
|
275
|
+
getBranches: de,
|
|
276
|
+
getCommits: fe,
|
|
277
|
+
getCommitsArray: k,
|
|
278
|
+
getCurrentBranch: /* @__PURE__ */ n(function() {
|
|
279
|
+
return C.records.currBranch;
|
|
280
|
+
}, "getCurrentBranch"),
|
|
281
|
+
getDirection: /* @__PURE__ */ n(function() {
|
|
282
|
+
return C.records.direction;
|
|
283
|
+
}, "getDirection"),
|
|
284
|
+
getHead: /* @__PURE__ */ n(function() {
|
|
285
|
+
return C.records.head;
|
|
286
|
+
}, "getHead"),
|
|
287
|
+
setAccTitle: a,
|
|
288
|
+
getAccTitle: m,
|
|
289
|
+
getAccDescription: d,
|
|
290
|
+
setAccDescription: r,
|
|
291
|
+
setDiagramTitle: i,
|
|
292
|
+
getDiagramTitle: f
|
|
293
|
+
}, pe = /* @__PURE__ */ n((e, t) => {
|
|
294
|
+
y(e, t), e.dir && t.setDirection(e.dir);
|
|
295
|
+
for (let n of e.statements) me(n, t);
|
|
296
|
+
}, "populate"), me = /* @__PURE__ */ n((t, r) => {
|
|
297
|
+
let i = {
|
|
298
|
+
Commit: /* @__PURE__ */ n((e) => r.commit(he(e)), "Commit"),
|
|
299
|
+
Branch: /* @__PURE__ */ n((e) => r.branch(ge(e)), "Branch"),
|
|
300
|
+
Merge: /* @__PURE__ */ n((e) => r.merge(_e(e)), "Merge"),
|
|
301
|
+
Checkout: /* @__PURE__ */ n((e) => r.checkout(ve(e)), "Checkout"),
|
|
302
|
+
CherryPicking: /* @__PURE__ */ n((e) => r.cherryPick(ye(e)), "CherryPicking")
|
|
303
|
+
}[t.$type];
|
|
304
|
+
i ? i(t) : e.error(`Unknown statement type: ${t.$type}`);
|
|
305
|
+
}, "parseStatement"), he = /* @__PURE__ */ n((e) => ({
|
|
306
|
+
id: e.id,
|
|
307
|
+
msg: e.message ?? "",
|
|
308
|
+
type: e.type === void 0 ? x.NORMAL : x[e.type],
|
|
309
|
+
tags: e.tags ?? void 0
|
|
310
|
+
}), "parseCommit"), ge = /* @__PURE__ */ n((e) => ({
|
|
311
|
+
name: e.name,
|
|
312
|
+
order: e.order ?? 0
|
|
313
|
+
}), "parseBranch"), _e = /* @__PURE__ */ n((e) => ({
|
|
314
|
+
branch: e.branch,
|
|
315
|
+
id: e.id ?? "",
|
|
316
|
+
type: e.type === void 0 ? void 0 : x[e.type],
|
|
317
|
+
tags: e.tags ?? void 0
|
|
318
|
+
}), "parseMerge"), ve = /* @__PURE__ */ n((e) => e.branch, "parseCheckout"), ye = /* @__PURE__ */ n((e) => ({
|
|
319
|
+
id: e.id,
|
|
320
|
+
targetId: "",
|
|
321
|
+
tags: e.tags?.length === 0 ? void 0 : e.tags,
|
|
322
|
+
parent: e.parent
|
|
323
|
+
}), "parseCherryPicking"), be = { parse: /* @__PURE__ */ n(async (t) => {
|
|
324
|
+
let n = await v("gitGraph", t);
|
|
325
|
+
e.debug(n), pe(n, A);
|
|
326
|
+
}, "parse") }, j = 10, M = 40, N = 4, P = 2, F = 8, I = /* @__PURE__ */ new Set([
|
|
327
|
+
"redux",
|
|
328
|
+
"redux-dark",
|
|
329
|
+
"redux-color",
|
|
330
|
+
"redux-dark-color"
|
|
331
|
+
]), L = 12, R = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), xe = /* @__PURE__ */ new Set([
|
|
332
|
+
"dark",
|
|
333
|
+
"redux-dark",
|
|
334
|
+
"redux-dark-color",
|
|
335
|
+
"neo-dark"
|
|
336
|
+
]), z = /* @__PURE__ */ n((e, t, n = !1) => n && e > 0 ? (e - 1) % (t - 1) + 1 : e % t, "calcColorIndex"), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), H = 30, U = /* @__PURE__ */ new Map(), W = [], G = 0, K = "LR", q = /* @__PURE__ */ n(() => {
|
|
337
|
+
B.clear(), V.clear(), U.clear(), G = 0, W = [], K = "LR";
|
|
338
|
+
}, "clear"), J = /* @__PURE__ */ n((e) => {
|
|
339
|
+
let t = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
340
|
+
return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((e) => {
|
|
341
|
+
let n = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
342
|
+
n.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), n.setAttribute("dy", "1em"), n.setAttribute("x", "0"), n.setAttribute("class", "row"), n.textContent = e.trim(), t.appendChild(n);
|
|
343
|
+
}), t;
|
|
344
|
+
}, "drawText"), Y = /* @__PURE__ */ n((e) => {
|
|
345
|
+
let t, r, i;
|
|
346
|
+
return K === "BT" ? (r = /* @__PURE__ */ n((e, t) => e <= t, "comparisonFunc"), i = Infinity) : (r = /* @__PURE__ */ n((e, t) => e >= t, "comparisonFunc"), i = 0), e.forEach((e) => {
|
|
347
|
+
let n = K === "TB" || K == "BT" ? V.get(e)?.y : V.get(e)?.x;
|
|
348
|
+
n !== void 0 && r(n, i) && (t = e, i = n);
|
|
349
|
+
}), t;
|
|
350
|
+
}, "findClosestParent"), Se = /* @__PURE__ */ n((e) => {
|
|
351
|
+
let t = "", n = Infinity;
|
|
352
|
+
return e.forEach((e) => {
|
|
353
|
+
let r = V.get(e).y;
|
|
354
|
+
r <= n && (t = e, n = r);
|
|
355
|
+
}), t || void 0;
|
|
356
|
+
}, "findClosestParentBT"), Ce = /* @__PURE__ */ n((e, t, n) => {
|
|
357
|
+
let r = n, i = n, a = [];
|
|
358
|
+
e.forEach((e) => {
|
|
359
|
+
let n = t.get(e);
|
|
360
|
+
if (!n) throw Error(`Commit not found for key ${e}`);
|
|
361
|
+
n.parents.length ? (r = Te(n), i = Math.max(r, i)) : a.push(n), Ee(n, r);
|
|
362
|
+
}), r = i, a.forEach((e) => {
|
|
363
|
+
De(e, r, n);
|
|
364
|
+
}), e.forEach((e) => {
|
|
365
|
+
let n = t.get(e);
|
|
366
|
+
if (n?.parents.length) {
|
|
367
|
+
let e = Se(n.parents);
|
|
368
|
+
r = V.get(e).y - M, r <= i && (i = r);
|
|
369
|
+
let t = B.get(n.branch).pos, a = r - j;
|
|
370
|
+
V.set(n.id, {
|
|
371
|
+
x: t,
|
|
372
|
+
y: a
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
}, "setParallelBTPos"), we = /* @__PURE__ */ n((e) => {
|
|
377
|
+
let t = Y(e.parents.filter((e) => e !== null));
|
|
378
|
+
if (!t) throw Error(`Closest parent not found for commit ${e.id}`);
|
|
379
|
+
let n = V.get(t)?.y;
|
|
380
|
+
if (n === void 0) throw Error(`Closest parent position not found for commit ${e.id}`);
|
|
381
|
+
return n;
|
|
382
|
+
}, "findClosestParentPos"), Te = /* @__PURE__ */ n((e) => we(e) + M, "calculateCommitPosition"), Ee = /* @__PURE__ */ n((e, t) => {
|
|
383
|
+
let n = B.get(e.branch);
|
|
384
|
+
if (!n) throw Error(`Branch not found for commit ${e.id}`);
|
|
385
|
+
let r = n.pos, i = t + j;
|
|
386
|
+
return V.set(e.id, {
|
|
387
|
+
x: r,
|
|
388
|
+
y: i
|
|
389
|
+
}), {
|
|
390
|
+
x: r,
|
|
391
|
+
y: i
|
|
392
|
+
};
|
|
393
|
+
}, "setCommitPosition"), De = /* @__PURE__ */ n((e, t, n) => {
|
|
394
|
+
let r = B.get(e.branch);
|
|
395
|
+
if (!r) throw Error(`Branch not found for commit ${e.id}`);
|
|
396
|
+
let i = t + n, a = r.pos;
|
|
397
|
+
V.set(e.id, {
|
|
398
|
+
x: a,
|
|
399
|
+
y: i
|
|
400
|
+
});
|
|
401
|
+
}, "setRootPosition"), Oe = /* @__PURE__ */ n((e, t, n, r, i, a) => {
|
|
402
|
+
let { theme: o } = p(), s = I.has(o ?? ""), c = R.has(o ?? ""), l = xe.has(o ?? "");
|
|
403
|
+
if (a === x.HIGHLIGHT) e.append("rect").attr("x", n.x - 10 + (s ? 3 : 0)).attr("y", n.y - 10 + (s ? 3 : 0)).attr("width", s ? 14 : 20).attr("height", s ? 14 : 20).attr("class", `commit ${t.id} commit-highlight${z(i, F, c)} ${r}-outer`), e.append("rect").attr("x", n.x - 6 + (s ? 2 : 0)).attr("y", n.y - 6 + (s ? 2 : 0)).attr("width", s ? 8 : 12).attr("height", s ? 8 : 12).attr("class", `commit ${t.id} commit${z(i, F, c)} ${r}-inner`);
|
|
404
|
+
else if (a === x.CHERRY_PICK) e.append("circle").attr("cx", n.x).attr("cy", n.y).attr("r", s ? 7 : 10).attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x - 3).attr("cy", n.y + 2).attr("r", s ? 2.5 : 2.75).attr("fill", l ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x + 3).attr("cy", n.y + 2).attr("r", s ? 2.5 : 2.75).attr("fill", l ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("line").attr("x1", n.x + 3).attr("y1", n.y + 1).attr("x2", n.x).attr("y2", n.y - 5).attr("stroke", l ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("line").attr("x1", n.x - 3).attr("y1", n.y + 1).attr("x2", n.x).attr("y2", n.y - 5).attr("stroke", l ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`);
|
|
405
|
+
else {
|
|
406
|
+
let o = e.append("circle");
|
|
407
|
+
if (o.attr("cx", n.x), o.attr("cy", n.y), o.attr("r", s ? 7 : 10), o.attr("class", `commit ${t.id} commit${z(i, F, c)}`), a === x.MERGE) {
|
|
408
|
+
let a = e.append("circle");
|
|
409
|
+
a.attr("cx", n.x), a.attr("cy", n.y), a.attr("r", s ? 5 : 6), a.attr("class", `commit ${r} ${t.id} commit${z(i, F, c)}`);
|
|
410
|
+
}
|
|
411
|
+
if (a === x.REVERSE) {
|
|
412
|
+
let a = e.append("path"), o = s ? 4 : 5;
|
|
413
|
+
a.attr("d", `M ${n.x - o},${n.y - o}L${n.x + o},${n.y + o}M${n.x - o},${n.y + o}L${n.x + o},${n.y - o}`).attr("class", `commit ${r} ${t.id} commit${z(i, F, c)}`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}, "drawCommitBullet"), ke = /* @__PURE__ */ n((e, t, n, r, i) => {
|
|
417
|
+
if (t.type !== x.CHERRY_PICK && (t.customId && t.type === x.MERGE || t.type !== x.MERGE) && i.showCommitLabel) {
|
|
418
|
+
let a = e.append("g"), o = a.insert("rect").attr("class", "commit-label-bkg"), s = a.append("text").attr("x", r).attr("y", n.y + 25).attr("class", "commit-label").text(t.id), c = s.node()?.getBBox();
|
|
419
|
+
if (c && (o.attr("x", n.posWithOffset - c.width / 2 - P).attr("y", n.y + 13.5).attr("width", c.width + 2 * P).attr("height", c.height + 2 * P), K === "TB" || K === "BT" ? (o.attr("x", n.x - (c.width + 4 * N + 5)).attr("y", n.y - 12), s.attr("x", n.x - (c.width + 4 * N)).attr("y", n.y + c.height - 12)) : s.attr("x", n.posWithOffset - c.width / 2), i.rotateCommitLabel)) {
|
|
420
|
+
if (K === "TB" || K === "BT") s.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")"), o.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")");
|
|
421
|
+
else {
|
|
422
|
+
let e = -7.5 - (c.width + 10) / 25 * 9.5, t = 10 + c.width / 25 * 8.5;
|
|
423
|
+
a.attr("transform", "translate(" + e + ", " + t + ") rotate(-45, " + r + ", " + n.y + ")");
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}, "drawCommitLabel"), Ae = /* @__PURE__ */ n((e, t, n, r) => {
|
|
428
|
+
if (t.tags.length > 0) {
|
|
429
|
+
let i = 0, a = 0, o = 0, s = [];
|
|
430
|
+
for (let r of t.tags.reverse()) {
|
|
431
|
+
let t = e.insert("polygon"), c = e.append("circle"), l = e.append("text").attr("y", n.y - 16 - i).attr("class", "tag-label").text(r), u = l.node()?.getBBox();
|
|
432
|
+
if (!u) throw Error("Tag bbox not found");
|
|
433
|
+
a = Math.max(a, u.width), o = Math.max(o, u.height), l.attr("x", n.posWithOffset - u.width / 2), s.push({
|
|
434
|
+
tag: l,
|
|
435
|
+
hole: c,
|
|
436
|
+
rect: t,
|
|
437
|
+
yOffset: i
|
|
438
|
+
}), i += 20;
|
|
439
|
+
}
|
|
440
|
+
for (let { tag: e, hole: t, rect: i, yOffset: c } of s) {
|
|
441
|
+
let s = o / 2, l = n.y - 19.2 - c;
|
|
442
|
+
if (i.attr("class", "tag-label-bkg").attr("points", `
|
|
443
|
+
${r - a / 2 - N / 2},${l + P}
|
|
444
|
+
${r - a / 2 - N / 2},${l - P}
|
|
445
|
+
${n.posWithOffset - a / 2 - N},${l - s - P}
|
|
446
|
+
${n.posWithOffset + a / 2 + N},${l - s - P}
|
|
447
|
+
${n.posWithOffset + a / 2 + N},${l + s + P}
|
|
448
|
+
${n.posWithOffset - a / 2 - N},${l + s + P}`), t.attr("cy", l).attr("cx", r - a / 2 + N / 2).attr("r", 1.5).attr("class", "tag-hole"), K === "TB" || K === "BT") {
|
|
449
|
+
let o = r + c;
|
|
450
|
+
i.attr("class", "tag-label-bkg").attr("points", `
|
|
451
|
+
${n.x},${o + 2}
|
|
452
|
+
${n.x},${o - 2}
|
|
453
|
+
${n.x + j},${o - s - 2}
|
|
454
|
+
${n.x + j + a + 4},${o - s - 2}
|
|
455
|
+
${n.x + j + a + 4},${o + s + 2}
|
|
456
|
+
${n.x + j},${o + s + 2}`).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), t.attr("cx", n.x + N / 2).attr("cy", o).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), e.attr("x", n.x + 5).attr("y", o + 3).attr("transform", "translate(14,14) rotate(45, " + n.x + "," + r + ")");
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}, "drawCommitTags"), je = /* @__PURE__ */ n((e) => {
|
|
461
|
+
switch (e.customType ?? e.type) {
|
|
462
|
+
case x.NORMAL: return "commit-normal";
|
|
463
|
+
case x.REVERSE: return "commit-reverse";
|
|
464
|
+
case x.HIGHLIGHT: return "commit-highlight";
|
|
465
|
+
case x.MERGE: return "commit-merge";
|
|
466
|
+
case x.CHERRY_PICK: return "commit-cherry-pick";
|
|
467
|
+
default: return "commit-normal";
|
|
468
|
+
}
|
|
469
|
+
}, "getCommitClassType"), Me = /* @__PURE__ */ n((e, t, n, r) => {
|
|
470
|
+
let i = {
|
|
471
|
+
x: 0,
|
|
472
|
+
y: 0
|
|
473
|
+
};
|
|
474
|
+
if (e.parents.length > 0) {
|
|
475
|
+
let n = Y(e.parents);
|
|
476
|
+
if (n) {
|
|
477
|
+
let a = r.get(n) ?? i;
|
|
478
|
+
return t === "TB" ? a.y + M : t === "BT" ? (r.get(e.id) ?? i).y - M : a.x + M;
|
|
479
|
+
}
|
|
480
|
+
} else if (t === "TB") return H;
|
|
481
|
+
else if (t === "BT") return (r.get(e.id) ?? i).y - M;
|
|
482
|
+
else return 0;
|
|
483
|
+
return 0;
|
|
484
|
+
}, "calculatePosition"), Ne = /* @__PURE__ */ n((e, t, n) => {
|
|
485
|
+
let r = K === "BT" && n ? t : t + j, i = B.get(e.branch)?.pos, a = K === "TB" || K === "BT" ? B.get(e.branch)?.pos : r;
|
|
486
|
+
if (a === void 0 || i === void 0) throw Error(`Position were undefined for commit ${e.id}`);
|
|
487
|
+
let o = I.has(p().theme ?? "");
|
|
488
|
+
return {
|
|
489
|
+
x: a,
|
|
490
|
+
y: K === "TB" || K === "BT" ? r : i + (o ? L / 2 + 1 : -2),
|
|
491
|
+
posWithOffset: r
|
|
492
|
+
};
|
|
493
|
+
}, "getCommitPosition"), X = /* @__PURE__ */ n((e, t, r, i) => {
|
|
494
|
+
let a = e.append("g").attr("class", "commit-bullets"), o = e.append("g").attr("class", "commit-labels"), s = K === "TB" || K === "BT" ? H : 0, c = [...t.keys()], l = i.parallelCommits ?? !1, u = /* @__PURE__ */ n((e, n) => {
|
|
495
|
+
let r = t.get(e)?.seq, i = t.get(n)?.seq;
|
|
496
|
+
return r !== void 0 && i !== void 0 ? r - i : 0;
|
|
497
|
+
}, "sortKeys"), d = c.sort(u);
|
|
498
|
+
K === "BT" && (l && Ce(d, t, s), d = d.reverse()), d.forEach((e) => {
|
|
499
|
+
let n = t.get(e);
|
|
500
|
+
if (!n) throw Error(`Commit not found for key ${e}`);
|
|
501
|
+
l && (s = Me(n, K, s, V));
|
|
502
|
+
let c = Ne(n, s, l);
|
|
503
|
+
if (r) {
|
|
504
|
+
let e = je(n), t = n.customType ?? n.type, r = B.get(n.branch)?.index ?? 0;
|
|
505
|
+
Oe(a, n, c, e, r, t), ke(o, n, c, s, i), Ae(o, n, c, s);
|
|
506
|
+
}
|
|
507
|
+
K === "TB" || K === "BT" ? V.set(n.id, {
|
|
508
|
+
x: c.x,
|
|
509
|
+
y: c.posWithOffset
|
|
510
|
+
}) : V.set(n.id, {
|
|
511
|
+
x: c.posWithOffset,
|
|
512
|
+
y: c.y
|
|
513
|
+
}), s = K === "BT" && l ? s + M : s + M + j, s > G && (G = s);
|
|
514
|
+
});
|
|
515
|
+
}, "drawCommits"), Pe = /* @__PURE__ */ n((e, t, r, i, a) => {
|
|
516
|
+
let o = (K === "TB" || K === "BT" ? r.x < i.x : r.y < i.y) ? t.branch : e.branch, s = /* @__PURE__ */ n((e) => e.branch === o, "isOnBranchToGetCurve"), c = /* @__PURE__ */ n((n) => n.seq > e.seq && n.seq < t.seq, "isBetweenCommits");
|
|
517
|
+
return [...a.values()].some((e) => c(e) && s(e));
|
|
518
|
+
}, "shouldRerouteArrow"), Z = /* @__PURE__ */ n((e, t, n = 0) => {
|
|
519
|
+
let r = e + Math.abs(e - t) / 2;
|
|
520
|
+
return n > 5 ? r : W.every((e) => Math.abs(e - r) >= 10) ? (W.push(r), r) : Z(e, t - Math.abs(e - t) / 5, n + 1);
|
|
521
|
+
}, "findLane"), Fe = /* @__PURE__ */ n((e, t, n, r) => {
|
|
522
|
+
let { theme: i } = p(), a = R.has(i ?? ""), o = V.get(t.id), s = V.get(n.id);
|
|
523
|
+
if (o === void 0 || s === void 0) throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);
|
|
524
|
+
let c = Pe(t, n, o, s, r), l = "", u = "", d = 0, f = 0, m = B.get(n.branch)?.index;
|
|
525
|
+
n.type === x.MERGE && t.id !== n.parents[0] && (m = B.get(t.branch)?.index);
|
|
526
|
+
let h;
|
|
527
|
+
if (c) {
|
|
528
|
+
l = "A 10 10, 0, 0, 0,", u = "A 10 10, 0, 0, 1,", d = 10, f = 10;
|
|
529
|
+
let e = o.y < s.y ? Z(o.y, s.y) : Z(s.y, o.y), n = o.x < s.x ? Z(o.x, s.x) : Z(s.x, o.x);
|
|
530
|
+
K === "TB" ? o.x < s.x ? h = `M ${o.x} ${o.y} L ${n - d} ${o.y} ${u} ${n} ${o.y + f} L ${n} ${s.y - d} ${l} ${n + f} ${s.y} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${n + d} ${o.y} ${l} ${n} ${o.y + f} L ${n} ${s.y - d} ${u} ${n - f} ${s.y} L ${s.x} ${s.y}`) : K === "BT" ? o.x < s.x ? h = `M ${o.x} ${o.y} L ${n - d} ${o.y} ${l} ${n} ${o.y - f} L ${n} ${s.y + d} ${u} ${n + f} ${s.y} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${n + d} ${o.y} ${u} ${n} ${o.y - f} L ${n} ${s.y + d} ${l} ${n - f} ${s.y} L ${s.x} ${s.y}`) : o.y < s.y ? h = `M ${o.x} ${o.y} L ${o.x} ${e - d} ${l} ${o.x + f} ${e} L ${s.x - d} ${e} ${u} ${s.x} ${e + f} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${o.x} ${e + d} ${u} ${o.x + f} ${e} L ${s.x - d} ${e} ${l} ${s.x} ${e - f} L ${s.x} ${s.y}`);
|
|
531
|
+
} else l = "A 20 20, 0, 0, 0,", u = "A 20 20, 0, 0, 1,", d = 20, f = 20, K === "TB" ? (o.x < s.x && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y - d} ${l} ${o.x + f} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x - d} ${o.y} ${u} ${s.x} ${o.y + f} L ${s.x} ${s.y}`), o.x > s.x && (l = "A 20 20, 0, 0, 0,", u = "A 20 20, 0, 0, 1,", d = 20, f = 20, h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y - d} ${u} ${o.x - f} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x + d} ${o.y} ${l} ${s.x} ${o.y + f} L ${s.x} ${s.y}`), o.x === s.x && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`)) : K === "BT" ? (o.x < s.x && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y + d} ${u} ${o.x + f} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x - d} ${o.y} ${l} ${s.x} ${o.y - f} L ${s.x} ${s.y}`), o.x > s.x && (l = "A 20 20, 0, 0, 0,", u = "A 20 20, 0, 0, 1,", d = 20, f = 20, h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y + d} ${l} ${o.x - f} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x + d} ${o.y} ${u} ${s.x} ${o.y - f} L ${s.x} ${s.y}`), o.x === s.x && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`)) : (o.y < s.y && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${s.x - d} ${o.y} ${u} ${s.x} ${o.y + f} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${o.x} ${s.y - d} ${l} ${o.x + f} ${s.y} L ${s.x} ${s.y}`), o.y > s.y && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${s.x - d} ${o.y} ${l} ${s.x} ${o.y - f} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${o.x} ${s.y + d} ${u} ${o.x + f} ${s.y} L ${s.x} ${s.y}`), o.y === s.y && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`));
|
|
532
|
+
if (h === void 0) throw Error("Line definition not found");
|
|
533
|
+
e.append("path").attr("d", h).attr("class", "arrow arrow" + z(m, F, a));
|
|
534
|
+
}, "drawArrow"), Ie = /* @__PURE__ */ n((e, t) => {
|
|
535
|
+
let n = e.append("g").attr("class", "commit-arrows");
|
|
536
|
+
[...t.keys()].forEach((e) => {
|
|
537
|
+
let r = t.get(e);
|
|
538
|
+
r.parents && r.parents.length > 0 && r.parents.forEach((e) => {
|
|
539
|
+
Fe(n, t.get(e), r, t);
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
}, "drawArrows"), Le = /* @__PURE__ */ n((e, t, n, r) => {
|
|
543
|
+
let { look: i, theme: a, themeVariables: o } = p(), { dropShadow: s, THEME_COLOR_LIMIT: c } = o, l = I.has(a ?? ""), u = R.has(a ?? ""), d = e.append("g");
|
|
544
|
+
t.forEach((e, t) => {
|
|
545
|
+
let a = z(t, l ? c : F, u), o = B.get(e.name)?.pos;
|
|
546
|
+
if (o === void 0) throw Error(`Position not found for branch ${e.name}`);
|
|
547
|
+
let f = K === "TB" || K === "BT" ? o : l ? o + L / 2 + 1 : o - 2, p = d.append("line");
|
|
548
|
+
p.attr("x1", 0), p.attr("y1", f), p.attr("x2", G), p.attr("y2", f), p.attr("class", "branch branch" + a), K === "TB" ? (p.attr("y1", H), p.attr("x1", o), p.attr("y2", G), p.attr("x2", o)) : K === "BT" && (p.attr("y1", G), p.attr("x1", o), p.attr("y2", H), p.attr("x2", o)), W.push(f);
|
|
549
|
+
let m = e.name, h = J(m), g = d.insert("rect"), _ = d.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + a);
|
|
550
|
+
_.node().appendChild(h);
|
|
551
|
+
let v = h.getBBox(), y = l ? 0 : 4, b = l ? 16 : 0, x = l ? L : 0;
|
|
552
|
+
i === "neo" && g.attr("data-look", "neo"), g.attr("class", "branchLabelBkg label" + a).attr("style", i === "neo" ? `filter:${l ? `url(#${r}-drop-shadow)` : s}` : "").attr("rx", y).attr("ry", y).attr("x", -v.width - 4 - (n.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -v.height / 2 + 10).attr("width", v.width + 18 + b).attr("height", v.height + 4 + x), _.attr("transform", "translate(" + (-v.width - 14 - (n.rotateCommitLabel === !0 ? 30 : 0) + b / 2) + ", " + (f - v.height / 2 - 2) + ")"), K === "TB" ? (g.attr("x", o - v.width / 2 - 10).attr("y", 0), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", 0)"), l && (g.attr("transform", `translate(${-b / 2 - 3}, ${-x - 10})`), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + (-x * 2 + 7) + ")"))) : K === "BT" ? (g.attr("x", o - v.width / 2 - 10).attr("y", G), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + G + ")"), l && (g.attr("transform", `translate(${-b / 2 - 3}, ${x + 10})`), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + (G + x * 2 + 4) + ")"))) : g.attr("transform", "translate(-19, " + (f - 12 - x / 2) + ")");
|
|
553
|
+
});
|
|
554
|
+
}, "drawBranches"), Re = /* @__PURE__ */ n(function(e, t, n, r, i) {
|
|
555
|
+
return B.set(e, {
|
|
556
|
+
pos: t,
|
|
557
|
+
index: n
|
|
558
|
+
}), t += 50 + (i ? 40 : 0) + (K === "TB" || K === "BT" ? r.width / 2 : 0), t;
|
|
559
|
+
}, "setBranchPosition"), ze = { draw: /* @__PURE__ */ n(function(n, r, i, a) {
|
|
560
|
+
q(), e.debug("in gitgraph renderer", n + "\n", "id:", r, i);
|
|
561
|
+
let s = a.db;
|
|
562
|
+
if (!s.getConfig) {
|
|
563
|
+
e.error("getConfig method is not available on db");
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
let c = s.getConfig(), l = c.rotateCommitLabel ?? !1;
|
|
567
|
+
U = s.getCommits();
|
|
568
|
+
let u = s.getBranchesAsObjArray();
|
|
569
|
+
K = s.getDirection();
|
|
570
|
+
let d = t(`[id="${r}"]`), { look: f, theme: m, themeVariables: g } = p(), { useGradient: _, gradientStart: v, gradientStop: y, filterColor: b } = g;
|
|
571
|
+
if (_) {
|
|
572
|
+
let e = d.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
|
|
573
|
+
e.append("stop").attr("offset", "0%").attr("stop-color", v).attr("stop-opacity", 1), e.append("stop").attr("offset", "100%").attr("stop-color", y).attr("stop-opacity", 1);
|
|
574
|
+
}
|
|
575
|
+
f === "neo" && I.has(m ?? "") && d.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", b);
|
|
576
|
+
let x = 0;
|
|
577
|
+
u.forEach((e, t) => {
|
|
578
|
+
let n = J(e.name), r = d.append("g"), i = r.insert("g").attr("class", "branchLabel"), a = i.insert("g").attr("class", "label branch-label");
|
|
579
|
+
a.node()?.appendChild(n);
|
|
580
|
+
let o = n.getBBox();
|
|
581
|
+
x = Re(e.name, x, t, o, l), a.remove(), i.remove(), r.remove();
|
|
582
|
+
}), X(d, U, !1, c), c.showBranches && Le(d, u, c, r), Ie(d, U), X(d, U, !0, c), h.insertTitle(d, "gitTitleText", c.titleTopMargin ?? 0, s.getDiagramTitle()), o(void 0, d, c.diagramPadding, c.useMaxWidth);
|
|
583
|
+
}, "draw") }, Q = 8, $ = /* @__PURE__ */ new Set([
|
|
584
|
+
"redux",
|
|
585
|
+
"redux-dark",
|
|
586
|
+
"redux-color",
|
|
587
|
+
"redux-dark-color"
|
|
588
|
+
]), Be = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Ve = /* @__PURE__ */ new Set(["neo", "neo-dark"]), He = /* @__PURE__ */ new Set([
|
|
589
|
+
"dark",
|
|
590
|
+
"redux-dark",
|
|
591
|
+
"redux-dark-color",
|
|
592
|
+
"neo-dark"
|
|
593
|
+
]), Ue = /* @__PURE__ */ new Set([
|
|
594
|
+
"redux",
|
|
595
|
+
"redux-dark",
|
|
596
|
+
"redux-color",
|
|
597
|
+
"redux-dark-color",
|
|
598
|
+
"neo",
|
|
599
|
+
"neo-dark"
|
|
600
|
+
]), We = /* @__PURE__ */ n((e) => {
|
|
601
|
+
let { svgId: t } = e, n = "";
|
|
602
|
+
if (e.useGradient && t) for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) n += `
|
|
603
|
+
.label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}
|
|
604
|
+
`;
|
|
605
|
+
return n;
|
|
606
|
+
}, "genGitGraphGradient"), Ge = /* @__PURE__ */ n((e) => {
|
|
607
|
+
let { theme: t, themeVariables: n } = c(), { borderColorArray: r } = n, i = $.has(t);
|
|
608
|
+
if (Ve.has(t)) {
|
|
609
|
+
let t = "";
|
|
610
|
+
for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) if (n === 0) t += `
|
|
611
|
+
.branch-label${n} { fill: ${e.nodeBorder};}
|
|
612
|
+
.commit${n} { stroke: ${e.nodeBorder}; }
|
|
613
|
+
.commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
614
|
+
.arrow${n} { stroke: ${e.nodeBorder}; }
|
|
615
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
616
|
+
.commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
|
|
617
|
+
${We(e)}`;
|
|
618
|
+
else {
|
|
619
|
+
let r = n % Q;
|
|
620
|
+
t += `
|
|
621
|
+
.branch-label${n} { fill: ${e["gitBranchLabel" + r]}; }
|
|
622
|
+
.commit${n} { stroke: ${e["git" + r]}; fill: ${e["git" + r]}; }
|
|
623
|
+
.commit-highlight${n} { stroke: ${e["gitInv" + r]}; fill: ${e["gitInv" + r]}; }
|
|
624
|
+
.arrow${n} { stroke: ${e["git" + r]}; }
|
|
625
|
+
`;
|
|
626
|
+
}
|
|
627
|
+
return t;
|
|
628
|
+
}
|
|
629
|
+
if (Be.has(t)) {
|
|
630
|
+
let n = "";
|
|
631
|
+
for (let a = 0; a < e.THEME_COLOR_LIMIT; a++) if (a === 0) n += `
|
|
632
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
633
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
634
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
|
|
635
|
+
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
636
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
637
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
638
|
+
`;
|
|
639
|
+
else {
|
|
640
|
+
let o = a % r.length;
|
|
641
|
+
n += `
|
|
642
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
643
|
+
.commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }
|
|
644
|
+
.commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }
|
|
645
|
+
.label${a} { fill: ${He.has(t) ? e.mainBkg : r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }
|
|
646
|
+
.arrow${a} { stroke: ${r[o]}; }
|
|
647
|
+
`;
|
|
648
|
+
}
|
|
649
|
+
return n;
|
|
650
|
+
}
|
|
651
|
+
{
|
|
652
|
+
let t = "";
|
|
653
|
+
for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) t += `
|
|
654
|
+
.branch-label${n} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
|
|
655
|
+
.commit${n} { stroke: ${e.nodeBorder}; }
|
|
656
|
+
.commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
657
|
+
.label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""}}
|
|
658
|
+
.arrow${n} { stroke: ${e.nodeBorder}; }
|
|
659
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
660
|
+
.commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
|
|
661
|
+
`;
|
|
662
|
+
return t;
|
|
663
|
+
}
|
|
664
|
+
}, "genColor"), Ke = /* @__PURE__ */ n((e) => `${Array.from({ length: e.THEME_COLOR_LIMIT }, (e, t) => t).map((t) => {
|
|
665
|
+
let n = t % Q;
|
|
666
|
+
return `
|
|
667
|
+
.branch-label${t} { fill: ${e["gitBranchLabel" + n]}; }
|
|
668
|
+
.commit${t} { stroke: ${e["git" + n]}; fill: ${e["git" + n]}; }
|
|
669
|
+
.commit-highlight${t} { stroke: ${e["gitInv" + n]}; fill: ${e["gitInv" + n]}; }
|
|
670
|
+
.label${t} { fill: ${e["git" + n]}; }
|
|
671
|
+
.arrow${t} { stroke: ${e["git" + n]}; }
|
|
672
|
+
`;
|
|
673
|
+
}).join("\n")}`, "normalTheme"), qe = {
|
|
674
|
+
parser: be,
|
|
675
|
+
db: A,
|
|
676
|
+
renderer: ze,
|
|
677
|
+
styles: /* @__PURE__ */ n((e) => {
|
|
678
|
+
let { theme: t } = c(), n = Ue.has(t);
|
|
679
|
+
return `
|
|
680
|
+
.commit-id,
|
|
681
|
+
.commit-msg,
|
|
682
|
+
.branch-label {
|
|
683
|
+
fill: lightgrey;
|
|
684
|
+
color: lightgrey;
|
|
685
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
686
|
+
font-family: var(--mermaid-font-family);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
${n ? Ge(e) : Ke(e)}
|
|
690
|
+
|
|
691
|
+
.branch {
|
|
692
|
+
stroke-width: ${e.strokeWidth};
|
|
693
|
+
stroke: ${e.commitLineColor ?? e.lineColor};
|
|
694
|
+
stroke-dasharray: ${n ? "4 2" : "2"};
|
|
695
|
+
}
|
|
696
|
+
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n ? e.nodeBorder : e.commitLabelColor}; ${n ? `font-weight:${e.noteFontWeight};` : ""}}
|
|
697
|
+
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n ? "transparent" : e.commitLabelBackground}; opacity: ${n ? "" : .5}; }
|
|
698
|
+
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
|
699
|
+
.tag-label-bkg { fill: ${n ? e.mainBkg : e.tagLabelBackground}; stroke: ${n ? e.nodeBorder : e.tagLabelBorder}; ${n ? `filter:${e.dropShadow}` : ""} }
|
|
700
|
+
.tag-hole { fill: ${e.textColor}; }
|
|
701
|
+
|
|
702
|
+
.commit-merge {
|
|
703
|
+
stroke: ${n ? e.mainBkg : e.primaryColor};
|
|
704
|
+
fill: ${n ? e.mainBkg : e.primaryColor};
|
|
705
|
+
}
|
|
706
|
+
.commit-reverse {
|
|
707
|
+
stroke: ${n ? e.mainBkg : e.primaryColor};
|
|
708
|
+
fill: ${n ? e.mainBkg : e.primaryColor};
|
|
709
|
+
stroke-width: ${n ? e.strokeWidth : 3};
|
|
710
|
+
}
|
|
711
|
+
.commit-highlight-outer {
|
|
712
|
+
}
|
|
713
|
+
.commit-highlight-inner {
|
|
714
|
+
stroke: ${n ? e.mainBkg : e.primaryColor};
|
|
715
|
+
fill: ${n ? e.mainBkg : e.primaryColor};
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.arrow {
|
|
719
|
+
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
|
|
720
|
+
stroke-width: ${$.has(t) ? e.strokeWidth : 8};
|
|
721
|
+
stroke-linecap: round;
|
|
722
|
+
fill: none
|
|
723
|
+
}
|
|
724
|
+
.gitTitleText {
|
|
725
|
+
text-anchor: middle;
|
|
726
|
+
font-size: 18px;
|
|
727
|
+
fill: ${e.textColor};
|
|
728
|
+
}
|
|
729
|
+
`;
|
|
730
|
+
}, "getStyles")
|
|
731
|
+
};
|
|
732
|
+
//#endregion
|
|
733
|
+
export { qe as diagram };
|