@antdv-next/x 1.0.2-beta.1 → 1.0.2-beta.3
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/actions/Actions.js +1 -1
- package/dist/attachments/index.js +1 -1
- package/dist/code-highlighter/CodeHighlighter.js +24 -7
- package/dist/conversations/index.js +1 -1
- package/dist/file-card/FileCard.js +1 -1
- package/dist/file-card/List.js +1 -1
- package/dist/index.umd.js +73 -32
- package/dist/locale/useLocale.js +1 -1
- package/dist/mermaid/Mermaid.js +1 -1
- package/dist/package.js +1 -1
- package/dist/prompts/Prompts.js +1 -1
- package/dist/sender/Sender.js +1 -1
- package/dist/sender/SenderHeader.js +1 -1
- package/dist/sender/SenderSwitch.js +1 -1
- package/dist/sources/Sources.js +1 -1
- package/dist/suggestion/Suggestion.js +1 -1
- package/dist/theme/genStyleUtils.js +1 -1
- package/dist/think/Think.js +1 -1
- package/dist/thought-chain/Item.js +1 -1
- package/dist/thought-chain/Node.js +1 -1
- package/dist/thought-chain/ThoughtChain.js +1 -1
- package/dist/welcome/index.js +1 -1
- package/dist/x-provider/context.d.ts +5 -1
- package/dist/x-provider/hooks/use-x-provider-context.js +1 -1
- package/dist/x-provider/index.d.ts +47 -0
- package/dist/x-provider/index.js +25 -0
- package/{dist-browser/Serializer-y_SfSPKv.js → es/Serializer-D1JYN1kI.js} +4 -4
- package/{dist-browser/_basePickBy-Cy7KVmkk.js → es/_basePickBy-DZiMKfOQ.js} +23 -23
- package/{dist-browser/_baseUniq-Ch3HuHeT.js → es/_baseUniq-DY3uHjSO.js} +83 -83
- package/es/antdv-next-x.esm.js +21009 -0
- package/{dist-browser/arc-caEkbRYF.js → es/arc-BuXEd18J.js} +3 -3
- package/es/architecture-PBZL5I3N-BdQzc3t9.js +3 -0
- package/{dist-browser/architectureDiagram-2XIMDMQ5-D3IYLROv.js → es/architectureDiagram-2XIMDMQ5-C8x7stcr.js} +85 -85
- package/{dist-browser/blockDiagram-WCTKOSBZ-nXanZ0sc.js → es/blockDiagram-WCTKOSBZ-DA-s3zoq.js} +530 -530
- package/{dist-browser/c4Diagram-IC4MRINW-C-gVp6th.js → es/c4Diagram-IC4MRINW-DD81dyS8.js} +170 -170
- package/es/channel-DZcPzDuw.js +5 -0
- package/{dist-browser/chunk-4BX2VUAB-fLFD6XW0.js → es/chunk-4BX2VUAB-B3zzxglQ.js} +2 -2
- package/{dist-browser/chunk-55IACEB6-OtyKJzCH.js → es/chunk-55IACEB6-CA9CRLkM.js} +2 -2
- package/{dist-browser/chunk-7E7YKBS2-C1dd36rm.js → es/chunk-7E7YKBS2-C_F-WOLQ.js} +2 -2
- package/{dist-browser/chunk-7R4GIKGN-DuTRhdsf.js → es/chunk-7R4GIKGN-CaI-1szl.js} +3 -3
- package/{dist-browser/chunk-C72U2L5F-ClmZGhFC.js → es/chunk-C72U2L5F-l6RZhGri.js} +2 -2
- package/{dist-browser/chunk-EGIJ26TM-Bar_u1MN.js → es/chunk-EGIJ26TM-Be42NeHw.js} +2 -2
- package/{dist-browser/chunk-FMBD7UC4-C_uJ_JJA.js → es/chunk-FMBD7UC4-DJh0L322.js} +2 -2
- package/{dist-browser/chunk-GEFDOKGD-P7WhyrTU.js → es/chunk-GEFDOKGD-BWt_f4io.js} +278 -278
- package/es/chunk-GLR3WWYH-B30PgFZZ.js +41 -0
- package/{dist-browser/chunk-HHEYEP7N-rv5s5WD4.js → es/chunk-HHEYEP7N-DkMnkoQX.js} +3 -3
- package/{dist-browser/chunk-JSJVCQXG-89HUGe9V.js → es/chunk-JSJVCQXG-ddNKdfu8.js} +4 -4
- package/{dist-browser/chunk-KX2RTZJC-pMHnNRQg.js → es/chunk-KX2RTZJC-BbnGQVgL.js} +3 -3
- package/{dist-browser/chunk-KYZI473N-DJmSs1gK.js → es/chunk-KYZI473N-B2rmiORt.js} +573 -573
- package/{dist-browser/chunk-L3YUKLVL-Ck54qytQ.js → es/chunk-L3YUKLVL-CmAZrf2E.js} +2 -2
- package/{dist-browser/chunk-MX3YWQON-MkpK3uBD.js → es/chunk-MX3YWQON-B3_AxMM1.js} +2 -2
- package/{dist-browser/chunk-NQ4KR5QH-DGshodQv.js → es/chunk-NQ4KR5QH-CmCG9ow3.js} +120 -120
- package/{dist-browser/chunk-O4XLMI2P-e-ZzDQwg.js → es/chunk-O4XLMI2P-CTLwv925.js} +238 -238
- package/{dist-browser/chunk-OZEHJAEY-DULNd43V.js → es/chunk-OZEHJAEY-CtONdvqY.js} +2 -2
- package/{dist-browser/chunk-PQ6SQG4A-CQ9Csv7s.js → es/chunk-PQ6SQG4A-Dx7no2mb.js} +3 -3
- package/{dist-browser/chunk-PU5JKC2W-DkEFvrjH.js → es/chunk-PU5JKC2W-O9_8B7zU.js} +76 -76
- package/{dist-browser/chunk-QZHKN3VN-qww1plfw.js → es/chunk-QZHKN3VN-BbuqVxkO.js} +2 -2
- package/{dist-browser/chunk-R5LLSJPH-BERXSDGJ.js → es/chunk-R5LLSJPH-CpwKqyBY.js} +2 -2
- package/{dist-browser/chunk-WL4C6EOR-C-d8WPS7.js → es/chunk-WL4C6EOR-BXrjoxmr.js} +120 -120
- package/{dist-browser/chunk-XIRO2GV7-CFHofxVB.js → es/chunk-XIRO2GV7-4kMze38t.js} +2 -2
- package/{dist-browser/chunk-XPW4576I-DgvoNZkW.js → es/chunk-XPW4576I-DG6JendS.js} +2 -2
- package/{dist-browser/chunk-XZSTWKYB-k8_EXrSa.js → es/chunk-XZSTWKYB-DjOnj3KP.js} +93 -93
- package/{dist-browser/chunk-YBOYWFTD-BUW4AzEX.js → es/chunk-YBOYWFTD-DVAsFYJ-.js} +8 -8
- package/es/classDiagram-VBA2DB6C-wt_pcvEN.js +29 -0
- package/es/classDiagram-v2-RAHNMMFH-B8Bw4b3n.js +29 -0
- package/es/clone-CtpnpaZq.js +8 -0
- package/{dist-browser/cose-bilkent-S5V4N54A-CnrS2OC1.js → es/cose-bilkent-S5V4N54A-IRlkXPnk.js} +3 -3
- package/{dist-browser/css-Dh17kjFY.js → es/css-DyS1hwc1.js} +1 -1
- package/es/css-HrHT_VUz.js +2 -0
- package/{dist-browser/cytoscape.esm-BY3wHcbp.js → es/cytoscape.esm-i2CZcWd-.js} +1 -1
- package/{dist-browser/dagre-BJOzGlhW.js → es/dagre-Dm2PNtRY.js} +57 -57
- package/es/dagre-KLK3FWXG-DLgOeqbz.js +294 -0
- package/{dist-browser/defaultLocale-BaPFSbai.js → es/defaultLocale-bckJcYh1.js} +12 -12
- package/{dist-browser/diagram-E7M64L7V-DxuJj8ZG.js → es/diagram-E7M64L7V-Cdek_47s.js} +83 -83
- package/{dist-browser/diagram-IFDJBPK2-BOpPZ6pu.js → es/diagram-IFDJBPK2-DzCaWPW3.js} +31 -31
- package/{dist-browser/diagram-P4PSJMXO--ChDmcya.js → es/diagram-P4PSJMXO-B7pPaer-.js} +32 -32
- package/{dist-browser/dist-DltyvPj3.js → es/dist-BX_roQzC.js} +1 -1
- package/{dist-browser/erDiagram-INFDFZHY-BA3m-v87.js → es/erDiagram-INFDFZHY-BZHMCNB3.js} +128 -128
- package/{dist-browser/flowDiagram-PKNHOUZH-BCq6k3kr.js → es/flowDiagram-PKNHOUZH-BBJx8-jP.js} +156 -156
- package/{dist-browser/ganttDiagram-A5KZAMGK-DdMePS21.js → es/ganttDiagram-A5KZAMGK-4TJAHJUF.js} +622 -625
- package/es/gitGraph-HDMCJU4V-CGPcRI5K.js +3 -0
- package/{dist-browser/gitGraphDiagram-K3NZZRJ6-CLbRwChG.js → es/gitGraphDiagram-K3NZZRJ6-CSATib_y.js} +176 -176
- package/{dist-browser/graphlib-C7ysKz4u.js → es/graphlib-WtNUGuyd.js} +4 -4
- package/{dist-browser/html-BmZO1Eoo.js → es/html-B6UxjOv0.js} +2 -2
- package/es/html-Hb1oe8XT.js +2 -0
- package/es/info-3K5VOQVL-D6bOjfim.js +3 -0
- package/{dist-browser/infoDiagram-LFFYTUFH-DQAZ-vFk.js → es/infoDiagram-LFFYTUFH-ahqynRAA.js} +5 -5
- package/{dist-browser/init-PAs0hR-b.js → es/init-B75p2clj.js} +1 -1
- package/{dist-browser/isArrayLikeObject-y3HlYDaX.js → es/isArrayLikeObject-D4gDJaEW.js} +80 -80
- package/{dist-browser/isEmpty-2JxdWtc-.js → es/isEmpty-BgdRybYg.js} +3 -3
- package/{dist-browser/ishikawaDiagram-PHBUUO56-B0r2IgGz.js → es/ishikawaDiagram-PHBUUO56-B9NWp429.js} +67 -67
- package/{dist-browser/journeyDiagram-4ABVD52K-DnMUhOvg.js → es/journeyDiagram-4ABVD52K-CXmYa8OF.js} +6 -6
- package/{dist-browser/kanban-definition-K7BYSVSG-Da5Y-nJy.js → es/kanban-definition-K7BYSVSG-g9tToeab.js} +11 -11
- package/{dist-browser/katex-b-xdokOf.js → es/katex-Bvh2oRWI.js} +1 -1
- package/{dist-browser/line-h2iCTGsE.js → es/line-DETnb8Mr.js} +4 -4
- package/{dist-browser/linear-Bv7XrZCH.js → es/linear-DGQDIL28.js} +23 -23
- package/{dist-browser/math-DPzKeDKn.js → es/math-CoDOuve-.js} +1 -1
- package/{dist-browser/mermaid-parser.core-kTgpNO7M.js → es/mermaid-parser.core-DXn-0ev4.js} +16 -16
- package/{dist-browser/mermaid.core-DRuUNxpC.js → es/mermaid.core-W4vXivv8.js} +208 -208
- package/{dist-browser/mindmap-definition-YRQLILUH-CYeqnCde.js → es/mindmap-definition-YRQLILUH-x9QfilEP.js} +16 -16
- package/{dist-browser/ordinal-D8PKtxfM.js → es/ordinal-F3U6aXtP.js} +3 -3
- package/es/packet-RMMSAZCW-CW6reTze.js +3 -0
- package/{dist-browser/path-DZ-6AyWK.js → es/path-Dm3C8WEs.js} +3 -3
- package/es/pie-UPGHQEXC-ByJXXnsc.js +3 -0
- package/{dist-browser/pieDiagram-SKSYHLDU-DAsfTGvY.js → es/pieDiagram-SKSYHLDU-CG2GOW6Z.js} +32 -32
- package/{dist-browser/quadrantDiagram-337W2JSQ-CZLbmQS4.js → es/quadrantDiagram-337W2JSQ-C81pfz0c.js} +4 -4
- package/es/radar-KQ55EAFF-DLq-eYVH.js +3 -0
- package/{dist-browser/requirementDiagram-Z7DCOOCP-Cb_Ygnfe.js → es/requirementDiagram-Z7DCOOCP-J-tc0fnw.js} +59 -59
- package/{dist-browser/rough.esm-C_hJ3ICT.js → es/rough.esm-BhGP2Udb.js} +1 -1
- package/{dist-browser/sankeyDiagram-WA2Y5GQK-DBe5YfW4.js → es/sankeyDiagram-WA2Y5GQK-BfGyH2f1.js} +18 -18
- package/{dist-browser/sequenceDiagram-2WXFIKYE-C_KUoojT.js → es/sequenceDiagram-2WXFIKYE-m6aSnjku.js} +390 -390
- package/{dist-browser/src-BukXhifV.js → es/src-CFVe5TPD.js} +86 -86
- package/{dist-browser/stateDiagram-RAJIS63D-boG6DyfW.js → es/stateDiagram-RAJIS63D-CPJuOh-s.js} +68 -68
- package/es/stateDiagram-v2-FVOUBMTO-uxSkj8dH.js +27 -0
- package/{dist-browser/timeline-definition-YZTLITO2-pFt6rZ6S.js → es/timeline-definition-YZTLITO2-C7Vz32PK.js} +4 -4
- package/es/treemap-KZPCXAKY-BhLuAwPA.js +3 -0
- package/{dist-browser/vennDiagram-LZ73GAT5-VaCO6k4H.js → es/vennDiagram-LZ73GAT5-BWloH3fI.js} +107 -107
- package/{dist-browser/vue-BJ0ov2CZ.js → es/vue-2aJw7p5p.js} +3 -3
- package/{dist-browser/vue-html-D0gyDbfn.js → es/vue-html-DEjI8X9t.js} +1 -1
- package/{dist-browser/xychartDiagram-JWTSCODW-xS5ybemA.js → es/xychartDiagram-JWTSCODW-l-SVBlqB.js} +103 -103
- package/package.json +13 -11
- package/dist/index.esm.js +0 -11377
- package/dist-browser/architecture-PBZL5I3N-DHfBr78A.js +0 -3
- package/dist-browser/channel-DoEe9DF9.js +0 -5
- package/dist-browser/chunk-GLR3WWYH-BvazRgdo.js +0 -41
- package/dist-browser/classDiagram-VBA2DB6C-DWTAs0Zm.js +0 -29
- package/dist-browser/classDiagram-v2-RAHNMMFH-CoxCdmrt.js +0 -29
- package/dist-browser/clone-BXDbKCDu.js +0 -8
- package/dist-browser/css-D9vrnIUE.js +0 -2
- package/dist-browser/dagre-KLK3FWXG-CFC0naVr.js +0 -294
- package/dist-browser/gitGraph-HDMCJU4V-DbzpICZW.js +0 -3
- package/dist-browser/html-DnTYsv5k.js +0 -2
- package/dist-browser/index.es.js +0 -56150
- package/dist-browser/index.umd.js +0 -3281
- package/dist-browser/info-3K5VOQVL-CpUiQuel.js +0 -3
- package/dist-browser/packet-RMMSAZCW-UTFQ0FQx.js +0 -3
- package/dist-browser/pie-UPGHQEXC-CarAcBSi.js +0 -3
- package/dist-browser/radar-KQ55EAFF-NXK5PC9R.js +0 -3
- package/dist-browser/stateDiagram-v2-FVOUBMTO-DHCajhrN.js +0 -27
- package/dist-browser/treemap-KZPCXAKY-Cj9QakFB.js +0 -3
- /package/{dist-browser → es}/array-CWNufkl9.js +0 -0
- /package/{dist-browser → es}/bash-CXEwhtGQ.js +0 -0
- /package/{dist-browser → es}/chunk-WQLz0Won.js +0 -0
- /package/{dist-browser → es}/diff-BSu5dsa2.js +0 -0
- /package/{dist-browser → es}/javascript-BXHK_bZ2.js +0 -0
- /package/{dist-browser → es}/javascript-NV_FQBab.js +0 -0
- /package/{dist-browser → es}/json-C8Y9C4Ne.js +0 -0
- /package/{dist-browser → es}/json-DZ_9-j3Q.js +0 -0
- /package/{dist-browser → es}/jsx-CxlNNvOI.js +0 -0
- /package/{dist-browser → es}/markdown-BKwT7HWz.js +0 -0
- /package/{dist-browser → es}/mermaid-C1RUu_Iw.js +0 -0
- /package/{dist-browser → es}/python-BQM8giqx.js +0 -0
- /package/{dist-browser → es}/tsx-DIYEV_g7.js +0 -0
- /package/{dist-browser → es}/typescript-B6MWEsBH.js +0 -0
- /package/{dist-browser → es}/typescript-CR48gG1F.js +0 -0
- /package/{dist-browser → es}/yaml-Y0CqUPTQ.js +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as o, C as s, V as c, W as l, _ as u, a as d, d as f, q as ee, s as p, v as te, y as m } from "./chunk-7R4GIKGN-
|
|
4
|
-
import { t as h } from "./chunk-4BX2VUAB-
|
|
5
|
-
import { t as g } from "./mermaid-parser.core-
|
|
6
|
-
import { t as ne } from "./chunk-QZHKN3VN-
|
|
7
|
-
//#region ../../node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-K3NZZRJ6.mjs
|
|
1
|
+
import { h as e, p as t, r as n } from "./chunk-GEFDOKGD-BWt_f4io.js";
|
|
2
|
+
import { g as r, h as i, p as a } from "./src-CFVe5TPD.js";
|
|
3
|
+
import { B as o, C as s, V as c, W as l, _ as u, a as d, d as f, q as ee, s as p, v as te, y as m } from "./chunk-7R4GIKGN-CaI-1szl.js";
|
|
4
|
+
import { t as h } from "./chunk-4BX2VUAB-B3zzxglQ.js";
|
|
5
|
+
import { t as g } from "./mermaid-parser.core-DXn-0ev4.js";
|
|
6
|
+
import { t as ne } from "./chunk-QZHKN3VN-BbuqVxkO.js";
|
|
7
|
+
//#region ../../node_modules/.pnpm/mermaid@11.13.0/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-K3NZZRJ6.mjs
|
|
8
8
|
var _ = {
|
|
9
9
|
NORMAL: 0,
|
|
10
10
|
REVERSE: 1,
|
|
11
11
|
HIGHLIGHT: 2,
|
|
12
12
|
MERGE: 3,
|
|
13
13
|
CHERRY_PICK: 4
|
|
14
|
-
}, re = f.gitGraph, v = /* @__PURE__ */
|
|
14
|
+
}, re = f.gitGraph, v = /* @__PURE__ */ i(() => n({
|
|
15
15
|
...re,
|
|
16
16
|
...m().gitGraph
|
|
17
17
|
}), "getConfig"), y = new ne(() => {
|
|
@@ -32,9 +32,9 @@ var _ = {
|
|
|
32
32
|
};
|
|
33
33
|
});
|
|
34
34
|
function b() {
|
|
35
|
-
return
|
|
35
|
+
return t({ length: 7 });
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
i(b, "getID");
|
|
38
38
|
function x(e, t) {
|
|
39
39
|
let n = /* @__PURE__ */ Object.create(null);
|
|
40
40
|
return e.reduce((e, r) => {
|
|
@@ -42,146 +42,146 @@ function x(e, t) {
|
|
|
42
42
|
return n[i] || (n[i] = !0, e.push(r)), e;
|
|
43
43
|
}, []);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
var S = /* @__PURE__ */
|
|
45
|
+
i(x, "uniqBy");
|
|
46
|
+
var S = /* @__PURE__ */ i(function(e) {
|
|
47
47
|
y.records.direction = e;
|
|
48
|
-
}, "setDirection"), C = /* @__PURE__ */
|
|
49
|
-
|
|
48
|
+
}, "setDirection"), C = /* @__PURE__ */ i(function(e) {
|
|
49
|
+
r.debug("options str", e), e = e?.trim(), e ||= "{}";
|
|
50
50
|
try {
|
|
51
|
-
y.records.options = JSON.parse(
|
|
52
|
-
} catch (
|
|
53
|
-
|
|
51
|
+
y.records.options = JSON.parse(e);
|
|
52
|
+
} catch (e) {
|
|
53
|
+
r.error("error while parsing gitGraph options", e.message);
|
|
54
54
|
}
|
|
55
|
-
}, "setOptions"), ie = /* @__PURE__ */
|
|
55
|
+
}, "setOptions"), ie = /* @__PURE__ */ i(function() {
|
|
56
56
|
return y.records.options;
|
|
57
|
-
}, "getOptions"), ae = /* @__PURE__ */
|
|
58
|
-
let
|
|
59
|
-
|
|
57
|
+
}, "getOptions"), ae = /* @__PURE__ */ i(function(e) {
|
|
58
|
+
let t = e.msg, n = e.id, i = e.type, a = e.tags;
|
|
59
|
+
r.info("commit", t, n, i, a), r.debug("Entering commit:", t, n, i, a);
|
|
60
60
|
let o = v();
|
|
61
|
-
|
|
61
|
+
n = p.sanitizeText(n, o), t = p.sanitizeText(t, o), a = a?.map((e) => p.sanitizeText(e, o));
|
|
62
62
|
let s = {
|
|
63
|
-
id:
|
|
64
|
-
message:
|
|
63
|
+
id: n || y.records.seq + "-" + b(),
|
|
64
|
+
message: t,
|
|
65
65
|
seq: y.records.seq++,
|
|
66
66
|
type: i ?? _.NORMAL,
|
|
67
67
|
tags: a ?? [],
|
|
68
68
|
parents: y.records.head == null ? [] : [y.records.head.id],
|
|
69
69
|
branch: y.records.currBranch
|
|
70
70
|
};
|
|
71
|
-
y.records.head = s,
|
|
72
|
-
}, "commit"), oe = /* @__PURE__ */
|
|
73
|
-
let
|
|
74
|
-
if (
|
|
75
|
-
y.records.branches.set(
|
|
76
|
-
name:
|
|
77
|
-
order:
|
|
78
|
-
}), w(
|
|
79
|
-
}, "branch"), se = /* @__PURE__ */
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
let s = y.records.branches.get(y.records.currBranch), c = y.records.branches.get(
|
|
83
|
-
if (l && u && l.branch ===
|
|
84
|
-
if (y.records.currBranch ===
|
|
71
|
+
y.records.head = s, r.info("main branch", o.mainBranchName), y.records.commits.has(s.id) && r.warn(`Commit ID ${s.id} already exists`), y.records.commits.set(s.id, s), y.records.branches.set(y.records.currBranch, s.id), r.debug("in pushCommit " + s.id);
|
|
72
|
+
}, "commit"), oe = /* @__PURE__ */ i(function(e) {
|
|
73
|
+
let t = e.name, n = e.order;
|
|
74
|
+
if (t = p.sanitizeText(t, v()), y.records.branches.has(t)) 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 ${t}")`);
|
|
75
|
+
y.records.branches.set(t, y.records.head == null ? null : y.records.head.id), y.records.branchConfig.set(t, {
|
|
76
|
+
name: t,
|
|
77
|
+
order: n
|
|
78
|
+
}), w(t), r.debug("in createBranch");
|
|
79
|
+
}, "branch"), se = /* @__PURE__ */ i((e) => {
|
|
80
|
+
let t = e.branch, n = e.id, i = e.type, a = e.tags, o = v();
|
|
81
|
+
t = p.sanitizeText(t, o), n &&= p.sanitizeText(n, o);
|
|
82
|
+
let s = y.records.branches.get(y.records.currBranch), c = y.records.branches.get(t), l = s ? y.records.commits.get(s) : void 0, u = c ? y.records.commits.get(c) : void 0;
|
|
83
|
+
if (l && u && l.branch === t) throw Error(`Cannot merge branch '${t}' into itself.`);
|
|
84
|
+
if (y.records.currBranch === t) {
|
|
85
85
|
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Cannot merge a branch to itself");
|
|
86
86
|
throw e.hash = {
|
|
87
|
-
text: `merge ${
|
|
88
|
-
token: `merge ${
|
|
87
|
+
text: `merge ${t}`,
|
|
88
|
+
token: `merge ${t}`,
|
|
89
89
|
expected: ["branch abc"]
|
|
90
90
|
}, e;
|
|
91
91
|
}
|
|
92
92
|
if (l === void 0 || !l) {
|
|
93
93
|
let e = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${y.records.currBranch})has no commits`);
|
|
94
94
|
throw e.hash = {
|
|
95
|
-
text: `merge ${
|
|
96
|
-
token: `merge ${
|
|
95
|
+
text: `merge ${t}`,
|
|
96
|
+
token: `merge ${t}`,
|
|
97
97
|
expected: ["commit"]
|
|
98
98
|
}, e;
|
|
99
99
|
}
|
|
100
|
-
if (!y.records.branches.has(
|
|
101
|
-
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" +
|
|
100
|
+
if (!y.records.branches.has(t)) {
|
|
101
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + t + ") does not exist");
|
|
102
102
|
throw e.hash = {
|
|
103
|
-
text: `merge ${
|
|
104
|
-
token: `merge ${
|
|
105
|
-
expected: [`branch ${
|
|
103
|
+
text: `merge ${t}`,
|
|
104
|
+
token: `merge ${t}`,
|
|
105
|
+
expected: [`branch ${t}`]
|
|
106
106
|
}, e;
|
|
107
107
|
}
|
|
108
108
|
if (u === void 0 || !u) {
|
|
109
|
-
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" +
|
|
109
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + t + ") has no commits");
|
|
110
110
|
throw e.hash = {
|
|
111
|
-
text: `merge ${
|
|
112
|
-
token: `merge ${
|
|
111
|
+
text: `merge ${t}`,
|
|
112
|
+
token: `merge ${t}`,
|
|
113
113
|
expected: ["\"commit\""]
|
|
114
114
|
}, e;
|
|
115
115
|
}
|
|
116
116
|
if (l === u) {
|
|
117
117
|
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Both branches have same head");
|
|
118
118
|
throw e.hash = {
|
|
119
|
-
text: `merge ${
|
|
120
|
-
token: `merge ${
|
|
119
|
+
text: `merge ${t}`,
|
|
120
|
+
token: `merge ${t}`,
|
|
121
121
|
expected: ["branch abc"]
|
|
122
122
|
}, e;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" +
|
|
124
|
+
if (n && y.records.commits.has(n)) {
|
|
125
|
+
let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" + n + " already exists, use different custom id");
|
|
126
126
|
throw e.hash = {
|
|
127
|
-
text: `merge ${
|
|
128
|
-
token: `merge ${
|
|
129
|
-
expected: [`merge ${
|
|
127
|
+
text: `merge ${t} ${n} ${i} ${a?.join(" ")}`,
|
|
128
|
+
token: `merge ${t} ${n} ${i} ${a?.join(" ")}`,
|
|
129
|
+
expected: [`merge ${t} ${n}_UNIQUE ${i} ${a?.join(" ")}`]
|
|
130
130
|
}, e;
|
|
131
131
|
}
|
|
132
132
|
let d = c || "", f = {
|
|
133
|
-
id:
|
|
134
|
-
message: `merged branch ${
|
|
133
|
+
id: n || `${y.records.seq}-${b()}`,
|
|
134
|
+
message: `merged branch ${t} into ${y.records.currBranch}`,
|
|
135
135
|
seq: y.records.seq++,
|
|
136
136
|
parents: y.records.head == null ? [] : [y.records.head.id, d],
|
|
137
137
|
branch: y.records.currBranch,
|
|
138
138
|
type: _.MERGE,
|
|
139
139
|
customType: i,
|
|
140
|
-
customId: !!
|
|
140
|
+
customId: !!n,
|
|
141
141
|
tags: a ?? []
|
|
142
142
|
};
|
|
143
|
-
y.records.head = f, y.records.commits.set(f.id, f), y.records.branches.set(y.records.currBranch, f.id),
|
|
144
|
-
}, "merge"), ce = /* @__PURE__ */
|
|
145
|
-
let
|
|
146
|
-
|
|
143
|
+
y.records.head = f, y.records.commits.set(f.id, f), y.records.branches.set(y.records.currBranch, f.id), r.debug(y.records.branches), r.debug("in mergeBranch");
|
|
144
|
+
}, "merge"), ce = /* @__PURE__ */ i(function(e) {
|
|
145
|
+
let t = e.id, n = e.targetId, i = e.tags, a = e.parent;
|
|
146
|
+
r.debug("Entering cherryPick:", t, n, i);
|
|
147
147
|
let o = v();
|
|
148
|
-
if (
|
|
148
|
+
if (t = p.sanitizeText(t, o), n = p.sanitizeText(n, o), i = i?.map((e) => p.sanitizeText(e, o)), a = p.sanitizeText(a, o), !t || !y.records.commits.has(t)) {
|
|
149
149
|
let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
150
150
|
throw e.hash = {
|
|
151
|
-
text: `cherryPick ${
|
|
152
|
-
token: `cherryPick ${
|
|
151
|
+
text: `cherryPick ${t} ${n}`,
|
|
152
|
+
token: `cherryPick ${t} ${n}`,
|
|
153
153
|
expected: ["cherry-pick abc"]
|
|
154
154
|
}, e;
|
|
155
155
|
}
|
|
156
|
-
let s = y.records.commits.get(
|
|
156
|
+
let s = y.records.commits.get(t);
|
|
157
157
|
if (s === void 0 || !s) throw Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
|
|
158
158
|
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.");
|
|
159
159
|
let c = s.branch;
|
|
160
160
|
if (s.type === _.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.");
|
|
161
|
-
if (!
|
|
161
|
+
if (!n || !y.records.commits.has(n)) {
|
|
162
162
|
if (c === y.records.currBranch) {
|
|
163
163
|
let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit is already on current branch");
|
|
164
164
|
throw e.hash = {
|
|
165
|
-
text: `cherryPick ${
|
|
166
|
-
token: `cherryPick ${
|
|
165
|
+
text: `cherryPick ${t} ${n}`,
|
|
166
|
+
token: `cherryPick ${t} ${n}`,
|
|
167
167
|
expected: ["cherry-pick abc"]
|
|
168
168
|
}, e;
|
|
169
169
|
}
|
|
170
|
-
let
|
|
171
|
-
if (
|
|
170
|
+
let e = y.records.branches.get(y.records.currBranch);
|
|
171
|
+
if (e === void 0 || !e) {
|
|
172
172
|
let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${y.records.currBranch})has no commits`);
|
|
173
173
|
throw e.hash = {
|
|
174
|
-
text: `cherryPick ${
|
|
175
|
-
token: `cherryPick ${
|
|
174
|
+
text: `cherryPick ${t} ${n}`,
|
|
175
|
+
token: `cherryPick ${t} ${n}`,
|
|
176
176
|
expected: ["cherry-pick abc"]
|
|
177
177
|
}, e;
|
|
178
178
|
}
|
|
179
|
-
let o = y.records.commits.get(
|
|
179
|
+
let o = y.records.commits.get(e);
|
|
180
180
|
if (o === void 0 || !o) {
|
|
181
181
|
let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${y.records.currBranch})has no commits`);
|
|
182
182
|
throw e.hash = {
|
|
183
|
-
text: `cherryPick ${
|
|
184
|
-
token: `cherryPick ${
|
|
183
|
+
text: `cherryPick ${t} ${n}`,
|
|
184
|
+
token: `cherryPick ${t} ${n}`,
|
|
185
185
|
expected: ["cherry-pick abc"]
|
|
186
186
|
}, e;
|
|
187
187
|
}
|
|
@@ -194,9 +194,9 @@ var S = /* @__PURE__ */ t(function(e) {
|
|
|
194
194
|
type: _.CHERRY_PICK,
|
|
195
195
|
tags: i ? i.filter(Boolean) : [`cherry-pick:${s.id}${s.type === _.MERGE ? `|parent:${a}` : ""}`]
|
|
196
196
|
};
|
|
197
|
-
y.records.head = l, y.records.commits.set(l.id, l), y.records.branches.set(y.records.currBranch, l.id),
|
|
197
|
+
y.records.head = l, y.records.commits.set(l.id, l), y.records.branches.set(y.records.currBranch, l.id), r.debug(y.records.branches), r.debug("in cherryPick");
|
|
198
198
|
}
|
|
199
|
-
}, "cherryPick"), w = /* @__PURE__ */
|
|
199
|
+
}, "cherryPick"), w = /* @__PURE__ */ i(function(e) {
|
|
200
200
|
if (e = p.sanitizeText(e, v()), y.records.branches.has(e)) {
|
|
201
201
|
y.records.currBranch = e;
|
|
202
202
|
let t = y.records.branches.get(y.records.currBranch);
|
|
@@ -214,49 +214,49 @@ function T(e, t, n) {
|
|
|
214
214
|
let r = e.indexOf(t);
|
|
215
215
|
r === -1 ? e.push(n) : e.splice(r, 1, n);
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
function E(
|
|
219
|
-
let
|
|
220
|
-
|
|
221
|
-
e ===
|
|
217
|
+
i(T, "upsert");
|
|
218
|
+
function E(e) {
|
|
219
|
+
let t = e.reduce((e, t) => e.seq > t.seq ? e : t, e[0]), n = "";
|
|
220
|
+
e.forEach(function(e) {
|
|
221
|
+
e === t ? n += " *" : n += " |";
|
|
222
222
|
});
|
|
223
223
|
let i = [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
n,
|
|
225
|
+
t.id,
|
|
226
|
+
t.seq
|
|
227
227
|
];
|
|
228
|
-
for (let e in y.records.branches) y.records.branches.get(e) ===
|
|
229
|
-
if (
|
|
230
|
-
let
|
|
231
|
-
T(t, n
|
|
232
|
-
} else if (
|
|
233
|
-
else if (
|
|
234
|
-
let
|
|
235
|
-
T(t, n
|
|
228
|
+
for (let e in y.records.branches) y.records.branches.get(e) === t.id && i.push(e);
|
|
229
|
+
if (r.debug(i.join(" ")), t.parents && t.parents.length == 2 && t.parents[0] && t.parents[1]) {
|
|
230
|
+
let n = y.records.commits.get(t.parents[0]);
|
|
231
|
+
T(e, t, n), t.parents[1] && e.push(y.records.commits.get(t.parents[1]));
|
|
232
|
+
} else if (t.parents.length == 0) return;
|
|
233
|
+
else if (t.parents[0]) {
|
|
234
|
+
let n = y.records.commits.get(t.parents[0]);
|
|
235
|
+
T(e, t, n);
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
e = x(e, (e) => e.id), E(e);
|
|
238
238
|
}
|
|
239
|
-
|
|
240
|
-
var le = /* @__PURE__ */
|
|
241
|
-
|
|
242
|
-
let
|
|
243
|
-
E([
|
|
244
|
-
}, "prettyPrint"), ue = /* @__PURE__ */
|
|
239
|
+
i(E, "prettyPrintCommitHistory");
|
|
240
|
+
var le = /* @__PURE__ */ i(function() {
|
|
241
|
+
r.debug(y.records.commits);
|
|
242
|
+
let e = D()[0];
|
|
243
|
+
E([e]);
|
|
244
|
+
}, "prettyPrint"), ue = /* @__PURE__ */ i(function() {
|
|
245
245
|
y.reset(), d();
|
|
246
|
-
}, "clear"), de = /* @__PURE__ */
|
|
246
|
+
}, "clear"), de = /* @__PURE__ */ i(function() {
|
|
247
247
|
return [...y.records.branchConfig.values()].map((e, t) => e.order !== null && e.order !== void 0 ? e : {
|
|
248
248
|
...e,
|
|
249
249
|
order: parseFloat(`0.${t}`)
|
|
250
250
|
}).sort((e, t) => (e.order ?? 0) - (t.order ?? 0)).map(({ name: e }) => ({ name: e }));
|
|
251
|
-
}, "getBranchesAsObjArray"), fe = /* @__PURE__ */
|
|
251
|
+
}, "getBranchesAsObjArray"), fe = /* @__PURE__ */ i(function() {
|
|
252
252
|
return y.records.branches;
|
|
253
|
-
}, "getBranches"), pe = /* @__PURE__ */
|
|
253
|
+
}, "getBranches"), pe = /* @__PURE__ */ i(function() {
|
|
254
254
|
return y.records.commits;
|
|
255
|
-
}, "getCommits"), D = /* @__PURE__ */
|
|
256
|
-
let
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
}),
|
|
255
|
+
}, "getCommits"), D = /* @__PURE__ */ i(function() {
|
|
256
|
+
let e = [...y.records.commits.values()];
|
|
257
|
+
return e.forEach(function(e) {
|
|
258
|
+
r.debug(e.id);
|
|
259
|
+
}), e.sort((e, t) => e.seq - t.seq), e;
|
|
260
260
|
}, "getCommitsArray"), O = {
|
|
261
261
|
commitType: _,
|
|
262
262
|
getConfig: v,
|
|
@@ -274,13 +274,13 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
274
274
|
getBranches: fe,
|
|
275
275
|
getCommits: pe,
|
|
276
276
|
getCommitsArray: D,
|
|
277
|
-
getCurrentBranch: /* @__PURE__ */
|
|
277
|
+
getCurrentBranch: /* @__PURE__ */ i(function() {
|
|
278
278
|
return y.records.currBranch;
|
|
279
279
|
}, "getCurrentBranch"),
|
|
280
|
-
getDirection: /* @__PURE__ */
|
|
280
|
+
getDirection: /* @__PURE__ */ i(function() {
|
|
281
281
|
return y.records.direction;
|
|
282
282
|
}, "getDirection"),
|
|
283
|
-
getHead: /* @__PURE__ */
|
|
283
|
+
getHead: /* @__PURE__ */ i(function() {
|
|
284
284
|
return y.records.head;
|
|
285
285
|
}, "getHead"),
|
|
286
286
|
setAccTitle: c,
|
|
@@ -289,60 +289,60 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
289
289
|
setAccDescription: o,
|
|
290
290
|
setDiagramTitle: l,
|
|
291
291
|
getDiagramTitle: s
|
|
292
|
-
}, k = /* @__PURE__ */
|
|
292
|
+
}, k = /* @__PURE__ */ i((e, t) => {
|
|
293
293
|
h(e, t), e.dir && t.setDirection(e.dir);
|
|
294
294
|
for (let n of e.statements) A(n, t);
|
|
295
|
-
}, "populate"), A = /* @__PURE__ */
|
|
296
|
-
let
|
|
297
|
-
Commit: /* @__PURE__ */
|
|
298
|
-
Branch: /* @__PURE__ */
|
|
299
|
-
Merge: /* @__PURE__ */
|
|
300
|
-
Checkout: /* @__PURE__ */
|
|
301
|
-
CherryPicking: /* @__PURE__ */
|
|
302
|
-
}[
|
|
303
|
-
|
|
304
|
-
}, "parseStatement"), j = /* @__PURE__ */
|
|
295
|
+
}, "populate"), A = /* @__PURE__ */ i((e, t) => {
|
|
296
|
+
let n = {
|
|
297
|
+
Commit: /* @__PURE__ */ i((e) => t.commit(j(e)), "Commit"),
|
|
298
|
+
Branch: /* @__PURE__ */ i((e) => t.branch(M(e)), "Branch"),
|
|
299
|
+
Merge: /* @__PURE__ */ i((e) => t.merge(N(e)), "Merge"),
|
|
300
|
+
Checkout: /* @__PURE__ */ i((e) => t.checkout(P(e)), "Checkout"),
|
|
301
|
+
CherryPicking: /* @__PURE__ */ i((e) => t.cherryPick(F(e)), "CherryPicking")
|
|
302
|
+
}[e.$type];
|
|
303
|
+
n ? n(e) : r.error(`Unknown statement type: ${e.$type}`);
|
|
304
|
+
}, "parseStatement"), j = /* @__PURE__ */ i((e) => ({
|
|
305
305
|
id: e.id,
|
|
306
306
|
msg: e.message ?? "",
|
|
307
307
|
type: e.type === void 0 ? _.NORMAL : _[e.type],
|
|
308
308
|
tags: e.tags ?? void 0
|
|
309
|
-
}), "parseCommit"), M = /* @__PURE__ */
|
|
309
|
+
}), "parseCommit"), M = /* @__PURE__ */ i((e) => ({
|
|
310
310
|
name: e.name,
|
|
311
311
|
order: e.order ?? 0
|
|
312
|
-
}), "parseBranch"), N = /* @__PURE__ */
|
|
312
|
+
}), "parseBranch"), N = /* @__PURE__ */ i((e) => ({
|
|
313
313
|
branch: e.branch,
|
|
314
314
|
id: e.id ?? "",
|
|
315
315
|
type: e.type === void 0 ? void 0 : _[e.type],
|
|
316
316
|
tags: e.tags ?? void 0
|
|
317
|
-
}), "parseMerge"), P = /* @__PURE__ */
|
|
317
|
+
}), "parseMerge"), P = /* @__PURE__ */ i((e) => e.branch, "parseCheckout"), F = /* @__PURE__ */ i((e) => ({
|
|
318
318
|
id: e.id,
|
|
319
319
|
targetId: "",
|
|
320
320
|
tags: e.tags?.length === 0 ? void 0 : e.tags,
|
|
321
321
|
parent: e.parent
|
|
322
|
-
}), "parseCherryPicking"), I = { parse: /* @__PURE__ */
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
}, "parse") }, L = 10, R = 40, z = 4, B = 2, V = 8, H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), W = 30, G = /* @__PURE__ */ new Map(), K = [], q = 0, J = "LR", me = /* @__PURE__ */
|
|
322
|
+
}), "parseCherryPicking"), I = { parse: /* @__PURE__ */ i(async (e) => {
|
|
323
|
+
let t = await g("gitGraph", e);
|
|
324
|
+
r.debug(t), k(t, O);
|
|
325
|
+
}, "parse") }, L = 10, R = 40, z = 4, B = 2, V = 8, H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), W = 30, G = /* @__PURE__ */ new Map(), K = [], q = 0, J = "LR", me = /* @__PURE__ */ i(() => {
|
|
326
326
|
H.clear(), U.clear(), G.clear(), q = 0, K = [], J = "LR";
|
|
327
|
-
}, "clear"), Y = /* @__PURE__ */
|
|
327
|
+
}, "clear"), Y = /* @__PURE__ */ i((e) => {
|
|
328
328
|
let t = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
329
329
|
return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((e) => {
|
|
330
330
|
let n = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
331
331
|
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);
|
|
332
332
|
}), t;
|
|
333
|
-
}, "drawText"), X = /* @__PURE__ */
|
|
334
|
-
let n, r
|
|
335
|
-
return J === "BT" ? (
|
|
336
|
-
let
|
|
337
|
-
|
|
338
|
-
}),
|
|
339
|
-
}, "findClosestParent"), he = /* @__PURE__ */
|
|
333
|
+
}, "drawText"), X = /* @__PURE__ */ i((e) => {
|
|
334
|
+
let t, n, r;
|
|
335
|
+
return J === "BT" ? (n = /* @__PURE__ */ i((e, t) => e <= t, "comparisonFunc"), r = Infinity) : (n = /* @__PURE__ */ i((e, t) => e >= t, "comparisonFunc"), r = 0), e.forEach((e) => {
|
|
336
|
+
let i = J === "TB" || J == "BT" ? U.get(e)?.y : U.get(e)?.x;
|
|
337
|
+
i !== void 0 && n(i, r) && (t = e, r = i);
|
|
338
|
+
}), t;
|
|
339
|
+
}, "findClosestParent"), he = /* @__PURE__ */ i((e) => {
|
|
340
340
|
let t = "", n = Infinity;
|
|
341
341
|
return e.forEach((e) => {
|
|
342
342
|
let r = U.get(e).y;
|
|
343
343
|
r <= n && (t = e, n = r);
|
|
344
344
|
}), t || void 0;
|
|
345
|
-
}, "findClosestParentBT"), ge = /* @__PURE__ */
|
|
345
|
+
}, "findClosestParentBT"), ge = /* @__PURE__ */ i((e, t, n) => {
|
|
346
346
|
let r = n, i = n, a = [];
|
|
347
347
|
e.forEach((e) => {
|
|
348
348
|
let n = t.get(e);
|
|
@@ -362,13 +362,13 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
|
-
}, "setParallelBTPos"), _e = /* @__PURE__ */
|
|
365
|
+
}, "setParallelBTPos"), _e = /* @__PURE__ */ i((e) => {
|
|
366
366
|
let t = X(e.parents.filter((e) => e !== null));
|
|
367
367
|
if (!t) throw Error(`Closest parent not found for commit ${e.id}`);
|
|
368
368
|
let n = U.get(t)?.y;
|
|
369
369
|
if (n === void 0) throw Error(`Closest parent position not found for commit ${e.id}`);
|
|
370
370
|
return n;
|
|
371
|
-
}, "findClosestParentPos"), ve = /* @__PURE__ */
|
|
371
|
+
}, "findClosestParentPos"), ve = /* @__PURE__ */ i((e) => _e(e) + R, "calculateCommitPosition"), ye = /* @__PURE__ */ i((e, t) => {
|
|
372
372
|
let n = H.get(e.branch);
|
|
373
373
|
if (!n) throw Error(`Branch not found for commit ${e.id}`);
|
|
374
374
|
let r = n.pos, i = t + L;
|
|
@@ -379,7 +379,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
379
379
|
x: r,
|
|
380
380
|
y: i
|
|
381
381
|
};
|
|
382
|
-
}, "setCommitPosition"), be = /* @__PURE__ */
|
|
382
|
+
}, "setCommitPosition"), be = /* @__PURE__ */ i((e, t, n) => {
|
|
383
383
|
let r = H.get(e.branch);
|
|
384
384
|
if (!r) throw Error(`Branch not found for commit ${e.id}`);
|
|
385
385
|
let i = t + n, a = r.pos;
|
|
@@ -387,7 +387,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
387
387
|
x: a,
|
|
388
388
|
y: i
|
|
389
389
|
});
|
|
390
|
-
}, "setRootPosition"), xe = /* @__PURE__ */
|
|
390
|
+
}, "setRootPosition"), xe = /* @__PURE__ */ i((e, t, n, r, i, a) => {
|
|
391
391
|
if (a === _.HIGHLIGHT) e.append("rect").attr("x", n.x - 10).attr("y", n.y - 10).attr("width", 20).attr("height", 20).attr("class", `commit ${t.id} commit-highlight${i % V} ${r}-outer`), e.append("rect").attr("x", n.x - 6).attr("y", n.y - 6).attr("width", 12).attr("height", 12).attr("class", `commit ${t.id} commit${i % V} ${r}-inner`);
|
|
392
392
|
else if (a === _.CHERRY_PICK) e.append("circle").attr("cx", n.x).attr("cy", n.y).attr("r", 10).attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x - 3).attr("cy", n.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x + 3).attr("cy", n.y + 2).attr("r", 2.75).attr("fill", "#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", "#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", "#fff").attr("class", `commit ${t.id} ${r}`);
|
|
393
393
|
else {
|
|
@@ -398,7 +398,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
398
398
|
}
|
|
399
399
|
a === _.REVERSE && e.append("path").attr("d", `M ${n.x - 5},${n.y - 5}L${n.x + 5},${n.y + 5}M${n.x - 5},${n.y + 5}L${n.x + 5},${n.y - 5}`).attr("class", `commit ${r} ${t.id} commit${i % V}`);
|
|
400
400
|
}
|
|
401
|
-
}, "drawCommitBullet"), Se = /* @__PURE__ */
|
|
401
|
+
}, "drawCommitBullet"), Se = /* @__PURE__ */ i((e, t, n, r, i) => {
|
|
402
402
|
if (t.type !== _.CHERRY_PICK && (t.customId && t.type === _.MERGE || t.type !== _.MERGE) && i.showCommitLabel) {
|
|
403
403
|
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();
|
|
404
404
|
if (c && (o.attr("x", n.posWithOffset - c.width / 2 - B).attr("y", n.y + 13.5).attr("width", c.width + 2 * B).attr("height", c.height + 2 * B), J === "TB" || J === "BT" ? (o.attr("x", n.x - (c.width + 4 * z + 5)).attr("y", n.y - 12), s.attr("x", n.x - (c.width + 4 * z)).attr("y", n.y + c.height - 12)) : s.attr("x", n.posWithOffset - c.width / 2), i.rotateCommitLabel)) if (J === "TB" || J === "BT") s.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")"), o.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")");
|
|
@@ -407,7 +407,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
407
407
|
a.attr("transform", "translate(" + e + ", " + t + ") rotate(-45, " + r + ", " + n.y + ")");
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
}, "drawCommitLabel"), Z = /* @__PURE__ */
|
|
410
|
+
}, "drawCommitLabel"), Z = /* @__PURE__ */ i((e, t, n, r) => {
|
|
411
411
|
if (t.tags.length > 0) {
|
|
412
412
|
let i = 0, a = 0, o = 0, s = [];
|
|
413
413
|
for (let r of t.tags.reverse()) {
|
|
@@ -440,7 +440,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
}, "drawCommitTags"), Ce = /* @__PURE__ */
|
|
443
|
+
}, "drawCommitTags"), Ce = /* @__PURE__ */ i((e) => {
|
|
444
444
|
switch (e.customType ?? e.type) {
|
|
445
445
|
case _.NORMAL: return "commit-normal";
|
|
446
446
|
case _.REVERSE: return "commit-reverse";
|
|
@@ -449,7 +449,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
449
449
|
case _.CHERRY_PICK: return "commit-cherry-pick";
|
|
450
450
|
default: return "commit-normal";
|
|
451
451
|
}
|
|
452
|
-
}, "getCommitClassType"), we = /* @__PURE__ */
|
|
452
|
+
}, "getCommitClassType"), we = /* @__PURE__ */ i((e, t, n, r) => {
|
|
453
453
|
let i = {
|
|
454
454
|
x: 0,
|
|
455
455
|
y: 0
|
|
@@ -464,7 +464,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
464
464
|
else if (t === "BT") return (r.get(e.id) ?? i).y - R;
|
|
465
465
|
else return 0;
|
|
466
466
|
return 0;
|
|
467
|
-
}, "calculatePosition"), Te = /* @__PURE__ */
|
|
467
|
+
}, "calculatePosition"), Te = /* @__PURE__ */ i((e, t, n) => {
|
|
468
468
|
let r = J === "BT" && n ? t : t + L, i = J === "TB" || J === "BT" ? r : H.get(e.branch)?.pos, a = J === "TB" || J === "BT" ? H.get(e.branch)?.pos : r;
|
|
469
469
|
if (a === void 0 || i === void 0) throw Error(`Position were undefined for commit ${e.id}`);
|
|
470
470
|
return {
|
|
@@ -472,35 +472,35 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
472
472
|
y: i,
|
|
473
473
|
posWithOffset: r
|
|
474
474
|
};
|
|
475
|
-
}, "getCommitPosition"), Q = /* @__PURE__ */
|
|
476
|
-
let a = e.append("g").attr("class", "commit-bullets"), o = e.append("g").attr("class", "commit-labels"), s = J === "TB" || J === "BT" ? W : 0, c = [...
|
|
477
|
-
let r =
|
|
475
|
+
}, "getCommitPosition"), Q = /* @__PURE__ */ i((e, t, n, r) => {
|
|
476
|
+
let a = e.append("g").attr("class", "commit-bullets"), o = e.append("g").attr("class", "commit-labels"), s = J === "TB" || J === "BT" ? W : 0, c = [...t.keys()], l = r.parallelCommits ?? !1, u = /* @__PURE__ */ i((e, n) => {
|
|
477
|
+
let r = t.get(e)?.seq, i = t.get(n)?.seq;
|
|
478
478
|
return r !== void 0 && i !== void 0 ? r - i : 0;
|
|
479
479
|
}, "sortKeys"), d = c.sort(u);
|
|
480
|
-
J === "BT" && (l && ge(d,
|
|
481
|
-
let
|
|
482
|
-
if (!
|
|
483
|
-
l && (s = we(
|
|
484
|
-
let c = Te(
|
|
485
|
-
if (
|
|
486
|
-
let e = Ce(
|
|
487
|
-
xe(a,
|
|
480
|
+
J === "BT" && (l && ge(d, t, s), d = d.reverse()), d.forEach((e) => {
|
|
481
|
+
let i = t.get(e);
|
|
482
|
+
if (!i) throw Error(`Commit not found for key ${e}`);
|
|
483
|
+
l && (s = we(i, J, s, U));
|
|
484
|
+
let c = Te(i, s, l);
|
|
485
|
+
if (n) {
|
|
486
|
+
let e = Ce(i), t = i.customType ?? i.type;
|
|
487
|
+
xe(a, i, c, e, H.get(i.branch)?.index ?? 0, t), Se(o, i, c, s, r), Z(o, i, c, s);
|
|
488
488
|
}
|
|
489
|
-
J === "TB" || J === "BT" ? U.set(
|
|
489
|
+
J === "TB" || J === "BT" ? U.set(i.id, {
|
|
490
490
|
x: c.x,
|
|
491
491
|
y: c.posWithOffset
|
|
492
|
-
}) : U.set(
|
|
492
|
+
}) : U.set(i.id, {
|
|
493
493
|
x: c.posWithOffset,
|
|
494
494
|
y: c.y
|
|
495
495
|
}), s = J === "BT" && l ? s + R : s + R + L, s > q && (q = s);
|
|
496
496
|
});
|
|
497
|
-
}, "drawCommits"), Ee = /* @__PURE__ */
|
|
498
|
-
let o = (J === "TB" || J === "BT" ?
|
|
497
|
+
}, "drawCommits"), Ee = /* @__PURE__ */ i((e, t, n, r, a) => {
|
|
498
|
+
let o = (J === "TB" || J === "BT" ? n.x < r.x : n.y < r.y) ? t.branch : e.branch, s = /* @__PURE__ */ i((e) => e.branch === o, "isOnBranchToGetCurve"), c = /* @__PURE__ */ i((n) => n.seq > e.seq && n.seq < t.seq, "isBetweenCommits");
|
|
499
499
|
return [...a.values()].some((e) => c(e) && s(e));
|
|
500
|
-
}, "shouldRerouteArrow"), $ = /* @__PURE__ */
|
|
500
|
+
}, "shouldRerouteArrow"), $ = /* @__PURE__ */ i((e, t, n = 0) => {
|
|
501
501
|
let r = e + Math.abs(e - t) / 2;
|
|
502
502
|
return n > 5 ? r : K.every((e) => Math.abs(e - r) >= 10) ? (K.push(r), r) : $(e, t - Math.abs(e - t) / 5, n + 1);
|
|
503
|
-
}, "findLane"), De = /* @__PURE__ */
|
|
503
|
+
}, "findLane"), De = /* @__PURE__ */ i((e, t, n, r) => {
|
|
504
504
|
let i = U.get(t.id), a = U.get(n.id);
|
|
505
505
|
if (i === void 0 || a === void 0) throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);
|
|
506
506
|
let o = Ee(t, n, i, a, r), s = "", c = "", l = 0, u = 0, d = H.get(n.branch)?.index;
|
|
@@ -513,7 +513,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
513
513
|
} else s = "A 20 20, 0, 0, 0,", c = "A 20 20, 0, 0, 1,", l = 20, u = 20, J === "TB" ? (i.x < a.x && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y - l} ${s} ${i.x + u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${c} ${a.x} ${i.y + u} L ${a.x} ${a.y}`), i.x > a.x && (s = "A 20 20, 0, 0, 0,", c = "A 20 20, 0, 0, 1,", l = 20, u = 20, f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y - l} ${c} ${i.x - u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x + l} ${i.y} ${s} ${a.x} ${i.y + u} L ${a.x} ${a.y}`), i.x === a.x && (f = `M ${i.x} ${i.y} L ${a.x} ${a.y}`)) : J === "BT" ? (i.x < a.x && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y + l} ${c} ${i.x + u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${s} ${a.x} ${i.y - u} L ${a.x} ${a.y}`), i.x > a.x && (s = "A 20 20, 0, 0, 0,", c = "A 20 20, 0, 0, 1,", l = 20, u = 20, f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y + l} ${s} ${i.x - u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x + l} ${i.y} ${c} ${a.x} ${i.y - u} L ${a.x} ${a.y}`), i.x === a.x && (f = `M ${i.x} ${i.y} L ${a.x} ${a.y}`)) : (i.y < a.y && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${c} ${a.x} ${i.y + u} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${i.x} ${a.y - l} ${s} ${i.x + u} ${a.y} L ${a.x} ${a.y}`), i.y > a.y && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${s} ${a.x} ${i.y - u} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${i.x} ${a.y + l} ${c} ${i.x + u} ${a.y} L ${a.x} ${a.y}`), i.y === a.y && (f = `M ${i.x} ${i.y} L ${a.x} ${a.y}`));
|
|
514
514
|
if (f === void 0) throw Error("Line definition not found");
|
|
515
515
|
e.append("path").attr("d", f).attr("class", "arrow arrow" + d % V);
|
|
516
|
-
}, "drawArrow"), Oe = /* @__PURE__ */
|
|
516
|
+
}, "drawArrow"), Oe = /* @__PURE__ */ i((e, t) => {
|
|
517
517
|
let n = e.append("g").attr("class", "commit-arrows");
|
|
518
518
|
[...t.keys()].forEach((e) => {
|
|
519
519
|
let r = t.get(e);
|
|
@@ -521,7 +521,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
521
521
|
De(n, t.get(e), r, t);
|
|
522
522
|
});
|
|
523
523
|
});
|
|
524
|
-
}, "drawArrows"), ke = /* @__PURE__ */
|
|
524
|
+
}, "drawArrows"), ke = /* @__PURE__ */ i((e, t, n) => {
|
|
525
525
|
let r = e.append("g");
|
|
526
526
|
t.forEach((e, t) => {
|
|
527
527
|
let i = t % V, a = H.get(e.name)?.pos;
|
|
@@ -533,7 +533,7 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
533
533
|
let d = c.getBBox();
|
|
534
534
|
l.attr("class", "branchLabelBkg label" + i).attr("rx", 4).attr("ry", 4).attr("x", -d.width - 4 - (n.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -d.height / 2 + 8).attr("width", d.width + 18).attr("height", d.height + 4), u.attr("transform", "translate(" + (-d.width - 14 - (n.rotateCommitLabel === !0 ? 30 : 0)) + ", " + (a - d.height / 2 - 1) + ")"), J === "TB" ? (l.attr("x", a - d.width / 2 - 10).attr("y", 0), u.attr("transform", "translate(" + (a - d.width / 2 - 5) + ", 0)")) : J === "BT" ? (l.attr("x", a - d.width / 2 - 10).attr("y", q), u.attr("transform", "translate(" + (a - d.width / 2 - 5) + ", " + q + ")")) : l.attr("transform", "translate(-19, " + (a - d.height / 2) + ")");
|
|
535
535
|
});
|
|
536
|
-
}, "drawBranches"), Ae = /* @__PURE__ */
|
|
536
|
+
}, "drawBranches"), Ae = /* @__PURE__ */ i(function(e, t, n, r, i) {
|
|
537
537
|
return H.set(e, {
|
|
538
538
|
pos: t,
|
|
539
539
|
index: n
|
|
@@ -541,26 +541,26 @@ var le = /* @__PURE__ */ t(function() {
|
|
|
541
541
|
}, "setBranchPosition"), je = {
|
|
542
542
|
parser: I,
|
|
543
543
|
db: O,
|
|
544
|
-
renderer: { draw: /* @__PURE__ */
|
|
545
|
-
me(),
|
|
544
|
+
renderer: { draw: /* @__PURE__ */ i(function(t, n, i, o) {
|
|
545
|
+
me(), r.debug("in gitgraph renderer", t + "\n", "id:", n, i);
|
|
546
546
|
let s = o.db;
|
|
547
547
|
if (!s.getConfig) {
|
|
548
|
-
|
|
548
|
+
r.error("getConfig method is not available on db");
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
551
|
let c = s.getConfig(), l = c.rotateCommitLabel ?? !1;
|
|
552
552
|
G = s.getCommits();
|
|
553
553
|
let u = s.getBranchesAsObjArray();
|
|
554
554
|
J = s.getDirection();
|
|
555
|
-
let d =
|
|
555
|
+
let d = a(`[id="${n}"]`), f = 0;
|
|
556
556
|
u.forEach((e, t) => {
|
|
557
557
|
let n = Y(e.name), r = d.append("g"), i = r.insert("g").attr("class", "branchLabel"), a = i.insert("g").attr("class", "label branch-label");
|
|
558
558
|
a.node()?.appendChild(n);
|
|
559
559
|
let o = n.getBBox();
|
|
560
560
|
f = Ae(e.name, f, t, o, l), a.remove(), i.remove(), r.remove();
|
|
561
|
-
}), Q(d, G, !1, c), c.showBranches && ke(d, u, c), Oe(d, G), Q(d, G, !0, c),
|
|
561
|
+
}), Q(d, G, !1, c), c.showBranches && ke(d, u, c), Oe(d, G), Q(d, G, !0, c), e.insertTitle(d, "gitTitleText", c.titleTopMargin ?? 0, s.getDiagramTitle()), ee(void 0, d, c.diagramPadding, c.useMaxWidth);
|
|
562
562
|
}, "draw") },
|
|
563
|
-
styles: /* @__PURE__ */
|
|
563
|
+
styles: /* @__PURE__ */ i((e) => `
|
|
564
564
|
.commit-id,
|
|
565
565
|
.commit-msg,
|
|
566
566
|
.branch-label {
|