@kong-ui-public/documentation 0.8.27-pr.2132.c7fba69a4.0 → 0.8.27
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/_basePickBy-DF_KwdVi-HVXnmpaQ.js +151 -0
- package/dist/_baseUniq-DefQzZRT-CTix3bMY.js +614 -0
- package/dist/arc-B4xWw-B6-BGnuysbe.js +83 -0
- package/dist/architecture-I3QFYML2-7TNhn42L-52ENK4nk.js +5 -0
- package/dist/architectureDiagram-UYN6MBPD-Bg70hFZ--BirbHF75.js +4592 -0
- package/dist/astro-Uf8_VxKJ-CZxoSljj.js +16 -0
- package/dist/blockDiagram-ZHA2E4KO-Ylh05M-x-AVJfewxx.js +2247 -0
- package/dist/c-DASdrs7p-DASdrs7p.js +6 -0
- package/dist/c4Diagram-6F5ED5ID-BA0B_CmS-WdUKqC7Z.js +1581 -0
- package/dist/channel-B5uWur4x-BHu9WG2d.js +5 -0
- package/dist/chunk-5HRBRIJM-B7MbirM8-YDLjZbXN.js +24 -0
- package/dist/chunk-7U56Z5CX-CfNu7Hr2-BQzILIp1.js +1213 -0
- package/dist/chunk-ASOPGD6M-CwvgmaRl-BZAjlsEd.js +64 -0
- package/dist/chunk-KFBOBJHC-BB675Bua-GRhe6aGs.js +15 -0
- package/dist/chunk-T2TOU4HS-BgV1wucS-5Sa82KgW.js +1301 -0
- package/dist/chunk-TMUBEWPD-C22TGOO0-Bl2u--DY.js +9 -0
- package/dist/classDiagram-LNE6IOMH-D5SiSVyM-BbV9LB8E.js +14 -0
- package/dist/classDiagram-v2-MQ7JQ4JX-D5SiSVyM-BbV9LB8E.js +14 -0
- package/dist/clone-CmU1hwye-Lu5-ol5h.js +8 -0
- package/dist/csharp-CYWRhZ2R-CYWRhZ2R.js +6 -0
- package/dist/css-D1aVdRIU-D1aVdRIU.js +6 -0
- package/dist/csv-DvCncUGQ-Tno401i9.js +6 -0
- package/dist/cytoscape.esm-DAyNQ0qu-B7WxGuVh.js +16110 -0
- package/dist/dagre-4EVJKHTY-DMTVcQfE-C1Tr0EYY.js +447 -0
- package/dist/diagram-QW4FP2JN-jc61JuWr-DOMFELfS.js +126 -0
- package/dist/diff-XmNrvgM1-XmNrvgM1.js +6 -0
- package/dist/docker-DWH2onkn-DWH2onkn.js +6 -0
- package/dist/documentation.es.js +7 -0
- package/dist/documentation.umd.js +2404 -0
- package/dist/erDiagram-6RL3IURR-1byskxwI-B-wzYh8R.js +937 -0
- package/dist/flowDiagram-7ASYPVHJ-B3phEI8o-CVXSVDmh.js +1484 -0
- package/dist/ganttDiagram-NTVNEXSI-vYnO_T5c-Ccxkb7aQ.js +2491 -0
- package/dist/git-commit-BspYIY3P-VkbIfR3L.js +8 -0
- package/dist/git-rebase--zLBTjUa-DEW2tfKx.js +8 -0
- package/dist/gitGraph-YCYPL57B-DPx67Iu5-BPrLSH0g.js +5 -0
- package/dist/gitGraphDiagram-NRZ2UAAF-BHxB7Gjs-CeRxz6oW.js +712 -0
- package/dist/go-BErP6iv1-BErP6iv1.js +6 -0
- package/dist/graph-_eClejaU-DigE4Bf5.js +247 -0
- package/dist/graphql-DWpQF4JI-C-3VJmtp.js +14 -0
- package/dist/haml-CMN0hQaL-BV5BsZTy.js +10 -0
- package/dist/handlebars-Cc-7fXX5-B9YgDKzT.js +14 -0
- package/dist/haskell-CtlGos0K-CtlGos0K.js +6 -0
- package/dist/html-B0P_v3yU-BojM9zZg.js +10 -0
- package/dist/html-derivative-BJFFAxYV-iD6NAoKm.js +8 -0
- package/dist/http-Dcjm_K1m-1LFSbOE1.js +14 -0
- package/dist/index-B_RqyDIa.js +37033 -0
- package/dist/info-46DW6VJ7-DeIQKKyY-CVPexu5P.js +5 -0
- package/dist/infoDiagram-A4XQUW5V-Cx0WE_JZ-B_t8JIcX.js +22 -0
- package/dist/ini-BUcvsX-U-BUcvsX-U.js +6 -0
- package/dist/init-DjUOC4st-C8Nwz6AJ.js +16 -0
- package/dist/java-B7odJ7Ap-B7odJ7Ap.js +6 -0
- package/dist/javascript-fa8UlHZE-fa8UlHZE.js +6 -0
- package/dist/journeyDiagram-G5WM74LC-CUWL5R5G-DWlpHybW.js +810 -0
- package/dist/json-71t8ZF9g-71t8ZF9g.js +6 -0
- package/dist/json5-Z7F6rA6a-Z7F6rA6a.js +6 -0
- package/dist/jsonc-Dphhs4m2-Dphhs4m2.js +6 -0
- package/dist/jsonl-D9jj92Gg-D9jj92Gg.js +6 -0
- package/dist/jsx-Bkesy5tT-Bkesy5tT.js +6 -0
- package/dist/kanban-definition-QRCXZQQD-r5CdvT2h-BUkOeUnm.js +718 -0
- package/dist/katex-Qk2jHgyB-CF_fuFJb.js +11637 -0
- package/dist/kotlin-DCgZY7Ii-DCgZY7Ii.js +6 -0
- package/dist/latex-CZXk8SiZ-DbjDPp_f.js +11 -0
- package/dist/layout-DfjmtgNY-Bw6LFOXt.js +1321 -0
- package/dist/less-DQA4v-Nm-DQA4v-Nm.js +6 -0
- package/dist/linear-BGmbGdcc-C--Nxp9Q.js +423 -0
- package/dist/liquid-CvufO3kO-D90bBAdm.js +14 -0
- package/dist/lua-BVfhNLDr-DAa90qLN.js +8 -0
- package/dist/make-BjuHP00g-BjuHP00g.js +6 -0
- package/dist/markdown-B6guhLWd-B6guhLWd.js +6 -0
- package/dist/material-theme-lighter-BUBw43Yz-BUBw43Yz.js +4 -0
- package/dist/material-theme-palenight-C1RVm8K1-C1RVm8K1.js +4 -0
- package/dist/mdc-Bq810vct-Dr8CpN8f.js +12 -0
- package/dist/mdx-DIoECIFU-DIoECIFU.js +6 -0
- package/dist/mermaid-BZ7WHNIe-BZ7WHNIe.js +6 -0
- package/dist/mermaid-parser.core-DxgZuQQq-uP-grJig.js +12400 -0
- package/dist/mindmap-definition-GWI6TPTV-DX5GL05M-B8Eu6UCe.js +3219 -0
- package/dist/nginx-Can2eAjw-DKMoypYC.js +8 -0
- package/dist/objective-c-BGg9R27G-BGg9R27G.js +6 -0
- package/dist/ordinal-DfAQgscy-BEJTu10r.js +61 -0
- package/dist/packet-W2GHVCYJ-CI_-E3C--D1lo2o0i.js +5 -0
- package/dist/pascal-l2bqd7Dz-l2bqd7Dz.js +6 -0
- package/dist/perl-DaMQyPwp-Cxx4wmV7.js +16 -0
- package/dist/php-BL3EfPBi-BZu5YwDX.js +18 -0
- package/dist/pie-BEWT4RHE-B52QOymI-BoBX6ZnD.js +5 -0
- package/dist/pieDiagram-YF2LJOPJ-IHpbN7M9-BBPOh3m7.js +161 -0
- package/dist/plsql-oVq_K_wH-oVq_K_wH.js +6 -0
- package/dist/postcss-BZ3MNRIJ-BZ3MNRIJ.js +6 -0
- package/dist/powershell-Diwyv8Eh-Diwyv8Eh.js +6 -0
- package/dist/proto-o9HLmF90-o9HLmF90.js +6 -0
- package/dist/pug-HKe4Luo3-BYb0El_4.js +12 -0
- package/dist/python-xYxLFJY--xYxLFJY-.js +6 -0
- package/dist/quadrantDiagram-OS5C2QUG-DyfTAjs0-CvYOplDG.js +1024 -0
- package/dist/r-F-9I-ITZ-F-9I-ITZ.js +6 -0
- package/dist/reg-CMUdAgIP-CMUdAgIP.js +6 -0
- package/dist/requirementDiagram-MIRIMTAZ-DpFia6HM-BNS6fGqi.js +768 -0
- package/dist/rst-B8JEEtLI-Dyxh6LOj.js +22 -0
- package/dist/ruby-FDlfLkNa-nf7VLvCK.js +50 -0
- package/dist/rust-Pc7DCsZD-Pc7DCsZD.js +6 -0
- package/dist/sankeyDiagram-Y46BX6SQ-a6p3ZaX0-Cwasp0IA.js +805 -0
- package/dist/sass-iCyS6eP9-iCyS6eP9.js +6 -0
- package/dist/scss-DhHc4lxB-D1lMETuy.js +8 -0
- package/dist/sequenceDiagram-G6AWOVSC-DlZ7du4U-z70BwBnZ.js +2274 -0
- package/dist/shellscript-Dn0-btNd-Dn0-btNd.js +6 -0
- package/dist/shellsession-8OLo3sB6-DD6AdPYk.js +8 -0
- package/dist/splunk-CTqDjQdo-CTqDjQdo.js +6 -0
- package/dist/sql-DCkt643--DCkt643-.js +6 -0
- package/dist/ssh-config-DHHGll-v-DHHGll-v.js +6 -0
- package/dist/stateDiagram-MAYHULR4-tK3TdntS-PielUO6n.js +268 -0
- package/dist/stateDiagram-v2-4JROLMXI-Ib4sJL3A--uDyhxdT.js +14 -0
- package/dist/style.css +1 -0
- package/dist/stylus-n_9f0QQ5-n_9f0QQ5.js +6 -0
- package/dist/svelte-01qw6Rxm-Cjp5Srko.js +14 -0
- package/dist/swift-BAWqNR8A-BAWqNR8A.js +6 -0
- package/dist/timeline-definition-U7ZMHBDA-Db9d-9_E-kHwjVd5T.js +804 -0
- package/dist/toml-CQSfOn0e-CQSfOn0e.js +6 -0
- package/dist/tsx-DiGsgWT8-DiGsgWT8.js +6 -0
- package/dist/twig-DxrNSc26-BIWbKTFO.js +18 -0
- package/dist/types/components/DocumentationContent.vue.d.ts +177 -0
- package/dist/types/components/DocumentationContent.vue.d.ts.map +1 -0
- package/dist/types/components/DocumentationDisplay.vue.d.ts +323 -0
- package/dist/types/components/DocumentationDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/DocumentationPageEmptyState.vue.d.ts +30 -0
- package/dist/types/components/DocumentationPageEmptyState.vue.d.ts.map +1 -0
- package/dist/types/components/ProductDocumentModal.vue.d.ts +71 -0
- package/dist/types/components/ProductDocumentModal.vue.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +6 -0
- package/dist/types/composables/index.d.ts.map +1 -0
- package/dist/types/composables/useI18n.d.ts +9 -0
- package/dist/types/composables/useI18n.d.ts.map +1 -0
- package/dist/types/external-links.d.ts +5 -0
- package/dist/types/external-links.d.ts.map +1 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/document-list.d.ts +28 -0
- package/dist/types/types/document-list.d.ts.map +1 -0
- package/dist/types/types/document-modal.d.ts +8 -0
- package/dist/types/types/document-modal.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/typescript-buWNZFwO-buWNZFwO.js +6 -0
- package/dist/v-wa8Orrdd-wa8Orrdd.js +6 -0
- package/dist/vb-E2_-jk4M-E2_-jk4M.js +6 -0
- package/dist/viml-B-zWOd7Z-B-zWOd7Z.js +6 -0
- package/dist/vue-DdqTpW8B-BrYVXV7A.js +31 -0
- package/dist/vue-html-B9t4RWro-D1UeMTSX.js +10 -0
- package/dist/wasm-Bv5f0gKv-Bv5f0gKv.js +6 -0
- package/dist/wgsl-DnPoPGDU-DnPoPGDU.js +6 -0
- package/dist/xml-ChBsf5uy-0Ovnixsj.js +8 -0
- package/dist/xsl-BefjlXrd-CZ7IlB9K.js +8 -0
- package/dist/xychartDiagram-6QU3TZC5-L2EgHpF7-Dbx9eZ7M.js +1304 -0
- package/dist/yaml-Bbg74JKr-Bbg74JKr.js +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
import { m as Q } from "./chunk-TMUBEWPD-C22TGOO0-Bl2u--DY.js";
|
|
2
|
+
import { e as X } from "./chunk-KFBOBJHC-BB675Bua-GRhe6aGs.js";
|
|
3
|
+
import { aB as Z, _ as $, g as tt, aC as rt, aD as et, aE as ot, l as w, a5 as nt, a6 as at, a7 as ct, a8 as it, al as st, am as dt, ab as k, ar as ht, af as mt, aq as $t, aF as lt } from "./index-B_RqyDIa.js";
|
|
4
|
+
import { D as gt } from "./mermaid-parser.core-DxgZuQQq-uP-grJig.js";
|
|
5
|
+
var x = {
|
|
6
|
+
NORMAL: 0,
|
|
7
|
+
REVERSE: 1,
|
|
8
|
+
HIGHLIGHT: 2,
|
|
9
|
+
MERGE: 3,
|
|
10
|
+
CHERRY_PICK: 4
|
|
11
|
+
}, yt = Z.gitGraph, O = /* @__PURE__ */ $(() => rt({
|
|
12
|
+
...yt,
|
|
13
|
+
...et().gitGraph
|
|
14
|
+
}), "getConfig"), s = new X(() => {
|
|
15
|
+
const r = O(), t = r.mainBranchName, e = r.mainBranchOrder;
|
|
16
|
+
return {
|
|
17
|
+
mainBranchName: t,
|
|
18
|
+
commits: /* @__PURE__ */ new Map(),
|
|
19
|
+
head: null,
|
|
20
|
+
branchConfig: /* @__PURE__ */ new Map([[t, { name: t, order: e }]]),
|
|
21
|
+
branches: /* @__PURE__ */ new Map([[t, null]]),
|
|
22
|
+
currBranch: t,
|
|
23
|
+
direction: "LR",
|
|
24
|
+
seq: 0,
|
|
25
|
+
options: {}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
function S() {
|
|
29
|
+
return ot({ length: 7 });
|
|
30
|
+
}
|
|
31
|
+
$(S, "getID");
|
|
32
|
+
function F(r, t) {
|
|
33
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
34
|
+
return r.reduce((a, c) => {
|
|
35
|
+
const i = t(c);
|
|
36
|
+
return e[i] || (e[i] = !0, a.push(c)), a;
|
|
37
|
+
}, []);
|
|
38
|
+
}
|
|
39
|
+
$(F, "uniqBy");
|
|
40
|
+
var pt = /* @__PURE__ */ $(function(r) {
|
|
41
|
+
s.records.direction = r;
|
|
42
|
+
}, "setDirection"), ft = /* @__PURE__ */ $(function(r) {
|
|
43
|
+
w.debug("options str", r), r = r == null ? void 0 : r.trim(), r = r || "{}";
|
|
44
|
+
try {
|
|
45
|
+
s.records.options = JSON.parse(r);
|
|
46
|
+
} catch (t) {
|
|
47
|
+
w.error("error while parsing gitGraph options", t.message);
|
|
48
|
+
}
|
|
49
|
+
}, "setOptions"), ut = /* @__PURE__ */ $(function() {
|
|
50
|
+
return s.records.options;
|
|
51
|
+
}, "getOptions"), xt = /* @__PURE__ */ $(function(r) {
|
|
52
|
+
let t = r.msg, e = r.id;
|
|
53
|
+
const a = r.type;
|
|
54
|
+
let c = r.tags;
|
|
55
|
+
w.info("commit", t, e, a, c), w.debug("Entering commit:", t, e, a, c);
|
|
56
|
+
const i = O();
|
|
57
|
+
e = k.sanitizeText(e, i), t = k.sanitizeText(t, i), c = c == null ? void 0 : c.map((d) => k.sanitizeText(d, i));
|
|
58
|
+
const h = {
|
|
59
|
+
id: e || s.records.seq + "-" + S(),
|
|
60
|
+
message: t,
|
|
61
|
+
seq: s.records.seq++,
|
|
62
|
+
type: a ?? x.NORMAL,
|
|
63
|
+
tags: c ?? [],
|
|
64
|
+
parents: s.records.head == null ? [] : [s.records.head.id],
|
|
65
|
+
branch: s.records.currBranch
|
|
66
|
+
};
|
|
67
|
+
s.records.head = h, w.info("main branch", i.mainBranchName), s.records.commits.set(h.id, h), s.records.branches.set(s.records.currBranch, h.id), w.debug("in pushCommit " + h.id);
|
|
68
|
+
}, "commit"), bt = /* @__PURE__ */ $(function(r) {
|
|
69
|
+
let t = r.name;
|
|
70
|
+
const e = r.order;
|
|
71
|
+
if (t = k.sanitizeText(t, O()), s.records.branches.has(t))
|
|
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 ${t}")`
|
|
74
|
+
);
|
|
75
|
+
s.records.branches.set(t, s.records.head != null ? s.records.head.id : null), s.records.branchConfig.set(t, { name: t, order: e }), K(t), w.debug("in createBranch");
|
|
76
|
+
}, "branch"), wt = /* @__PURE__ */ $((r) => {
|
|
77
|
+
let t = r.branch, e = r.id;
|
|
78
|
+
const a = r.type, c = r.tags, i = O();
|
|
79
|
+
t = k.sanitizeText(t, i), e && (e = k.sanitizeText(e, i));
|
|
80
|
+
const h = s.records.branches.get(s.records.currBranch), d = s.records.branches.get(t), l = h ? s.records.commits.get(h) : void 0, o = d ? s.records.commits.get(d) : void 0;
|
|
81
|
+
if (l && o && l.branch === t)
|
|
82
|
+
throw new Error(`Cannot merge branch '${t}' into itself.`);
|
|
83
|
+
if (s.records.currBranch === t) {
|
|
84
|
+
const m = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
|
|
85
|
+
throw m.hash = {
|
|
86
|
+
text: `merge ${t}`,
|
|
87
|
+
token: `merge ${t}`,
|
|
88
|
+
expected: ["branch abc"]
|
|
89
|
+
}, m;
|
|
90
|
+
}
|
|
91
|
+
if (l === void 0 || !l) {
|
|
92
|
+
const m = new Error(
|
|
93
|
+
`Incorrect usage of "merge". Current branch (${s.records.currBranch})has no commits`
|
|
94
|
+
);
|
|
95
|
+
throw m.hash = {
|
|
96
|
+
text: `merge ${t}`,
|
|
97
|
+
token: `merge ${t}`,
|
|
98
|
+
expected: ["commit"]
|
|
99
|
+
}, m;
|
|
100
|
+
}
|
|
101
|
+
if (!s.records.branches.has(t)) {
|
|
102
|
+
const m = new Error(
|
|
103
|
+
'Incorrect usage of "merge". Branch to be merged (' + t + ") does not exist"
|
|
104
|
+
);
|
|
105
|
+
throw m.hash = {
|
|
106
|
+
text: `merge ${t}`,
|
|
107
|
+
token: `merge ${t}`,
|
|
108
|
+
expected: [`branch ${t}`]
|
|
109
|
+
}, m;
|
|
110
|
+
}
|
|
111
|
+
if (o === void 0 || !o) {
|
|
112
|
+
const m = new Error(
|
|
113
|
+
'Incorrect usage of "merge". Branch to be merged (' + t + ") has no commits"
|
|
114
|
+
);
|
|
115
|
+
throw m.hash = {
|
|
116
|
+
text: `merge ${t}`,
|
|
117
|
+
token: `merge ${t}`,
|
|
118
|
+
expected: ['"commit"']
|
|
119
|
+
}, m;
|
|
120
|
+
}
|
|
121
|
+
if (l === o) {
|
|
122
|
+
const m = new Error('Incorrect usage of "merge". Both branches have same head');
|
|
123
|
+
throw m.hash = {
|
|
124
|
+
text: `merge ${t}`,
|
|
125
|
+
token: `merge ${t}`,
|
|
126
|
+
expected: ["branch abc"]
|
|
127
|
+
}, m;
|
|
128
|
+
}
|
|
129
|
+
if (e && s.records.commits.has(e)) {
|
|
130
|
+
const m = new Error(
|
|
131
|
+
'Incorrect usage of "merge". Commit with id:' + e + " already exists, use different custom Id"
|
|
132
|
+
);
|
|
133
|
+
throw m.hash = {
|
|
134
|
+
text: `merge ${t} ${e} ${a} ${c == null ? void 0 : c.join(" ")}`,
|
|
135
|
+
token: `merge ${t} ${e} ${a} ${c == null ? void 0 : c.join(" ")}`,
|
|
136
|
+
expected: [
|
|
137
|
+
`merge ${t} ${e}_UNIQUE ${a} ${c == null ? void 0 : c.join(" ")}`
|
|
138
|
+
]
|
|
139
|
+
}, m;
|
|
140
|
+
}
|
|
141
|
+
const n = d || "", u = {
|
|
142
|
+
id: e || `${s.records.seq}-${S()}`,
|
|
143
|
+
message: `merged branch ${t} into ${s.records.currBranch}`,
|
|
144
|
+
seq: s.records.seq++,
|
|
145
|
+
parents: s.records.head == null ? [] : [s.records.head.id, n],
|
|
146
|
+
branch: s.records.currBranch,
|
|
147
|
+
type: x.MERGE,
|
|
148
|
+
customType: a,
|
|
149
|
+
customId: !!e,
|
|
150
|
+
tags: c ?? []
|
|
151
|
+
};
|
|
152
|
+
s.records.head = u, s.records.commits.set(u.id, u), s.records.branches.set(s.records.currBranch, u.id), w.debug(s.records.branches), w.debug("in mergeBranch");
|
|
153
|
+
}, "merge"), Bt = /* @__PURE__ */ $(function(r) {
|
|
154
|
+
let t = r.id, e = r.targetId, a = r.tags, c = r.parent;
|
|
155
|
+
w.debug("Entering cherryPick:", t, e, a);
|
|
156
|
+
const i = O();
|
|
157
|
+
if (t = k.sanitizeText(t, i), e = k.sanitizeText(e, i), a = a == null ? void 0 : a.map((l) => k.sanitizeText(l, i)), c = k.sanitizeText(c, i), !t || !s.records.commits.has(t)) {
|
|
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 ${t} ${e}`,
|
|
163
|
+
token: `cherryPick ${t} ${e}`,
|
|
164
|
+
expected: ["cherry-pick abc"]
|
|
165
|
+
}, l;
|
|
166
|
+
}
|
|
167
|
+
const h = s.records.commits.get(t);
|
|
168
|
+
if (h === void 0 || !h)
|
|
169
|
+
throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
|
|
170
|
+
if (c && !(Array.isArray(h.parents) && h.parents.includes(c)))
|
|
171
|
+
throw new Error(
|
|
172
|
+
"Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
|
|
173
|
+
);
|
|
174
|
+
const d = h.branch;
|
|
175
|
+
if (h.type === x.MERGE && !c)
|
|
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 (!e || !s.records.commits.has(e)) {
|
|
180
|
+
if (d === s.records.currBranch) {
|
|
181
|
+
const u = new Error(
|
|
182
|
+
'Incorrect usage of "cherryPick". Source commit is already on current branch'
|
|
183
|
+
);
|
|
184
|
+
throw u.hash = {
|
|
185
|
+
text: `cherryPick ${t} ${e}`,
|
|
186
|
+
token: `cherryPick ${t} ${e}`,
|
|
187
|
+
expected: ["cherry-pick abc"]
|
|
188
|
+
}, u;
|
|
189
|
+
}
|
|
190
|
+
const l = s.records.branches.get(s.records.currBranch);
|
|
191
|
+
if (l === void 0 || !l) {
|
|
192
|
+
const u = new Error(
|
|
193
|
+
`Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`
|
|
194
|
+
);
|
|
195
|
+
throw u.hash = {
|
|
196
|
+
text: `cherryPick ${t} ${e}`,
|
|
197
|
+
token: `cherryPick ${t} ${e}`,
|
|
198
|
+
expected: ["cherry-pick abc"]
|
|
199
|
+
}, u;
|
|
200
|
+
}
|
|
201
|
+
const o = s.records.commits.get(l);
|
|
202
|
+
if (o === void 0 || !o) {
|
|
203
|
+
const u = new Error(
|
|
204
|
+
`Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`
|
|
205
|
+
);
|
|
206
|
+
throw u.hash = {
|
|
207
|
+
text: `cherryPick ${t} ${e}`,
|
|
208
|
+
token: `cherryPick ${t} ${e}`,
|
|
209
|
+
expected: ["cherry-pick abc"]
|
|
210
|
+
}, u;
|
|
211
|
+
}
|
|
212
|
+
const n = {
|
|
213
|
+
id: s.records.seq + "-" + S(),
|
|
214
|
+
message: `cherry-picked ${h == null ? void 0 : h.message} into ${s.records.currBranch}`,
|
|
215
|
+
seq: s.records.seq++,
|
|
216
|
+
parents: s.records.head == null ? [] : [s.records.head.id, h.id],
|
|
217
|
+
branch: s.records.currBranch,
|
|
218
|
+
type: x.CHERRY_PICK,
|
|
219
|
+
tags: a ? a.filter(Boolean) : [
|
|
220
|
+
`cherry-pick:${h.id}${h.type === x.MERGE ? `|parent:${c}` : ""}`
|
|
221
|
+
]
|
|
222
|
+
};
|
|
223
|
+
s.records.head = n, s.records.commits.set(n.id, n), s.records.branches.set(s.records.currBranch, n.id), w.debug(s.records.branches), w.debug("in cherryPick");
|
|
224
|
+
}
|
|
225
|
+
}, "cherryPick"), K = /* @__PURE__ */ $(function(r) {
|
|
226
|
+
if (r = k.sanitizeText(r, O()), s.records.branches.has(r)) {
|
|
227
|
+
s.records.currBranch = r;
|
|
228
|
+
const t = s.records.branches.get(s.records.currBranch);
|
|
229
|
+
t === void 0 || !t ? s.records.head = null : s.records.head = s.records.commits.get(t) ?? null;
|
|
230
|
+
} else {
|
|
231
|
+
const t = new Error(
|
|
232
|
+
`Trying to checkout branch which is not yet created. (Help try using "branch ${r}")`
|
|
233
|
+
);
|
|
234
|
+
throw t.hash = {
|
|
235
|
+
text: `checkout ${r}`,
|
|
236
|
+
token: `checkout ${r}`,
|
|
237
|
+
expected: [`branch ${r}`]
|
|
238
|
+
}, t;
|
|
239
|
+
}
|
|
240
|
+
}, "checkout");
|
|
241
|
+
function N(r, t, e) {
|
|
242
|
+
const a = r.indexOf(t);
|
|
243
|
+
a === -1 ? r.push(e) : r.splice(a, 1, e);
|
|
244
|
+
}
|
|
245
|
+
$(N, "upsert");
|
|
246
|
+
function _(r) {
|
|
247
|
+
const t = r.reduce((c, i) => c.seq > i.seq ? c : i, r[0]);
|
|
248
|
+
let e = "";
|
|
249
|
+
r.forEach(function(c) {
|
|
250
|
+
c === t ? e += " *" : e += " |";
|
|
251
|
+
});
|
|
252
|
+
const a = [e, t.id, t.seq];
|
|
253
|
+
for (const c in s.records.branches)
|
|
254
|
+
s.records.branches.get(c) === t.id && a.push(c);
|
|
255
|
+
if (w.debug(a.join(" ")), t.parents && t.parents.length == 2 && t.parents[0] && t.parents[1]) {
|
|
256
|
+
const c = s.records.commits.get(t.parents[0]);
|
|
257
|
+
N(r, t, c), t.parents[1] && r.push(s.records.commits.get(t.parents[1]));
|
|
258
|
+
} else {
|
|
259
|
+
if (t.parents.length == 0)
|
|
260
|
+
return;
|
|
261
|
+
if (t.parents[0]) {
|
|
262
|
+
const c = s.records.commits.get(t.parents[0]);
|
|
263
|
+
N(r, t, c);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
r = F(r, (c) => c.id), _(r);
|
|
267
|
+
}
|
|
268
|
+
$(_, "prettyPrintCommitHistory");
|
|
269
|
+
var Et = /* @__PURE__ */ $(function() {
|
|
270
|
+
w.debug(s.records.commits);
|
|
271
|
+
const r = Y()[0];
|
|
272
|
+
_([r]);
|
|
273
|
+
}, "prettyPrint"), vt = /* @__PURE__ */ $(function() {
|
|
274
|
+
s.reset(), ht();
|
|
275
|
+
}, "clear"), Ct = /* @__PURE__ */ $(function() {
|
|
276
|
+
return [...s.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"), kt = /* @__PURE__ */ $(function() {
|
|
281
|
+
return s.records.branches;
|
|
282
|
+
}, "getBranches"), Tt = /* @__PURE__ */ $(function() {
|
|
283
|
+
return s.records.commits;
|
|
284
|
+
}, "getCommits"), Y = /* @__PURE__ */ $(function() {
|
|
285
|
+
const r = [...s.records.commits.values()];
|
|
286
|
+
return r.forEach(function(t) {
|
|
287
|
+
w.debug(t.id);
|
|
288
|
+
}), r.sort((t, e) => t.seq - e.seq), r;
|
|
289
|
+
}, "getCommitsArray"), Lt = /* @__PURE__ */ $(function() {
|
|
290
|
+
return s.records.currBranch;
|
|
291
|
+
}, "getCurrentBranch"), Mt = /* @__PURE__ */ $(function() {
|
|
292
|
+
return s.records.direction;
|
|
293
|
+
}, "getDirection"), Pt = /* @__PURE__ */ $(function() {
|
|
294
|
+
return s.records.head;
|
|
295
|
+
}, "getHead"), V = {
|
|
296
|
+
commitType: x,
|
|
297
|
+
getConfig: O,
|
|
298
|
+
setDirection: pt,
|
|
299
|
+
setOptions: ft,
|
|
300
|
+
getOptions: ut,
|
|
301
|
+
commit: xt,
|
|
302
|
+
branch: bt,
|
|
303
|
+
merge: wt,
|
|
304
|
+
cherryPick: Bt,
|
|
305
|
+
checkout: K,
|
|
306
|
+
//reset,
|
|
307
|
+
prettyPrint: Et,
|
|
308
|
+
clear: vt,
|
|
309
|
+
getBranchesAsObjArray: Ct,
|
|
310
|
+
getBranches: kt,
|
|
311
|
+
getCommits: Tt,
|
|
312
|
+
getCommitsArray: Y,
|
|
313
|
+
getCurrentBranch: Lt,
|
|
314
|
+
getDirection: Mt,
|
|
315
|
+
getHead: Pt,
|
|
316
|
+
setAccTitle: nt,
|
|
317
|
+
getAccTitle: at,
|
|
318
|
+
getAccDescription: ct,
|
|
319
|
+
setAccDescription: it,
|
|
320
|
+
setDiagramTitle: st,
|
|
321
|
+
getDiagramTitle: dt
|
|
322
|
+
}, Rt = /* @__PURE__ */ $((r, t) => {
|
|
323
|
+
Q(r, t), r.dir && t.setDirection(r.dir);
|
|
324
|
+
for (const e of r.statements)
|
|
325
|
+
At(e, t);
|
|
326
|
+
}, "populate"), At = /* @__PURE__ */ $((r, t) => {
|
|
327
|
+
const e = {
|
|
328
|
+
Commit: /* @__PURE__ */ $((a) => t.commit(It(a)), "Commit"),
|
|
329
|
+
Branch: /* @__PURE__ */ $((a) => t.branch(Gt(a)), "Branch"),
|
|
330
|
+
Merge: /* @__PURE__ */ $((a) => t.merge(Ot(a)), "Merge"),
|
|
331
|
+
Checkout: /* @__PURE__ */ $((a) => t.checkout(qt(a)), "Checkout"),
|
|
332
|
+
CherryPicking: /* @__PURE__ */ $((a) => t.cherryPick(Dt(a)), "CherryPicking")
|
|
333
|
+
}[r.$type];
|
|
334
|
+
e ? e(r) : w.error(`Unknown statement type: ${r.$type}`);
|
|
335
|
+
}, "parseStatement"), It = /* @__PURE__ */ $((r) => ({
|
|
336
|
+
id: r.id,
|
|
337
|
+
msg: r.message ?? "",
|
|
338
|
+
type: r.type !== void 0 ? x[r.type] : x.NORMAL,
|
|
339
|
+
tags: r.tags ?? void 0
|
|
340
|
+
}), "parseCommit"), Gt = /* @__PURE__ */ $((r) => ({
|
|
341
|
+
name: r.name,
|
|
342
|
+
order: r.order ?? 0
|
|
343
|
+
}), "parseBranch"), Ot = /* @__PURE__ */ $((r) => ({
|
|
344
|
+
branch: r.branch,
|
|
345
|
+
id: r.id ?? "",
|
|
346
|
+
type: r.type !== void 0 ? x[r.type] : void 0,
|
|
347
|
+
tags: r.tags ?? void 0
|
|
348
|
+
}), "parseMerge"), qt = /* @__PURE__ */ $((r) => r.branch, "parseCheckout"), Dt = /* @__PURE__ */ $((r) => {
|
|
349
|
+
var t;
|
|
350
|
+
return {
|
|
351
|
+
id: r.id,
|
|
352
|
+
targetId: "",
|
|
353
|
+
tags: ((t = r.tags) == null ? void 0 : t.length) === 0 ? void 0 : r.tags,
|
|
354
|
+
parent: r.parent
|
|
355
|
+
};
|
|
356
|
+
}, "parseCherryPicking"), Ht = {
|
|
357
|
+
parse: /* @__PURE__ */ $(async (r) => {
|
|
358
|
+
const t = await gt("gitGraph", r);
|
|
359
|
+
w.debug(t), Rt(t, V);
|
|
360
|
+
}, "parse")
|
|
361
|
+
}, W = tt(), E = W == null ? void 0 : W.gitGraph, A = 10, I = 40, T = 4, M = 2, G = 8, v = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), H = 30, q = /* @__PURE__ */ new Map(), z = [], R = 0, f = "LR", zt = /* @__PURE__ */ $(() => {
|
|
362
|
+
v.clear(), C.clear(), q.clear(), R = 0, z = [], f = "LR";
|
|
363
|
+
}, "clear"), U = /* @__PURE__ */ $((r) => {
|
|
364
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
365
|
+
return (typeof r == "string" ? r.split(/\\n|\n|<br\s*\/?>/gi) : r).forEach((e) => {
|
|
366
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
367
|
+
a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), a.setAttribute("dy", "1em"), a.setAttribute("x", "0"), a.setAttribute("class", "row"), a.textContent = e.trim(), t.appendChild(a);
|
|
368
|
+
}), t;
|
|
369
|
+
}, "drawText"), J = /* @__PURE__ */ $((r) => {
|
|
370
|
+
let t, e, a;
|
|
371
|
+
return f === "BT" ? (e = /* @__PURE__ */ $((c, i) => c <= i, "comparisonFunc"), a = 1 / 0) : (e = /* @__PURE__ */ $((c, i) => c >= i, "comparisonFunc"), a = 0), r.forEach((c) => {
|
|
372
|
+
var i, h;
|
|
373
|
+
const d = f === "TB" || f == "BT" ? (i = C.get(c)) == null ? void 0 : i.y : (h = C.get(c)) == null ? void 0 : h.x;
|
|
374
|
+
d !== void 0 && e(d, a) && (t = c, a = d);
|
|
375
|
+
}), t;
|
|
376
|
+
}, "findClosestParent"), St = /* @__PURE__ */ $((r) => {
|
|
377
|
+
let t = "", e = 1 / 0;
|
|
378
|
+
return r.forEach((a) => {
|
|
379
|
+
const c = C.get(a).y;
|
|
380
|
+
c <= e && (t = a, e = c);
|
|
381
|
+
}), t || void 0;
|
|
382
|
+
}, "findClosestParentBT"), Nt = /* @__PURE__ */ $((r, t, e) => {
|
|
383
|
+
let a = e, c = e;
|
|
384
|
+
const i = [];
|
|
385
|
+
r.forEach((h) => {
|
|
386
|
+
const d = t.get(h);
|
|
387
|
+
if (!d)
|
|
388
|
+
throw new Error(`Commit not found for key ${h}`);
|
|
389
|
+
d.parents.length ? (a = Wt(d), c = Math.max(a, c)) : i.push(d), jt(d, a);
|
|
390
|
+
}), a = c, i.forEach((h) => {
|
|
391
|
+
Ft(h, a, e);
|
|
392
|
+
}), r.forEach((h) => {
|
|
393
|
+
const d = t.get(h);
|
|
394
|
+
if (d != null && d.parents.length) {
|
|
395
|
+
const l = St(d.parents);
|
|
396
|
+
a = C.get(l).y - I, a <= c && (c = a);
|
|
397
|
+
const o = v.get(d.branch).pos, n = a - A;
|
|
398
|
+
C.set(d.id, { x: o, y: n });
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}, "setParallelBTPos"), _t = /* @__PURE__ */ $((r) => {
|
|
402
|
+
var t;
|
|
403
|
+
const e = J(r.parents.filter((c) => c !== null));
|
|
404
|
+
if (!e)
|
|
405
|
+
throw new Error(`Closest parent not found for commit ${r.id}`);
|
|
406
|
+
const a = (t = C.get(e)) == null ? void 0 : t.y;
|
|
407
|
+
if (a === void 0)
|
|
408
|
+
throw new Error(`Closest parent position not found for commit ${r.id}`);
|
|
409
|
+
return a;
|
|
410
|
+
}, "findClosestParentPos"), Wt = /* @__PURE__ */ $((r) => _t(r) + I, "calculateCommitPosition"), jt = /* @__PURE__ */ $((r, t) => {
|
|
411
|
+
const e = v.get(r.branch);
|
|
412
|
+
if (!e)
|
|
413
|
+
throw new Error(`Branch not found for commit ${r.id}`);
|
|
414
|
+
const a = e.pos, c = t + A;
|
|
415
|
+
return C.set(r.id, { x: a, y: c }), { x: a, y: c };
|
|
416
|
+
}, "setCommitPosition"), Ft = /* @__PURE__ */ $((r, t, e) => {
|
|
417
|
+
const a = v.get(r.branch);
|
|
418
|
+
if (!a)
|
|
419
|
+
throw new Error(`Branch not found for commit ${r.id}`);
|
|
420
|
+
const c = t + e, i = a.pos;
|
|
421
|
+
C.set(r.id, { x: i, y: c });
|
|
422
|
+
}, "setRootPosition"), Kt = /* @__PURE__ */ $((r, t, e, a, c, i) => {
|
|
423
|
+
if (i === x.HIGHLIGHT)
|
|
424
|
+
r.append("rect").attr("x", e.x - 10).attr("y", e.y - 10).attr("width", 20).attr("height", 20).attr(
|
|
425
|
+
"class",
|
|
426
|
+
`commit ${t.id} commit-highlight${c % G} ${a}-outer`
|
|
427
|
+
), r.append("rect").attr("x", e.x - 6).attr("y", e.y - 6).attr("width", 12).attr("height", 12).attr(
|
|
428
|
+
"class",
|
|
429
|
+
`commit ${t.id} commit${c % G} ${a}-inner`
|
|
430
|
+
);
|
|
431
|
+
else if (i === x.CHERRY_PICK)
|
|
432
|
+
r.append("circle").attr("cx", e.x).attr("cy", e.y).attr("r", 10).attr("class", `commit ${t.id} ${a}`), r.append("circle").attr("cx", e.x - 3).attr("cy", e.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${a}`), r.append("circle").attr("cx", e.x + 3).attr("cy", e.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${a}`), r.append("line").attr("x1", e.x + 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", "#fff").attr("class", `commit ${t.id} ${a}`), r.append("line").attr("x1", e.x - 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", "#fff").attr("class", `commit ${t.id} ${a}`);
|
|
433
|
+
else {
|
|
434
|
+
const h = r.append("circle");
|
|
435
|
+
if (h.attr("cx", e.x), h.attr("cy", e.y), h.attr("r", t.type === x.MERGE ? 9 : 10), h.attr("class", `commit ${t.id} commit${c % G}`), i === x.MERGE) {
|
|
436
|
+
const d = r.append("circle");
|
|
437
|
+
d.attr("cx", e.x), d.attr("cy", e.y), d.attr("r", 6), d.attr(
|
|
438
|
+
"class",
|
|
439
|
+
`commit ${a} ${t.id} commit${c % G}`
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
i === x.REVERSE && r.append("path").attr(
|
|
443
|
+
"d",
|
|
444
|
+
`M ${e.x - 5},${e.y - 5}L${e.x + 5},${e.y + 5}M${e.x - 5},${e.y + 5}L${e.x + 5},${e.y - 5}`
|
|
445
|
+
).attr("class", `commit ${a} ${t.id} commit${c % G}`);
|
|
446
|
+
}
|
|
447
|
+
}, "drawCommitBullet"), Yt = /* @__PURE__ */ $((r, t, e, a) => {
|
|
448
|
+
var c;
|
|
449
|
+
if (t.type !== x.CHERRY_PICK && (t.customId && t.type === x.MERGE || t.type !== x.MERGE) && E != null && E.showCommitLabel) {
|
|
450
|
+
const i = r.append("g"), h = i.insert("rect").attr("class", "commit-label-bkg"), d = i.append("text").attr("x", a).attr("y", e.y + 25).attr("class", "commit-label").text(t.id), l = (c = d.node()) == null ? void 0 : c.getBBox();
|
|
451
|
+
if (l && (h.attr("x", e.posWithOffset - l.width / 2 - M).attr("y", e.y + 13.5).attr("width", l.width + 2 * M).attr("height", l.height + 2 * M), f === "TB" || f === "BT" ? (h.attr("x", e.x - (l.width + 4 * T + 5)).attr("y", e.y - 12), d.attr("x", e.x - (l.width + 4 * T)).attr("y", e.y + l.height - 12)) : d.attr("x", e.posWithOffset - l.width / 2), E.rotateCommitLabel))
|
|
452
|
+
if (f === "TB" || f === "BT")
|
|
453
|
+
d.attr(
|
|
454
|
+
"transform",
|
|
455
|
+
"rotate(-45, " + e.x + ", " + e.y + ")"
|
|
456
|
+
), h.attr(
|
|
457
|
+
"transform",
|
|
458
|
+
"rotate(-45, " + e.x + ", " + e.y + ")"
|
|
459
|
+
);
|
|
460
|
+
else {
|
|
461
|
+
const o = -7.5 - (l.width + 10) / 25 * 9.5, n = 10 + l.width / 25 * 8.5;
|
|
462
|
+
i.attr(
|
|
463
|
+
"transform",
|
|
464
|
+
"translate(" + o + ", " + n + ") rotate(-45, " + a + ", " + e.y + ")"
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}, "drawCommitLabel"), Vt = /* @__PURE__ */ $((r, t, e, a) => {
|
|
469
|
+
var c;
|
|
470
|
+
if (t.tags.length > 0) {
|
|
471
|
+
let i = 0, h = 0, d = 0;
|
|
472
|
+
const l = [];
|
|
473
|
+
for (const o of t.tags.reverse()) {
|
|
474
|
+
const n = r.insert("polygon"), u = r.append("circle"), m = r.append("text").attr("y", e.y - 16 - i).attr("class", "tag-label").text(o), g = (c = m.node()) == null ? void 0 : c.getBBox();
|
|
475
|
+
if (!g)
|
|
476
|
+
throw new Error("Tag bbox not found");
|
|
477
|
+
h = Math.max(h, g.width), d = Math.max(d, g.height), m.attr("x", e.posWithOffset - g.width / 2), l.push({
|
|
478
|
+
tag: m,
|
|
479
|
+
hole: u,
|
|
480
|
+
rect: n,
|
|
481
|
+
yOffset: i
|
|
482
|
+
}), i += 20;
|
|
483
|
+
}
|
|
484
|
+
for (const { tag: o, hole: n, rect: u, yOffset: m } of l) {
|
|
485
|
+
const g = d / 2, p = e.y - 19.2 - m;
|
|
486
|
+
if (u.attr("class", "tag-label-bkg").attr(
|
|
487
|
+
"points",
|
|
488
|
+
`
|
|
489
|
+
${a - h / 2 - T / 2},${p + M}
|
|
490
|
+
${a - h / 2 - T / 2},${p - M}
|
|
491
|
+
${e.posWithOffset - h / 2 - T},${p - g - M}
|
|
492
|
+
${e.posWithOffset + h / 2 + T},${p - g - M}
|
|
493
|
+
${e.posWithOffset + h / 2 + T},${p + g + M}
|
|
494
|
+
${e.posWithOffset - h / 2 - T},${p + g + M}`
|
|
495
|
+
), n.attr("cy", p).attr("cx", a - h / 2 + T / 2).attr("r", 1.5).attr("class", "tag-hole"), f === "TB" || f === "BT") {
|
|
496
|
+
const y = a + m;
|
|
497
|
+
u.attr("class", "tag-label-bkg").attr(
|
|
498
|
+
"points",
|
|
499
|
+
`
|
|
500
|
+
${e.x},${y + 2}
|
|
501
|
+
${e.x},${y - 2}
|
|
502
|
+
${e.x + A},${y - g - 2}
|
|
503
|
+
${e.x + A + h + 4},${y - g - 2}
|
|
504
|
+
${e.x + A + h + 4},${y + g + 2}
|
|
505
|
+
${e.x + A},${y + g + 2}`
|
|
506
|
+
).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + a + ")"), n.attr("cx", e.x + T / 2).attr("cy", y).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + a + ")"), o.attr("x", e.x + 5).attr("y", y + 3).attr("transform", "translate(14,14) rotate(45, " + e.x + "," + a + ")");
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}, "drawCommitTags"), Ut = /* @__PURE__ */ $((r) => {
|
|
511
|
+
switch (r.customType ?? r.type) {
|
|
512
|
+
case x.NORMAL:
|
|
513
|
+
return "commit-normal";
|
|
514
|
+
case x.REVERSE:
|
|
515
|
+
return "commit-reverse";
|
|
516
|
+
case x.HIGHLIGHT:
|
|
517
|
+
return "commit-highlight";
|
|
518
|
+
case x.MERGE:
|
|
519
|
+
return "commit-merge";
|
|
520
|
+
case x.CHERRY_PICK:
|
|
521
|
+
return "commit-cherry-pick";
|
|
522
|
+
default:
|
|
523
|
+
return "commit-normal";
|
|
524
|
+
}
|
|
525
|
+
}, "getCommitClassType"), Jt = /* @__PURE__ */ $((r, t, e, a) => {
|
|
526
|
+
const c = { x: 0, y: 0 };
|
|
527
|
+
if (r.parents.length > 0) {
|
|
528
|
+
const i = J(r.parents);
|
|
529
|
+
if (i) {
|
|
530
|
+
const h = a.get(i) ?? c;
|
|
531
|
+
return t === "TB" ? h.y + I : t === "BT" ? (a.get(r.id) ?? c).y - I : h.x + I;
|
|
532
|
+
}
|
|
533
|
+
} else
|
|
534
|
+
return t === "TB" ? H : t === "BT" ? (a.get(r.id) ?? c).y - I : 0;
|
|
535
|
+
return 0;
|
|
536
|
+
}, "calculatePosition"), Qt = /* @__PURE__ */ $((r, t, e) => {
|
|
537
|
+
var a, c;
|
|
538
|
+
const i = f === "BT" && e ? t : t + A, h = f === "TB" || f === "BT" ? i : (a = v.get(r.branch)) == null ? void 0 : a.pos, d = f === "TB" || f === "BT" ? (c = v.get(r.branch)) == null ? void 0 : c.pos : i;
|
|
539
|
+
if (d === void 0 || h === void 0)
|
|
540
|
+
throw new Error(`Position were undefined for commit ${r.id}`);
|
|
541
|
+
return { x: d, y: h, posWithOffset: i };
|
|
542
|
+
}, "getCommitPosition"), j = /* @__PURE__ */ $((r, t, e) => {
|
|
543
|
+
if (!E)
|
|
544
|
+
throw new Error("GitGraph config not found");
|
|
545
|
+
const a = r.append("g").attr("class", "commit-bullets"), c = r.append("g").attr("class", "commit-labels");
|
|
546
|
+
let i = f === "TB" || f === "BT" ? H : 0;
|
|
547
|
+
const h = [...t.keys()], d = (E == null ? void 0 : E.parallelCommits) ?? !1, l = /* @__PURE__ */ $((n, u) => {
|
|
548
|
+
var m, g;
|
|
549
|
+
const p = (m = t.get(n)) == null ? void 0 : m.seq, y = (g = t.get(u)) == null ? void 0 : g.seq;
|
|
550
|
+
return p !== void 0 && y !== void 0 ? p - y : 0;
|
|
551
|
+
}, "sortKeys");
|
|
552
|
+
let o = h.sort(l);
|
|
553
|
+
f === "BT" && (d && Nt(o, t, i), o = o.reverse()), o.forEach((n) => {
|
|
554
|
+
var u;
|
|
555
|
+
const m = t.get(n);
|
|
556
|
+
if (!m)
|
|
557
|
+
throw new Error(`Commit not found for key ${n}`);
|
|
558
|
+
d && (i = Jt(m, f, i, C));
|
|
559
|
+
const g = Qt(m, i, d);
|
|
560
|
+
if (e) {
|
|
561
|
+
const p = Ut(m), y = m.customType ?? m.type, L = ((u = v.get(m.branch)) == null ? void 0 : u.index) ?? 0;
|
|
562
|
+
Kt(a, m, g, p, L, y), Yt(c, m, g, i), Vt(c, m, g, i);
|
|
563
|
+
}
|
|
564
|
+
f === "TB" || f === "BT" ? C.set(m.id, { x: g.x, y: g.posWithOffset }) : C.set(m.id, { x: g.posWithOffset, y: g.y }), i = f === "BT" && d ? i + I : i + I + A, i > R && (R = i);
|
|
565
|
+
});
|
|
566
|
+
}, "drawCommits"), Xt = /* @__PURE__ */ $((r, t, e, a, c) => {
|
|
567
|
+
const i = (f === "TB" || f === "BT" ? e.x < a.x : e.y < a.y) ? t.branch : r.branch, h = /* @__PURE__ */ $((l) => l.branch === i, "isOnBranchToGetCurve"), d = /* @__PURE__ */ $((l) => l.seq > r.seq && l.seq < t.seq, "isBetweenCommits");
|
|
568
|
+
return [...c.values()].some((l) => d(l) && h(l));
|
|
569
|
+
}, "shouldRerouteArrow"), D = /* @__PURE__ */ $((r, t, e = 0) => {
|
|
570
|
+
const a = r + Math.abs(r - t) / 2;
|
|
571
|
+
if (e > 5)
|
|
572
|
+
return a;
|
|
573
|
+
if (z.every((i) => Math.abs(i - a) >= 10))
|
|
574
|
+
return z.push(a), a;
|
|
575
|
+
const c = Math.abs(r - t);
|
|
576
|
+
return D(r, t - c / 5, e + 1);
|
|
577
|
+
}, "findLane"), Zt = /* @__PURE__ */ $((r, t, e, a) => {
|
|
578
|
+
var c, i, h, d, l;
|
|
579
|
+
const o = C.get(t.id), n = C.get(e.id);
|
|
580
|
+
if (o === void 0 || n === void 0)
|
|
581
|
+
throw new Error(`Commit positions not found for commits ${t.id} and ${e.id}`);
|
|
582
|
+
const u = Xt(t, e, o, n, a);
|
|
583
|
+
let m = "", g = "", p = 0, y = 0, L = (c = v.get(e.branch)) == null ? void 0 : c.index;
|
|
584
|
+
e.type === x.MERGE && t.id !== e.parents[0] && (L = (i = v.get(t.branch)) == null ? void 0 : i.index);
|
|
585
|
+
let b;
|
|
586
|
+
if (u) {
|
|
587
|
+
m = "A 10 10, 0, 0, 0,", g = "A 10 10, 0, 0, 1,", p = 10, y = 10;
|
|
588
|
+
const P = o.y < n.y ? D(o.y, n.y) : D(n.y, o.y), B = o.x < n.x ? D(o.x, n.x) : D(n.x, o.x);
|
|
589
|
+
f === "TB" ? o.x < n.x ? b = `M ${o.x} ${o.y} L ${B - p} ${o.y} ${g} ${B} ${o.y + y} L ${B} ${n.y - p} ${m} ${B + y} ${n.y} L ${n.x} ${n.y}` : (L = (h = v.get(t.branch)) == null ? void 0 : h.index, b = `M ${o.x} ${o.y} L ${B + p} ${o.y} ${m} ${B} ${o.y + y} L ${B} ${n.y - p} ${g} ${B - y} ${n.y} L ${n.x} ${n.y}`) : f === "BT" ? o.x < n.x ? b = `M ${o.x} ${o.y} L ${B - p} ${o.y} ${m} ${B} ${o.y - y} L ${B} ${n.y + p} ${g} ${B + y} ${n.y} L ${n.x} ${n.y}` : (L = (d = v.get(t.branch)) == null ? void 0 : d.index, b = `M ${o.x} ${o.y} L ${B + p} ${o.y} ${g} ${B} ${o.y - y} L ${B} ${n.y + p} ${m} ${B - y} ${n.y} L ${n.x} ${n.y}`) : o.y < n.y ? b = `M ${o.x} ${o.y} L ${o.x} ${P - p} ${m} ${o.x + y} ${P} L ${n.x - p} ${P} ${g} ${n.x} ${P + y} L ${n.x} ${n.y}` : (L = (l = v.get(t.branch)) == null ? void 0 : l.index, b = `M ${o.x} ${o.y} L ${o.x} ${P + p} ${g} ${o.x + y} ${P} L ${n.x - p} ${P} ${m} ${n.x} ${P - y} L ${n.x} ${n.y}`);
|
|
590
|
+
} else
|
|
591
|
+
m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", p = 20, y = 20, f === "TB" ? (o.x < n.x && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y - p} ${m} ${o.x + y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${g} ${n.x} ${o.y + y} L ${n.x} ${n.y}`), o.x > n.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", p = 20, y = 20, e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y - p} ${g} ${o.x - y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x + p} ${o.y} ${m} ${n.x} ${o.y + y} L ${n.x} ${n.y}`), o.x === n.x && (b = `M ${o.x} ${o.y} L ${n.x} ${n.y}`)) : f === "BT" ? (o.x < n.x && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y + p} ${g} ${o.x + y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${m} ${n.x} ${o.y - y} L ${n.x} ${n.y}`), o.x > n.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", p = 20, y = 20, e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y + p} ${m} ${o.x - y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${m} ${n.x} ${o.y - y} L ${n.x} ${n.y}`), o.x === n.x && (b = `M ${o.x} ${o.y} L ${n.x} ${n.y}`)) : (o.y < n.y && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${g} ${n.x} ${o.y + y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${o.x} ${n.y - p} ${m} ${o.x + y} ${n.y} L ${n.x} ${n.y}`), o.y > n.y && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${m} ${n.x} ${o.y - y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${o.x} ${n.y + p} ${g} ${o.x + y} ${n.y} L ${n.x} ${n.y}`), o.y === n.y && (b = `M ${o.x} ${o.y} L ${n.x} ${n.y}`));
|
|
592
|
+
if (b === void 0)
|
|
593
|
+
throw new Error("Line definition not found");
|
|
594
|
+
r.append("path").attr("d", b).attr("class", "arrow arrow" + L % G);
|
|
595
|
+
}, "drawArrow"), tr = /* @__PURE__ */ $((r, t) => {
|
|
596
|
+
const e = r.append("g").attr("class", "commit-arrows");
|
|
597
|
+
[...t.keys()].forEach((a) => {
|
|
598
|
+
const c = t.get(a);
|
|
599
|
+
c.parents && c.parents.length > 0 && c.parents.forEach((i) => {
|
|
600
|
+
Zt(e, t.get(i), c, t);
|
|
601
|
+
});
|
|
602
|
+
});
|
|
603
|
+
}, "drawArrows"), rr = /* @__PURE__ */ $((r, t) => {
|
|
604
|
+
const e = r.append("g");
|
|
605
|
+
t.forEach((a, c) => {
|
|
606
|
+
var i;
|
|
607
|
+
const h = c % G, d = (i = v.get(a.name)) == null ? void 0 : i.pos;
|
|
608
|
+
if (d === void 0)
|
|
609
|
+
throw new Error(`Position not found for branch ${a.name}`);
|
|
610
|
+
const l = e.append("line");
|
|
611
|
+
l.attr("x1", 0), l.attr("y1", d), l.attr("x2", R), l.attr("y2", d), l.attr("class", "branch branch" + h), f === "TB" ? (l.attr("y1", H), l.attr("x1", d), l.attr("y2", R), l.attr("x2", d)) : f === "BT" && (l.attr("y1", R), l.attr("x1", d), l.attr("y2", H), l.attr("x2", d)), z.push(d);
|
|
612
|
+
const o = a.name, n = U(o), u = e.insert("rect"), m = e.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + h);
|
|
613
|
+
m.node().appendChild(n);
|
|
614
|
+
const g = n.getBBox();
|
|
615
|
+
u.attr("class", "branchLabelBkg label" + h).attr("rx", 4).attr("ry", 4).attr("x", -g.width - 4 - ((E == null ? void 0 : E.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -g.height / 2 + 8).attr("width", g.width + 18).attr("height", g.height + 4), m.attr(
|
|
616
|
+
"transform",
|
|
617
|
+
"translate(" + (-g.width - 14 - ((E == null ? void 0 : E.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (d - g.height / 2 - 1) + ")"
|
|
618
|
+
), f === "TB" ? (u.attr("x", d - g.width / 2 - 10).attr("y", 0), m.attr("transform", "translate(" + (d - g.width / 2 - 5) + ", 0)")) : f === "BT" ? (u.attr("x", d - g.width / 2 - 10).attr("y", R), m.attr("transform", "translate(" + (d - g.width / 2 - 5) + ", " + R + ")")) : u.attr("transform", "translate(-19, " + (d - g.height / 2) + ")");
|
|
619
|
+
});
|
|
620
|
+
}, "drawBranches"), er = /* @__PURE__ */ $(function(r, t, e, a, c) {
|
|
621
|
+
return v.set(r, { pos: t, index: e }), t += 50 + (c ? 40 : 0) + (f === "TB" || f === "BT" ? a.width / 2 : 0), t;
|
|
622
|
+
}, "setBranchPosition"), or = /* @__PURE__ */ $(function(r, t, e, a) {
|
|
623
|
+
if (zt(), w.debug("in gitgraph renderer", r + `
|
|
624
|
+
`, "id:", t, e), !E)
|
|
625
|
+
throw new Error("GitGraph config not found");
|
|
626
|
+
const c = E.rotateCommitLabel ?? !1, i = a.db;
|
|
627
|
+
q = i.getCommits();
|
|
628
|
+
const h = i.getBranchesAsObjArray();
|
|
629
|
+
f = i.getDirection();
|
|
630
|
+
const d = mt(`[id="${t}"]`);
|
|
631
|
+
let l = 0;
|
|
632
|
+
h.forEach((o, n) => {
|
|
633
|
+
var u;
|
|
634
|
+
const m = U(o.name), g = d.append("g"), p = g.insert("g").attr("class", "branchLabel"), y = p.insert("g").attr("class", "label branch-label");
|
|
635
|
+
(u = y.node()) == null || u.appendChild(m);
|
|
636
|
+
const L = m.getBBox();
|
|
637
|
+
l = er(o.name, l, n, L, c), y.remove(), p.remove(), g.remove();
|
|
638
|
+
}), j(d, q, !1), E.showBranches && rr(d, h), tr(d, q), j(d, q, !0), $t.insertTitle(
|
|
639
|
+
d,
|
|
640
|
+
"gitTitleText",
|
|
641
|
+
E.titleTopMargin ?? 0,
|
|
642
|
+
i.getDiagramTitle()
|
|
643
|
+
), lt(
|
|
644
|
+
void 0,
|
|
645
|
+
d,
|
|
646
|
+
E.diagramPadding,
|
|
647
|
+
E.useMaxWidth
|
|
648
|
+
);
|
|
649
|
+
}, "draw"), nr = {
|
|
650
|
+
draw: or
|
|
651
|
+
}, ar = /* @__PURE__ */ $((r) => `
|
|
652
|
+
.commit-id,
|
|
653
|
+
.commit-msg,
|
|
654
|
+
.branch-label {
|
|
655
|
+
fill: lightgrey;
|
|
656
|
+
color: lightgrey;
|
|
657
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
658
|
+
font-family: var(--mermaid-font-family);
|
|
659
|
+
}
|
|
660
|
+
${[0, 1, 2, 3, 4, 5, 6, 7].map(
|
|
661
|
+
(t) => `
|
|
662
|
+
.branch-label${t} { fill: ${r["gitBranchLabel" + t]}; }
|
|
663
|
+
.commit${t} { stroke: ${r["git" + t]}; fill: ${r["git" + t]}; }
|
|
664
|
+
.commit-highlight${t} { stroke: ${r["gitInv" + t]}; fill: ${r["gitInv" + t]}; }
|
|
665
|
+
.label${t} { fill: ${r["git" + t]}; }
|
|
666
|
+
.arrow${t} { stroke: ${r["git" + t]}; }
|
|
667
|
+
`
|
|
668
|
+
).join(`
|
|
669
|
+
`)}
|
|
670
|
+
|
|
671
|
+
.branch {
|
|
672
|
+
stroke-width: 1;
|
|
673
|
+
stroke: ${r.lineColor};
|
|
674
|
+
stroke-dasharray: 2;
|
|
675
|
+
}
|
|
676
|
+
.commit-label { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelColor};}
|
|
677
|
+
.commit-label-bkg { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelBackground}; opacity: 0.5; }
|
|
678
|
+
.tag-label { font-size: ${r.tagLabelFontSize}; fill: ${r.tagLabelColor};}
|
|
679
|
+
.tag-label-bkg { fill: ${r.tagLabelBackground}; stroke: ${r.tagLabelBorder}; }
|
|
680
|
+
.tag-hole { fill: ${r.textColor}; }
|
|
681
|
+
|
|
682
|
+
.commit-merge {
|
|
683
|
+
stroke: ${r.primaryColor};
|
|
684
|
+
fill: ${r.primaryColor};
|
|
685
|
+
}
|
|
686
|
+
.commit-reverse {
|
|
687
|
+
stroke: ${r.primaryColor};
|
|
688
|
+
fill: ${r.primaryColor};
|
|
689
|
+
stroke-width: 3;
|
|
690
|
+
}
|
|
691
|
+
.commit-highlight-outer {
|
|
692
|
+
}
|
|
693
|
+
.commit-highlight-inner {
|
|
694
|
+
stroke: ${r.primaryColor};
|
|
695
|
+
fill: ${r.primaryColor};
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
|
699
|
+
.gitTitleText {
|
|
700
|
+
text-anchor: middle;
|
|
701
|
+
font-size: 18px;
|
|
702
|
+
fill: ${r.textColor};
|
|
703
|
+
}
|
|
704
|
+
`, "getStyles"), cr = ar, mr = {
|
|
705
|
+
parser: Ht,
|
|
706
|
+
db: V,
|
|
707
|
+
renderer: nr,
|
|
708
|
+
styles: cr
|
|
709
|
+
};
|
|
710
|
+
export {
|
|
711
|
+
mr as diagram
|
|
712
|
+
};
|