bg-editor 0.0.7 → 0.0.8
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/umo-editor.js +89809 -7
- package/package.json +21 -1
- package/dist/_baseUniq-CK68Es8H.js +0 -473
- package/dist/arc-cD-4ba7d.js +0 -84
- package/dist/architecture-U656AL7Q-jxTBuJdN.js +0 -6
- package/dist/architectureDiagram-VXUJARFQ-D3XlpFhb.js +0 -4660
- package/dist/blockDiagram-VD42YOAC-BslbvMOG.js +0 -2262
- package/dist/c4Diagram-YG6GDRKO-DD3uWYPM.js +0 -1581
- package/dist/channel-DjTSKqWx.js +0 -6
- package/dist/chunk-4BX2VUAB-lfhsh4gk.js +0 -9
- package/dist/chunk-55IACEB6-O42zw0MT.js +0 -9
- package/dist/chunk-B4BG7PRW-CAose2Ox.js +0 -1376
- package/dist/chunk-DI55MBZ5-DkOlwdzs.js +0 -1371
- package/dist/chunk-FMBD7UC4-XviEvZms.js +0 -20
- package/dist/chunk-QN33PNHL-CNGSzgpw.js +0 -20
- package/dist/chunk-QZHKN3VN-CRgLUJXR.js +0 -16
- package/dist/chunk-TZMSLE5B-BkHNUxTN.js +0 -65
- package/dist/classDiagram-2ON5EDUG-Cakz_SCw.js +0 -17
- package/dist/classDiagram-v2-WZHVMYZB-Cakz_SCw.js +0 -17
- package/dist/clone-CIrbb4_D.js +0 -9
- package/dist/cose-bilkent-S5V4N54A-EoSlB5N_.js +0 -2606
- package/dist/cytoscape.esm-DoU_GB5M.js +0 -18732
- package/dist/dagre-6UL2VRFP-BPH1NIvl.js +0 -444
- package/dist/defaultLocale-DEnRyJdC.js +0 -172
- package/dist/diagram-PSM6KHXK-DCRoLhFv.js +0 -396
- package/dist/diagram-QEK2KX5R-2gxFpsCA.js +0 -218
- package/dist/diagram-S2PKOQOG-BIPpN2G8.js +0 -143
- package/dist/erDiagram-Q2GNP2WA-pfb2dpnp.js +0 -842
- package/dist/flowDiagram-NV44I4VS-Dv631-Fh.js +0 -1621
- package/dist/ganttDiagram-LVOFAZNH-BOKYXijK.js +0 -2500
- package/dist/gitGraph-F6HP7TQM-CRerkbyh.js +0 -6
- package/dist/gitGraphDiagram-NY62KEGX-CgO9x7O1.js +0 -700
- package/dist/graph-CG-rVaun.js +0 -382
- package/dist/index-LPeu-5gp.js +0 -164788
- package/dist/info-NVLQJR56-CZcMDuD4.js +0 -6
- package/dist/infoDiagram-ER5ION4S-CpfjxDXT.js +0 -25
- package/dist/init-Dbt-6wo9.js +0 -17
- package/dist/journeyDiagram-XKPGCS4Q-D4m1xk_j.js +0 -837
- package/dist/kanban-definition-3W4ZIXB7-GUMW-GDO.js +0 -719
- package/dist/layout-C7pGfQvF.js +0 -1416
- package/dist/linear-CQdBpz9H.js +0 -260
- package/dist/mermaid-parser.core-C3Lk4un7.js +0 -14143
- package/dist/min-D7xNMq31.js +0 -39
- package/dist/mindmap-definition-VGOIOE7T-GfQh2q9s.js +0 -784
- package/dist/ordinal-mgyNSFm_.js +0 -62
- package/dist/packet-BFZMPI3H-DughJE3g.js +0 -6
- package/dist/pie-7BOR55EZ-B1py7mee.js +0 -6
- package/dist/pieDiagram-ADFJNKIX-DENmX4xL.js +0 -162
- package/dist/quadrantDiagram-AYHSOK5B-BFVycH-W.js +0 -1023
- package/dist/radar-NHE76QYJ-DuTW4rXt.js +0 -6
- package/dist/requirementDiagram-UZGBJVZJ-f8rb43Mp.js +0 -851
- package/dist/sankeyDiagram-TZEHDZUN-CUN0tZ5p.js +0 -811
- package/dist/sequenceDiagram-WL72ISMW-7X4nul9T.js +0 -2512
- package/dist/stateDiagram-FKZM4ZOC-CypL793K.js +0 -264
- package/dist/stateDiagram-v2-4FDKWEC3-D5vS5FM5.js +0 -17
- package/dist/timeline-definition-IT6M3QCI-B_WOoOGO.js +0 -798
- package/dist/treemap-KMMF4GRG-BzINyJBJ.js +0 -6
- package/dist/xychartDiagram-PRI3JC2R-Llw16NDY.js +0 -1341
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import "./style.css";
|
|
2
|
-
import { _ as b, D as m, H as B, e as C, l as w, b as S, a as D, p as T, q as E, g as F, s as P, E as z, F as A, y as W } from "./index-LPeu-5gp.js";
|
|
3
|
-
import { p as _ } from "./chunk-4BX2VUAB-lfhsh4gk.js";
|
|
4
|
-
import { p as N } from "./mermaid-parser.core-C3Lk4un7.js";
|
|
5
|
-
var L = A.packet, u, v = (u = class {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.packet = [], this.setAccTitle = S, this.getAccTitle = D, this.setDiagramTitle = T, this.getDiagramTitle = E, this.getAccDescription = F, this.setAccDescription = P;
|
|
8
|
-
}
|
|
9
|
-
getConfig() {
|
|
10
|
-
const t = m({
|
|
11
|
-
...L,
|
|
12
|
-
...z().packet
|
|
13
|
-
});
|
|
14
|
-
return t.showBits && (t.paddingY += 10), t;
|
|
15
|
-
}
|
|
16
|
-
getPacket() {
|
|
17
|
-
return this.packet;
|
|
18
|
-
}
|
|
19
|
-
pushWord(t) {
|
|
20
|
-
t.length > 0 && this.packet.push(t);
|
|
21
|
-
}
|
|
22
|
-
clear() {
|
|
23
|
-
W(), this.packet = [];
|
|
24
|
-
}
|
|
25
|
-
}, b(u, "PacketDB"), u), M = 1e4, Y = /* @__PURE__ */ b((e, t) => {
|
|
26
|
-
_(e, t);
|
|
27
|
-
let r = -1, s = [], n = 1;
|
|
28
|
-
const { bitsPerRow: l } = t.getConfig();
|
|
29
|
-
for (let { start: a, end: i, bits: d, label: c } of e.blocks) {
|
|
30
|
-
if (a !== void 0 && i !== void 0 && i < a)
|
|
31
|
-
throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);
|
|
32
|
-
if (a ?? (a = r + 1), a !== r + 1)
|
|
33
|
-
throw new Error(
|
|
34
|
-
`Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${r + 1}.`
|
|
35
|
-
);
|
|
36
|
-
if (d === 0)
|
|
37
|
-
throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
|
|
38
|
-
for (i ?? (i = a + (d ?? 1) - 1), d ?? (d = i - a + 1), r = i, w.debug(`Packet block ${a} - ${r} with label ${c}`); s.length <= l + 1 && t.getPacket().length < M; ) {
|
|
39
|
-
const [p, o] = H({ start: a, end: i, bits: d, label: c }, n, l);
|
|
40
|
-
if (s.push(p), p.end + 1 === n * l && (t.pushWord(s), s = [], n++), !o)
|
|
41
|
-
break;
|
|
42
|
-
({ start: a, end: i, bits: d, label: c } = o);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
t.pushWord(s);
|
|
46
|
-
}, "populate"), H = /* @__PURE__ */ b((e, t, r) => {
|
|
47
|
-
if (e.start === void 0)
|
|
48
|
-
throw new Error("start should have been set during first phase");
|
|
49
|
-
if (e.end === void 0)
|
|
50
|
-
throw new Error("end should have been set during first phase");
|
|
51
|
-
if (e.start > e.end)
|
|
52
|
-
throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
|
|
53
|
-
if (e.end + 1 <= t * r)
|
|
54
|
-
return [e, void 0];
|
|
55
|
-
const s = t * r - 1, n = t * r;
|
|
56
|
-
return [
|
|
57
|
-
{
|
|
58
|
-
start: e.start,
|
|
59
|
-
end: s,
|
|
60
|
-
label: e.label,
|
|
61
|
-
bits: s - e.start
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
start: n,
|
|
65
|
-
end: e.end,
|
|
66
|
-
label: e.label,
|
|
67
|
-
bits: e.end - n
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
}, "getNextFittingBlock"), x = {
|
|
71
|
-
// @ts-expect-error - PacketDB is not assignable to DiagramDB
|
|
72
|
-
parser: { yy: void 0 },
|
|
73
|
-
parse: /* @__PURE__ */ b(async (e) => {
|
|
74
|
-
const t = await N("packet", e), r = x.parser?.yy;
|
|
75
|
-
if (!(r instanceof v))
|
|
76
|
-
throw new Error(
|
|
77
|
-
"parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
|
|
78
|
-
);
|
|
79
|
-
w.debug(t), Y(t, r);
|
|
80
|
-
}, "parse")
|
|
81
|
-
}, I = /* @__PURE__ */ b((e, t, r, s) => {
|
|
82
|
-
const n = s.db, l = n.getConfig(), { rowHeight: a, paddingY: i, bitWidth: d, bitsPerRow: c } = l, p = n.getPacket(), o = n.getDiagramTitle(), h = a + i, g = h * (p.length + 1) - (o ? 0 : a), k = d * c + 2, f = B(t);
|
|
83
|
-
f.attr("viewbox", `0 0 ${k} ${g}`), C(f, g, k, l.useMaxWidth);
|
|
84
|
-
for (const [y, $] of p.entries())
|
|
85
|
-
O(f, $, y, l);
|
|
86
|
-
f.append("text").text(o).attr("x", k / 2).attr("y", g - h / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
87
|
-
}, "draw"), O = /* @__PURE__ */ b((e, t, r, { rowHeight: s, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
|
|
88
|
-
const c = e.append("g"), p = r * (s + l) + l;
|
|
89
|
-
for (const o of t) {
|
|
90
|
-
const h = o.start % i * a + 1, g = (o.end - o.start + 1) * a - n;
|
|
91
|
-
if (c.append("rect").attr("x", h).attr("y", p).attr("width", g).attr("height", s).attr("class", "packetBlock"), c.append("text").attr("x", h + g / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(o.label), !d)
|
|
92
|
-
continue;
|
|
93
|
-
const k = o.end === o.start, f = p - 2;
|
|
94
|
-
c.append("text").attr("x", h + (k ? g / 2 : 0)).attr("y", f).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", k ? "middle" : "start").text(o.start), k || c.append("text").attr("x", h + g).attr("y", f).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(o.end);
|
|
95
|
-
}
|
|
96
|
-
}, "drawWord"), j = { draw: I }, q = {
|
|
97
|
-
byteFontSize: "10px",
|
|
98
|
-
startByteColor: "black",
|
|
99
|
-
endByteColor: "black",
|
|
100
|
-
labelColor: "black",
|
|
101
|
-
labelFontSize: "12px",
|
|
102
|
-
titleColor: "black",
|
|
103
|
-
titleFontSize: "14px",
|
|
104
|
-
blockStrokeColor: "black",
|
|
105
|
-
blockStrokeWidth: "1",
|
|
106
|
-
blockFillColor: "#efefef"
|
|
107
|
-
}, G = /* @__PURE__ */ b(({ packet: e } = {}) => {
|
|
108
|
-
const t = m(q, e);
|
|
109
|
-
return `
|
|
110
|
-
.packetByte {
|
|
111
|
-
font-size: ${t.byteFontSize};
|
|
112
|
-
}
|
|
113
|
-
.packetByte.start {
|
|
114
|
-
fill: ${t.startByteColor};
|
|
115
|
-
}
|
|
116
|
-
.packetByte.end {
|
|
117
|
-
fill: ${t.endByteColor};
|
|
118
|
-
}
|
|
119
|
-
.packetLabel {
|
|
120
|
-
fill: ${t.labelColor};
|
|
121
|
-
font-size: ${t.labelFontSize};
|
|
122
|
-
}
|
|
123
|
-
.packetTitle {
|
|
124
|
-
fill: ${t.titleColor};
|
|
125
|
-
font-size: ${t.titleFontSize};
|
|
126
|
-
}
|
|
127
|
-
.packetBlock {
|
|
128
|
-
stroke: ${t.blockStrokeColor};
|
|
129
|
-
stroke-width: ${t.blockStrokeWidth};
|
|
130
|
-
fill: ${t.blockFillColor};
|
|
131
|
-
}
|
|
132
|
-
`;
|
|
133
|
-
}, "styles"), J = {
|
|
134
|
-
parser: x,
|
|
135
|
-
get db() {
|
|
136
|
-
return new v();
|
|
137
|
-
},
|
|
138
|
-
renderer: j,
|
|
139
|
-
styles: G
|
|
140
|
-
};
|
|
141
|
-
export {
|
|
142
|
-
J as diagram
|
|
143
|
-
};
|