bg-editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/README.md +51 -0
- package/README.zh-CN.md +51 -0
- package/dist/_basePickBy-4kmg42pS.js +158 -0
- package/dist/_baseUniq-WOvvCHTI.js +621 -0
- package/dist/arc-wItjmL5I.js +90 -0
- package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
- package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
- package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
- package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
- package/dist/channel-Dah4F59k.js +12 -0
- package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
- package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
- package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
- package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
- package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
- package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
- package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
- package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
- package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
- package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
- package/dist/clone-C74UiRbr.js +15 -0
- package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
- package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
- package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
- package/dist/defaultLocale-DgmhL6Re.js +178 -0
- package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
- package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
- package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
- package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
- package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
- package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
- package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
- package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
- package/dist/graph-CnOTx4E0.js +254 -0
- package/dist/index-D6-Wf75-.js +122127 -0
- package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
- package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
- package/dist/init-d639unba.js +23 -0
- package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
- package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
- package/dist/layout-OXk4OSoz.js +1342 -0
- package/dist/linear-CO_vz87n.js +266 -0
- package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
- package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
- package/dist/ordinal-CofNqUw2.js +68 -0
- package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
- package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
- package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
- package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
- package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
- package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
- package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
- package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
- package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
- package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
- package/dist/style.css +1 -0
- package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
- package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
- package/dist/umo-editor.js +16 -0
- package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
- package/package.json +200 -0
- package/types/index.d.ts +277 -0
- package/types/src/components/index.d.ts +9 -0
- package/types/src/components/menus/button.vue.d.ts +583 -0
- package/types/src/components/modal.vue.d.ts +2 -0
- package/types/src/components/tooltip.vue.d.ts +27 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
import { i as a } from "./init-d639unba.js";
|
|
3
|
+
/**
|
|
4
|
+
* @umoteam/editor 9.0.1
|
|
5
|
+
* @license MIT
|
|
6
|
+
* @author umodoc https://www.umodoc.com
|
|
7
|
+
* @see https://www.umodoc.com
|
|
8
|
+
**/
|
|
9
|
+
class o extends Map {
|
|
10
|
+
constructor(n, t = g) {
|
|
11
|
+
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null) for (const [r, s] of n) this.set(r, s);
|
|
12
|
+
}
|
|
13
|
+
get(n) {
|
|
14
|
+
return super.get(c(this, n));
|
|
15
|
+
}
|
|
16
|
+
has(n) {
|
|
17
|
+
return super.has(c(this, n));
|
|
18
|
+
}
|
|
19
|
+
set(n, t) {
|
|
20
|
+
return super.set(p(this, n), t);
|
|
21
|
+
}
|
|
22
|
+
delete(n) {
|
|
23
|
+
return super.delete(l(this, n));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function c({ _intern: e, _key: n }, t) {
|
|
27
|
+
const r = n(t);
|
|
28
|
+
return e.has(r) ? e.get(r) : t;
|
|
29
|
+
}
|
|
30
|
+
function p({ _intern: e, _key: n }, t) {
|
|
31
|
+
const r = n(t);
|
|
32
|
+
return e.has(r) ? e.get(r) : (e.set(r, t), t);
|
|
33
|
+
}
|
|
34
|
+
function l({ _intern: e, _key: n }, t) {
|
|
35
|
+
const r = n(t);
|
|
36
|
+
return e.has(r) && (t = e.get(r), e.delete(r)), t;
|
|
37
|
+
}
|
|
38
|
+
function g(e) {
|
|
39
|
+
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
40
|
+
}
|
|
41
|
+
const f = Symbol("implicit");
|
|
42
|
+
function h() {
|
|
43
|
+
var e = new o(), n = [], t = [], r = f;
|
|
44
|
+
function s(i) {
|
|
45
|
+
let u = e.get(i);
|
|
46
|
+
if (u === void 0) {
|
|
47
|
+
if (r !== f) return r;
|
|
48
|
+
e.set(i, u = n.push(i) - 1);
|
|
49
|
+
}
|
|
50
|
+
return t[u % t.length];
|
|
51
|
+
}
|
|
52
|
+
return s.domain = function(i) {
|
|
53
|
+
if (!arguments.length) return n.slice();
|
|
54
|
+
n = [], e = new o();
|
|
55
|
+
for (const u of i)
|
|
56
|
+
e.has(u) || e.set(u, n.push(u) - 1);
|
|
57
|
+
return s;
|
|
58
|
+
}, s.range = function(i) {
|
|
59
|
+
return arguments.length ? (t = Array.from(i), s) : t.slice();
|
|
60
|
+
}, s.unknown = function(i) {
|
|
61
|
+
return arguments.length ? (r = i, s) : r;
|
|
62
|
+
}, s.copy = function() {
|
|
63
|
+
return h(n, t).unknown(r);
|
|
64
|
+
}, a.apply(s, arguments), s;
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
h as o
|
|
68
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
import { P as t, a as c } from "./mermaid-parser.core-CYtF6phW.js";
|
|
3
|
+
/**
|
|
4
|
+
* @umoteam/editor 9.0.1
|
|
5
|
+
* @license MIT
|
|
6
|
+
* @author umodoc https://www.umodoc.com
|
|
7
|
+
* @see https://www.umodoc.com
|
|
8
|
+
**/
|
|
9
|
+
export {
|
|
10
|
+
t as PacketModule,
|
|
11
|
+
c as createPacketServices
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
import { b as o, d as a } from "./mermaid-parser.core-CYtF6phW.js";
|
|
3
|
+
/**
|
|
4
|
+
* @umoteam/editor 9.0.1
|
|
5
|
+
* @license MIT
|
|
6
|
+
* @author umodoc https://www.umodoc.com
|
|
7
|
+
* @see https://www.umodoc.com
|
|
8
|
+
**/
|
|
9
|
+
export {
|
|
10
|
+
o as PieModule,
|
|
11
|
+
a as createPieServices
|
|
12
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
import { a8 as S, a3 as F, aG as j, _ as p, g as q, s as H, a as Z, b as J, q as K, p as Q, l as z, c as X, D as Y, H as ee, N as te, e as ae, y as re, F as ne } from "./index-D6-Wf75-.js";
|
|
3
|
+
import { p as ie } from "./chunk-4BX2VUAB-5_v9rnje.js";
|
|
4
|
+
import { p as se } from "./mermaid-parser.core-CYtF6phW.js";
|
|
5
|
+
import { d as I } from "./arc-wItjmL5I.js";
|
|
6
|
+
import { o as le } from "./ordinal-CofNqUw2.js";
|
|
7
|
+
/**
|
|
8
|
+
* @umoteam/editor 9.0.1
|
|
9
|
+
* @license MIT
|
|
10
|
+
* @author umodoc https://www.umodoc.com
|
|
11
|
+
* @see https://www.umodoc.com
|
|
12
|
+
**/
|
|
13
|
+
function oe(e, a) {
|
|
14
|
+
return a < e ? -1 : a > e ? 1 : a >= e ? 0 : NaN;
|
|
15
|
+
}
|
|
16
|
+
function ce(e) {
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function ue() {
|
|
20
|
+
var e = ce, a = oe, f = null, y = S(0), s = S(F), o = S(0);
|
|
21
|
+
function l(t) {
|
|
22
|
+
var n, c = (t = j(t)).length, d, x, m = 0, u = new Array(c), i = new Array(c), v = +y.apply(this, arguments), w = Math.min(F, Math.max(-F, s.apply(this, arguments) - v)), h, C = Math.min(Math.abs(w) / c, o.apply(this, arguments)), $ = C * (w < 0 ? -1 : 1), g;
|
|
23
|
+
for (n = 0; n < c; ++n)
|
|
24
|
+
(g = i[u[n] = n] = +e(t[n], n, t)) > 0 && (m += g);
|
|
25
|
+
for (a != null ? u.sort(function(A, D) {
|
|
26
|
+
return a(i[A], i[D]);
|
|
27
|
+
}) : f != null && u.sort(function(A, D) {
|
|
28
|
+
return f(t[A], t[D]);
|
|
29
|
+
}), n = 0, x = m ? (w - c * $) / m : 0; n < c; ++n, v = h)
|
|
30
|
+
d = u[n], g = i[d], h = v + (g > 0 ? g * x : 0) + $, i[d] = {
|
|
31
|
+
data: t[d],
|
|
32
|
+
index: n,
|
|
33
|
+
value: g,
|
|
34
|
+
startAngle: v,
|
|
35
|
+
endAngle: h,
|
|
36
|
+
padAngle: C
|
|
37
|
+
};
|
|
38
|
+
return i;
|
|
39
|
+
}
|
|
40
|
+
return l.value = function(t) {
|
|
41
|
+
return arguments.length ? (e = typeof t == "function" ? t : S(+t), l) : e;
|
|
42
|
+
}, l.sortValues = function(t) {
|
|
43
|
+
return arguments.length ? (a = t, f = null, l) : a;
|
|
44
|
+
}, l.sort = function(t) {
|
|
45
|
+
return arguments.length ? (f = t, a = null, l) : f;
|
|
46
|
+
}, l.startAngle = function(t) {
|
|
47
|
+
return arguments.length ? (y = typeof t == "function" ? t : S(+t), l) : y;
|
|
48
|
+
}, l.endAngle = function(t) {
|
|
49
|
+
return arguments.length ? (s = typeof t == "function" ? t : S(+t), l) : s;
|
|
50
|
+
}, l.padAngle = function(t) {
|
|
51
|
+
return arguments.length ? (o = typeof t == "function" ? t : S(+t), l) : o;
|
|
52
|
+
}, l;
|
|
53
|
+
}
|
|
54
|
+
var pe = ne.pie, G = {
|
|
55
|
+
sections: /* @__PURE__ */ new Map(),
|
|
56
|
+
showData: !1
|
|
57
|
+
}, T = G.sections, N = G.showData, de = structuredClone(pe), ge = /* @__PURE__ */ p(() => structuredClone(de), "getConfig"), fe = /* @__PURE__ */ p(() => {
|
|
58
|
+
T = /* @__PURE__ */ new Map(), N = G.showData, re();
|
|
59
|
+
}, "clear"), he = /* @__PURE__ */ p(({ label: e, value: a }) => {
|
|
60
|
+
if (a < 0)
|
|
61
|
+
throw new Error(
|
|
62
|
+
`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
|
|
63
|
+
);
|
|
64
|
+
T.has(e) || (T.set(e, a), z.debug(`added new section: ${e}, with value: ${a}`));
|
|
65
|
+
}, "addSection"), me = /* @__PURE__ */ p(() => T, "getSections"), ve = /* @__PURE__ */ p((e) => {
|
|
66
|
+
N = e;
|
|
67
|
+
}, "setShowData"), Se = /* @__PURE__ */ p(() => N, "getShowData"), L = {
|
|
68
|
+
getConfig: ge,
|
|
69
|
+
clear: fe,
|
|
70
|
+
setDiagramTitle: Q,
|
|
71
|
+
getDiagramTitle: K,
|
|
72
|
+
setAccTitle: J,
|
|
73
|
+
getAccTitle: Z,
|
|
74
|
+
setAccDescription: H,
|
|
75
|
+
getAccDescription: q,
|
|
76
|
+
addSection: he,
|
|
77
|
+
getSections: me,
|
|
78
|
+
setShowData: ve,
|
|
79
|
+
getShowData: Se
|
|
80
|
+
}, ye = /* @__PURE__ */ p((e, a) => {
|
|
81
|
+
ie(e, a), a.setShowData(e.showData), e.sections.map(a.addSection);
|
|
82
|
+
}, "populateDb"), xe = {
|
|
83
|
+
parse: /* @__PURE__ */ p(async (e) => {
|
|
84
|
+
const a = await se("pie", e);
|
|
85
|
+
z.debug(a), ye(a, L);
|
|
86
|
+
}, "parse")
|
|
87
|
+
}, we = /* @__PURE__ */ p((e) => `
|
|
88
|
+
.pieCircle{
|
|
89
|
+
stroke: ${e.pieStrokeColor};
|
|
90
|
+
stroke-width : ${e.pieStrokeWidth};
|
|
91
|
+
opacity : ${e.pieOpacity};
|
|
92
|
+
}
|
|
93
|
+
.pieOuterCircle{
|
|
94
|
+
stroke: ${e.pieOuterStrokeColor};
|
|
95
|
+
stroke-width: ${e.pieOuterStrokeWidth};
|
|
96
|
+
fill: none;
|
|
97
|
+
}
|
|
98
|
+
.pieTitleText {
|
|
99
|
+
text-anchor: middle;
|
|
100
|
+
font-size: ${e.pieTitleTextSize};
|
|
101
|
+
fill: ${e.pieTitleTextColor};
|
|
102
|
+
font-family: ${e.fontFamily};
|
|
103
|
+
}
|
|
104
|
+
.slice {
|
|
105
|
+
font-family: ${e.fontFamily};
|
|
106
|
+
fill: ${e.pieSectionTextColor};
|
|
107
|
+
font-size:${e.pieSectionTextSize};
|
|
108
|
+
// fill: white;
|
|
109
|
+
}
|
|
110
|
+
.legend text {
|
|
111
|
+
fill: ${e.pieLegendTextColor};
|
|
112
|
+
font-family: ${e.fontFamily};
|
|
113
|
+
font-size: ${e.pieLegendTextSize};
|
|
114
|
+
}
|
|
115
|
+
`, "getStyles"), Ae = we, De = /* @__PURE__ */ p((e) => {
|
|
116
|
+
const a = [...e.values()].reduce((s, o) => s + o, 0), f = [...e.entries()].map(([s, o]) => ({ label: s, value: o })).filter((s) => s.value / a * 100 >= 1).sort((s, o) => o.value - s.value);
|
|
117
|
+
return ue().value((s) => s.value)(f);
|
|
118
|
+
}, "createPieArcs"), Ce = /* @__PURE__ */ p((e, a, f, y) => {
|
|
119
|
+
z.debug(`rendering pie chart
|
|
120
|
+
` + e);
|
|
121
|
+
const s = y.db, o = X(), l = Y(s.getConfig(), o.pie), t = 40, n = 18, c = 4, d = 450, x = d, m = ee(a), u = m.append("g");
|
|
122
|
+
u.attr("transform", "translate(" + x / 2 + "," + d / 2 + ")");
|
|
123
|
+
const { themeVariables: i } = o;
|
|
124
|
+
let [v] = te(i.pieOuterStrokeWidth);
|
|
125
|
+
v ?? (v = 2);
|
|
126
|
+
const w = l.textPosition, h = Math.min(x, d) / 2 - t, C = I().innerRadius(0).outerRadius(h), $ = I().innerRadius(h * w).outerRadius(h * w);
|
|
127
|
+
u.append("circle").attr("cx", 0).attr("cy", 0).attr("r", h + v / 2).attr("class", "pieOuterCircle");
|
|
128
|
+
const g = s.getSections(), A = De(g), D = [
|
|
129
|
+
i.pie1,
|
|
130
|
+
i.pie2,
|
|
131
|
+
i.pie3,
|
|
132
|
+
i.pie4,
|
|
133
|
+
i.pie5,
|
|
134
|
+
i.pie6,
|
|
135
|
+
i.pie7,
|
|
136
|
+
i.pie8,
|
|
137
|
+
i.pie9,
|
|
138
|
+
i.pie10,
|
|
139
|
+
i.pie11,
|
|
140
|
+
i.pie12
|
|
141
|
+
];
|
|
142
|
+
let b = 0;
|
|
143
|
+
g.forEach((r) => {
|
|
144
|
+
b += r;
|
|
145
|
+
});
|
|
146
|
+
const W = A.filter((r) => (r.data.value / b * 100).toFixed(0) !== "0"), E = le(D);
|
|
147
|
+
u.selectAll("mySlices").data(W).enter().append("path").attr("d", C).attr("fill", (r) => E(r.data.label)).attr("class", "pieCircle"), u.selectAll("mySlices").data(W).enter().append("text").text((r) => (r.data.value / b * 100).toFixed(0) + "%").attr("transform", (r) => "translate(" + $.centroid(r) + ")").style("text-anchor", "middle").attr("class", "slice"), u.append("text").text(s.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
|
|
148
|
+
const O = [...g.entries()].map(([r, M]) => ({
|
|
149
|
+
label: r,
|
|
150
|
+
value: M
|
|
151
|
+
})), k = u.selectAll(".legend").data(O).enter().append("g").attr("class", "legend").attr("transform", (r, M) => {
|
|
152
|
+
const R = n + c, B = R * O.length / 2, V = 12 * n, U = M * R - B;
|
|
153
|
+
return "translate(" + V + "," + U + ")";
|
|
154
|
+
});
|
|
155
|
+
k.append("rect").attr("width", n).attr("height", n).style("fill", (r) => E(r.label)).style("stroke", (r) => E(r.label)), k.append("text").attr("x", n + c).attr("y", n - c).text((r) => s.getShowData() ? `${r.label} [${r.value}]` : r.label);
|
|
156
|
+
const _ = Math.max(
|
|
157
|
+
...k.selectAll("text").nodes().map((r) => r?.getBoundingClientRect().width ?? 0)
|
|
158
|
+
), P = x + t + n + c + _;
|
|
159
|
+
m.attr("viewBox", `0 0 ${P} ${d}`), ae(m, d, P, l.useMaxWidth);
|
|
160
|
+
}, "draw"), $e = { draw: Ce }, ze = {
|
|
161
|
+
parser: xe,
|
|
162
|
+
db: L,
|
|
163
|
+
renderer: $e,
|
|
164
|
+
styles: Ae
|
|
165
|
+
};
|
|
166
|
+
export {
|
|
167
|
+
ze as diagram
|
|
168
|
+
};
|