whipped 0.8.1 → 0.9.0
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/cli.js +1294 -259
- package/dist/mcp-server.js +150 -2
- package/dist/migrations/014_companion_sessions.sql +34 -0
- package/dist/migrations/015_companion_worktree_mode.sql +45 -0
- package/dist/migrations/016_companion_plans.sql +22 -0
- package/dist/migrations/017_companion_saved_plans.sql +23 -0
- package/dist/migrations/018_generalize_plan_session_ref.sql +29 -0
- package/dist/migrations/019_rename_plan_to_canvas.sql +20 -0
- package/dist/web-ui/assets/abnfDiagram-VRR7QNED-RwOyl_Kz.js +119 -0
- package/dist/web-ui/assets/arc-DmDBHE0H.js +131 -0
- package/dist/web-ui/assets/architectureDiagram-ZJ3FMSHR-RTwadm6J.js +8821 -0
- package/dist/web-ui/assets/blockDiagram-677ZJIJ3-Dvv5uMUE.js +3801 -0
- package/dist/web-ui/assets/c4Diagram-LMCZKHZV-bvr9R9cD.js +2479 -0
- package/dist/web-ui/assets/channel-BGhlETgZ.js +7 -0
- package/dist/web-ui/assets/chunk-2Q5K7J3B-BRq-Qbau.js +17 -0
- package/dist/web-ui/assets/chunk-32BRIVSS-Dy1BUZGx.js +116 -0
- package/dist/web-ui/assets/chunk-5VM5RSS4-DCUiIwIc.js +19 -0
- package/dist/web-ui/assets/chunk-EX3LRPZG-Cg_Vtzwz.js +1996 -0
- package/dist/web-ui/assets/chunk-JWPE2WC7-BW4n_ZhH.js +17 -0
- package/dist/web-ui/assets/chunk-MOJQB5TN-BykRa615.js +855 -0
- package/dist/web-ui/assets/chunk-RYQCIY6F-D4F7oV1d.js +476 -0
- package/dist/web-ui/assets/chunk-V7JOEXUC-DD4mm30h.js +2022 -0
- package/dist/web-ui/assets/chunk-VR4S4FIN-Fgvcluvk.js +25 -0
- package/dist/web-ui/assets/chunk-XXDRQBXY-C4FVmO5r.js +13 -0
- package/dist/web-ui/assets/classDiagram-OUVF2IWQ-DD4KIYF1.js +24 -0
- package/dist/web-ui/assets/classDiagram-v2-EOCWNBFH-DD4KIYF1.js +24 -0
- package/dist/web-ui/assets/cose-bilkent-JH36ORCC-ekFwvYt9.js +4943 -0
- package/dist/web-ui/assets/cynefin-VYW2F7L2-DTNV7gvQ.js +31527 -0
- package/dist/web-ui/assets/cynefinDiagram-TSTJHNR4-koYialeC.js +454 -0
- package/dist/web-ui/assets/cytoscape.esm-CaQ7Fomf.js +30346 -0
- package/dist/web-ui/assets/dagre-VKFMJZFB-Do43FV3o.js +526 -0
- package/dist/web-ui/assets/defaultLocale-B2RvLBDe.js +206 -0
- package/dist/web-ui/assets/diagram-FQU43EPY-D0STdny6.js +636 -0
- package/dist/web-ui/assets/diagram-G47NLZAW-D9g6BdZT.js +858 -0
- package/dist/web-ui/assets/diagram-NH7WQ7WH-zLW6CAmi.js +212 -0
- package/dist/web-ui/assets/diagram-OA4YK3LP-CA5tvsYw.js +492 -0
- package/dist/web-ui/assets/diagram-WEI45ONY-CLmYUHR0.js +309 -0
- package/dist/web-ui/assets/ebnfDiagram-CCIWWBDH-KkHubBI6.js +139 -0
- package/dist/web-ui/assets/erDiagram-Q63AITRT-BJna2u1n.js +1238 -0
- package/dist/web-ui/assets/flowDiagram-23GEKE2U-DVJKalah.js +2353 -0
- package/dist/web-ui/assets/ganttDiagram-NO4QXBWP-D9HwNV4u.js +3733 -0
- package/dist/web-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/web-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/web-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/web-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/web-ui/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
- package/dist/web-ui/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
- package/dist/web-ui/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
- package/dist/web-ui/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
- package/dist/web-ui/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
- package/dist/web-ui/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
- package/dist/web-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/web-ui/assets/gitGraphDiagram-IHSO6WYX-B7wnoO0J.js +1385 -0
- package/dist/web-ui/assets/graph-BMLV0goG.js +2042 -0
- package/dist/web-ui/assets/{index-CRXPsGTP.css → index-DPjATOCj.css} +800 -1207
- package/dist/web-ui/assets/{index-BMFVAmy4.js → index-DZ7I8r_C.js} +41392 -39594
- package/dist/web-ui/assets/infoDiagram-FWYZ7A6U-BY6XoiF8.js +32 -0
- package/dist/web-ui/assets/init-ZxktEp_H.js +16 -0
- package/dist/web-ui/assets/ishikawaDiagram-FXEZZL3T-BaZVnO8j.js +967 -0
- package/dist/web-ui/assets/journeyDiagram-5HDEW3XC-CUA6DUAQ.js +1256 -0
- package/dist/web-ui/assets/kanban-definition-HUTT4EX6-5W5tiWrd.js +1055 -0
- package/dist/web-ui/assets/katex-CqNtglxf.js +14499 -0
- package/dist/web-ui/assets/layout-BNmRhaUB.js +2359 -0
- package/dist/web-ui/assets/linear-CfvGIyDE.js +340 -0
- package/dist/web-ui/assets/map-BEO0Bu8q.js +298 -0
- package/dist/web-ui/assets/mermaid.core-BRk3IzY2.js +26639 -0
- package/dist/web-ui/assets/mindmap-definition-LN4V7U3C-2GmLg6ou.js +1183 -0
- package/dist/web-ui/assets/ordinal-DSZU4PqD.js +76 -0
- package/dist/web-ui/assets/pegDiagram-2B236MQR-gTEdrkJg.js +127 -0
- package/dist/web-ui/assets/pieDiagram-ENE6RG2P-CYXjIhqC.js +318 -0
- package/dist/web-ui/assets/quadrantDiagram-ABIIQ3AL-BStRZxwf.js +1341 -0
- package/dist/web-ui/assets/railroadDiagram-RFXS5EU6-btveDRG2.js +93 -0
- package/dist/web-ui/assets/requirementDiagram-TGXJPOKE-Cy_155rE.js +1205 -0
- package/dist/web-ui/assets/sankeyDiagram-HTMAVEWB-Chtvw3_G.js +1264 -0
- package/dist/web-ui/assets/sequenceDiagram-DBY2YBRQ-DDuMVEX1.js +4523 -0
- package/dist/web-ui/assets/sizeCapture-X5ZJPWSS-Bylf0o6J.js +64 -0
- package/dist/web-ui/assets/stateDiagram-2N3HPSRC-DIzLeR5G.js +453 -0
- package/dist/web-ui/assets/stateDiagram-v2-6OUMAXLB-zG_WjT1-.js +23 -0
- package/dist/web-ui/assets/swimlanes-5IMT3BWC-TKaCmVta.js +8575 -0
- package/dist/web-ui/assets/swimlanesDiagram-G3AALYLV-C5eB3qqS.js +21 -0
- package/dist/web-ui/assets/timeline-definition-FHXFAJF6-CC5Ujpcu.js +1606 -0
- package/dist/web-ui/assets/vennDiagram-L72KCM5P-DUSVXSYT.js +2523 -0
- package/dist/web-ui/assets/wardleyDiagram-EHGQE667-CoP9xn89.js +978 -0
- package/dist/web-ui/assets/xychartDiagram-FW5EYKEG-B9FqP_kk.js +1972 -0
- package/dist/web-ui/index.html +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { p as populateCommonDb } from "./chunk-JWPE2WC7-BW4n_ZhH.js";
|
|
3
|
+
import { _ as __name, A as cleanAndMerge, D as selectSvgElement, e as configureSvgSize, l as log, b as setAccTitle, a as getAccTitle, n as setDiagramTitle, o as getDiagramTitle, g as getAccDescription, s as setAccDescription, y as getConfig, B as defaultConfig_default, p as clear } from "./mermaid.core-BRk3IzY2.js";
|
|
4
|
+
import { p as parse } from "./cynefin-VYW2F7L2-DTNV7gvQ.js";
|
|
5
|
+
import "./index-DZ7I8r_C.js";
|
|
6
|
+
var DEFAULT_PACKET_CONFIG = defaultConfig_default.packet;
|
|
7
|
+
var PacketDB = (_a = class {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.packet = [];
|
|
10
|
+
this.setAccTitle = setAccTitle;
|
|
11
|
+
this.getAccTitle = getAccTitle;
|
|
12
|
+
this.setDiagramTitle = setDiagramTitle;
|
|
13
|
+
this.getDiagramTitle = getDiagramTitle;
|
|
14
|
+
this.getAccDescription = getAccDescription;
|
|
15
|
+
this.setAccDescription = setAccDescription;
|
|
16
|
+
}
|
|
17
|
+
getConfig() {
|
|
18
|
+
const config = cleanAndMerge({
|
|
19
|
+
...DEFAULT_PACKET_CONFIG,
|
|
20
|
+
...getConfig().packet
|
|
21
|
+
});
|
|
22
|
+
if (config.showBits) {
|
|
23
|
+
config.paddingY += 10;
|
|
24
|
+
}
|
|
25
|
+
return config;
|
|
26
|
+
}
|
|
27
|
+
getPacket() {
|
|
28
|
+
return this.packet;
|
|
29
|
+
}
|
|
30
|
+
pushWord(word) {
|
|
31
|
+
if (word.length > 0) {
|
|
32
|
+
this.packet.push(word);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
clear() {
|
|
36
|
+
clear();
|
|
37
|
+
this.packet = [];
|
|
38
|
+
}
|
|
39
|
+
}, __name(_a, "PacketDB"), _a);
|
|
40
|
+
var maxPacketSize = 1e4;
|
|
41
|
+
var populate = /* @__PURE__ */ __name((ast, db) => {
|
|
42
|
+
populateCommonDb(ast, db);
|
|
43
|
+
let lastBit = -1;
|
|
44
|
+
let word = [];
|
|
45
|
+
let row = 1;
|
|
46
|
+
const { bitsPerRow } = db.getConfig();
|
|
47
|
+
for (let { start, end, bits, label } of ast.blocks) {
|
|
48
|
+
if (start !== void 0 && end !== void 0 && end < start) {
|
|
49
|
+
throw new Error(`Packet block ${start} - ${end} is invalid. End must be greater than start.`);
|
|
50
|
+
}
|
|
51
|
+
start ?? (start = lastBit + 1);
|
|
52
|
+
if (start !== lastBit + 1) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Packet block ${start} - ${end ?? start} is not contiguous. It should start from ${lastBit + 1}.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (bits === 0) {
|
|
58
|
+
throw new Error(`Packet block ${start} is invalid. Cannot have a zero bit field.`);
|
|
59
|
+
}
|
|
60
|
+
end ?? (end = start + (bits ?? 1) - 1);
|
|
61
|
+
bits ?? (bits = end - start + 1);
|
|
62
|
+
lastBit = end;
|
|
63
|
+
log.debug(`Packet block ${start} - ${lastBit} with label ${label}`);
|
|
64
|
+
while (word.length <= bitsPerRow + 1 && db.getPacket().length < maxPacketSize) {
|
|
65
|
+
const [block, nextBlock] = getNextFittingBlock({ start, end, bits, label }, row, bitsPerRow);
|
|
66
|
+
word.push(block);
|
|
67
|
+
if (block.end + 1 === row * bitsPerRow) {
|
|
68
|
+
db.pushWord(word);
|
|
69
|
+
word = [];
|
|
70
|
+
row++;
|
|
71
|
+
}
|
|
72
|
+
if (!nextBlock) {
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
({ start, end, bits, label } = nextBlock);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
db.pushWord(word);
|
|
79
|
+
}, "populate");
|
|
80
|
+
var getNextFittingBlock = /* @__PURE__ */ __name((block, row, bitsPerRow) => {
|
|
81
|
+
if (block.start === void 0) {
|
|
82
|
+
throw new Error("start should have been set during first phase");
|
|
83
|
+
}
|
|
84
|
+
if (block.end === void 0) {
|
|
85
|
+
throw new Error("end should have been set during first phase");
|
|
86
|
+
}
|
|
87
|
+
if (block.start > block.end) {
|
|
88
|
+
throw new Error(`Block start ${block.start} is greater than block end ${block.end}.`);
|
|
89
|
+
}
|
|
90
|
+
if (block.end + 1 <= row * bitsPerRow) {
|
|
91
|
+
return [block, void 0];
|
|
92
|
+
}
|
|
93
|
+
const rowEnd = row * bitsPerRow - 1;
|
|
94
|
+
const rowStart = row * bitsPerRow;
|
|
95
|
+
return [
|
|
96
|
+
{
|
|
97
|
+
start: block.start,
|
|
98
|
+
end: rowEnd,
|
|
99
|
+
label: block.label,
|
|
100
|
+
bits: rowEnd - block.start
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
start: rowStart,
|
|
104
|
+
end: block.end,
|
|
105
|
+
label: block.label,
|
|
106
|
+
bits: block.end - rowStart
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
}, "getNextFittingBlock");
|
|
110
|
+
var parser = {
|
|
111
|
+
// @ts-expect-error - PacketDB is not assignable to DiagramDB
|
|
112
|
+
parser: { yy: void 0 },
|
|
113
|
+
parse: /* @__PURE__ */ __name(async (input) => {
|
|
114
|
+
var _a2;
|
|
115
|
+
const ast = await parse("packet", input);
|
|
116
|
+
const db = (_a2 = parser.parser) == null ? void 0 : _a2.yy;
|
|
117
|
+
if (!(db instanceof PacketDB)) {
|
|
118
|
+
throw new Error(
|
|
119
|
+
"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."
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
log.debug(ast);
|
|
123
|
+
populate(ast, db);
|
|
124
|
+
}, "parse")
|
|
125
|
+
};
|
|
126
|
+
var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
|
|
127
|
+
const db = diagram2.db;
|
|
128
|
+
const config = db.getConfig();
|
|
129
|
+
const { rowHeight, paddingY, bitWidth, bitsPerRow } = config;
|
|
130
|
+
const words = db.getPacket();
|
|
131
|
+
const title = db.getDiagramTitle();
|
|
132
|
+
const totalRowHeight = rowHeight + paddingY;
|
|
133
|
+
const svgHeight = totalRowHeight * (words.length + 1) - (title ? 0 : rowHeight);
|
|
134
|
+
const svgWidth = bitWidth * bitsPerRow + 2;
|
|
135
|
+
const svg = selectSvgElement(id);
|
|
136
|
+
svg.attr("viewBox", `0 0 ${svgWidth} ${svgHeight}`);
|
|
137
|
+
configureSvgSize(svg, svgHeight, svgWidth, config.useMaxWidth);
|
|
138
|
+
for (const [word, packet] of words.entries()) {
|
|
139
|
+
drawWord(svg, packet, word, config);
|
|
140
|
+
}
|
|
141
|
+
svg.append("text").text(title).attr("x", svgWidth / 2).attr("y", svgHeight - totalRowHeight / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
142
|
+
}, "draw");
|
|
143
|
+
var drawWord = /* @__PURE__ */ __name((svg, word, rowNumber, { rowHeight, paddingX, paddingY, bitWidth, bitsPerRow, showBits }) => {
|
|
144
|
+
const group = svg.append("g");
|
|
145
|
+
const wordY = rowNumber * (rowHeight + paddingY) + paddingY;
|
|
146
|
+
for (const block of word) {
|
|
147
|
+
const blockX = block.start % bitsPerRow * bitWidth + 1;
|
|
148
|
+
const width = (block.end - block.start + 1) * bitWidth - paddingX;
|
|
149
|
+
group.append("rect").attr("x", blockX).attr("y", wordY).attr("width", width).attr("height", rowHeight).attr("class", "packetBlock");
|
|
150
|
+
group.append("text").attr("x", blockX + width / 2).attr("y", wordY + rowHeight / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(block.label);
|
|
151
|
+
if (!showBits) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const isSingleBlock = block.end === block.start;
|
|
155
|
+
const bitNumberY = wordY - 2;
|
|
156
|
+
group.append("text").attr("x", blockX + (isSingleBlock ? width / 2 : 0)).attr("y", bitNumberY).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", isSingleBlock ? "middle" : "start").text(block.start);
|
|
157
|
+
if (!isSingleBlock) {
|
|
158
|
+
group.append("text").attr("x", blockX + width).attr("y", bitNumberY).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(block.end);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, "drawWord");
|
|
162
|
+
var renderer = { draw };
|
|
163
|
+
var defaultPacketStyleOptions = {
|
|
164
|
+
byteFontSize: "10px",
|
|
165
|
+
startByteColor: "black",
|
|
166
|
+
endByteColor: "black",
|
|
167
|
+
labelColor: "black",
|
|
168
|
+
labelFontSize: "12px",
|
|
169
|
+
titleColor: "black",
|
|
170
|
+
titleFontSize: "14px",
|
|
171
|
+
blockStrokeColor: "black",
|
|
172
|
+
blockStrokeWidth: "1",
|
|
173
|
+
blockFillColor: "#efefef"
|
|
174
|
+
};
|
|
175
|
+
var styles = /* @__PURE__ */ __name(({ packet } = {}) => {
|
|
176
|
+
const options = cleanAndMerge(defaultPacketStyleOptions, packet);
|
|
177
|
+
return `
|
|
178
|
+
.packetByte {
|
|
179
|
+
font-size: ${options.byteFontSize};
|
|
180
|
+
}
|
|
181
|
+
.packetByte.start {
|
|
182
|
+
fill: ${options.startByteColor};
|
|
183
|
+
}
|
|
184
|
+
.packetByte.end {
|
|
185
|
+
fill: ${options.endByteColor};
|
|
186
|
+
}
|
|
187
|
+
.packetLabel {
|
|
188
|
+
fill: ${options.labelColor};
|
|
189
|
+
font-size: ${options.labelFontSize};
|
|
190
|
+
}
|
|
191
|
+
.packetTitle {
|
|
192
|
+
fill: ${options.titleColor};
|
|
193
|
+
font-size: ${options.titleFontSize};
|
|
194
|
+
}
|
|
195
|
+
.packetBlock {
|
|
196
|
+
stroke: ${options.blockStrokeColor};
|
|
197
|
+
stroke-width: ${options.blockStrokeWidth};
|
|
198
|
+
fill: ${options.blockFillColor};
|
|
199
|
+
}
|
|
200
|
+
`;
|
|
201
|
+
}, "styles");
|
|
202
|
+
var diagram = {
|
|
203
|
+
parser,
|
|
204
|
+
get db() {
|
|
205
|
+
return new PacketDB();
|
|
206
|
+
},
|
|
207
|
+
renderer,
|
|
208
|
+
styles
|
|
209
|
+
};
|
|
210
|
+
export {
|
|
211
|
+
diagram
|
|
212
|
+
};
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { I as ImperativeState } from "./chunk-2Q5K7J3B-BRq-Qbau.js";
|
|
2
|
+
import { p as populateCommonDb } from "./chunk-JWPE2WC7-BW4n_ZhH.js";
|
|
3
|
+
import { n as setDiagramTitle, b as setAccTitle, s as setAccDescription, o as getDiagramTitle, g as getAccDescription, a as getAccTitle, _ as __name, A as cleanAndMerge, l as log, D as selectSvgElement, e as configureSvgSize, y as getConfig, p as clear, i as sanitizeText, ai as getIconSVG, B as defaultConfig_default, aj as registerIconPacks } from "./mermaid.core-BRk3IzY2.js";
|
|
4
|
+
import { p as parse } from "./cynefin-VYW2F7L2-DTNV7gvQ.js";
|
|
5
|
+
import "./index-DZ7I8r_C.js";
|
|
6
|
+
var ALL_BOX_CHARS = /[─━│┃└┗├┣]/;
|
|
7
|
+
var BRANCH_CHAR = /[└┗├┣]/;
|
|
8
|
+
var DASH_CHAR = /[─━]/;
|
|
9
|
+
var DECORATION_ONLY = /^[\s│┃]+$/;
|
|
10
|
+
var METADATA_LINE = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/;
|
|
11
|
+
var COMMENT_LINE = /^\s*%%/;
|
|
12
|
+
var INDENT_UNIT = " ";
|
|
13
|
+
function isBoxDrawingFormat(lines) {
|
|
14
|
+
return lines.some((line) => ALL_BOX_CHARS.test(line));
|
|
15
|
+
}
|
|
16
|
+
__name(isBoxDrawingFormat, "isBoxDrawingFormat");
|
|
17
|
+
function inferSegmentWidth(contentLines) {
|
|
18
|
+
for (const line of contentLines) {
|
|
19
|
+
const match = BRANCH_CHAR.exec(line);
|
|
20
|
+
if ((match == null ? void 0 : match.index) && match.index > 0) {
|
|
21
|
+
return match.index;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return 4;
|
|
25
|
+
}
|
|
26
|
+
__name(inferSegmentWidth, "inferSegmentWidth");
|
|
27
|
+
function remapErrorLines(message, lineMap) {
|
|
28
|
+
return message.replace(/\bline\s+(\d+)\b/gi, (match, lineStr) => {
|
|
29
|
+
const line = parseInt(lineStr, 10);
|
|
30
|
+
const original = lineMap.get(line);
|
|
31
|
+
return original ? `line ${original}` : match;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
__name(remapErrorLines, "remapErrorLines");
|
|
35
|
+
function preprocessBoxDrawing(input) {
|
|
36
|
+
const lines = input.split("\n");
|
|
37
|
+
const lineMap = /* @__PURE__ */ new Map();
|
|
38
|
+
let keywordIdx = -1;
|
|
39
|
+
for (const [i, line] of lines.entries()) {
|
|
40
|
+
if (line.trim() === "treeView-beta") {
|
|
41
|
+
keywordIdx = i;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (keywordIdx === -1) {
|
|
46
|
+
return { text: input, lineMap };
|
|
47
|
+
}
|
|
48
|
+
const contentLineTexts = [];
|
|
49
|
+
for (let i = keywordIdx + 1; i < lines.length; i++) {
|
|
50
|
+
const line = lines[i];
|
|
51
|
+
const trimmed = line.trim();
|
|
52
|
+
if (trimmed === "" || COMMENT_LINE.test(line) || METADATA_LINE.test(line)) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (DECORATION_ONLY.test(line)) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
contentLineTexts.push(line.replace(/\t/g, " "));
|
|
59
|
+
}
|
|
60
|
+
if (!isBoxDrawingFormat(contentLineTexts)) {
|
|
61
|
+
return { text: input, lineMap };
|
|
62
|
+
}
|
|
63
|
+
const segmentWidth = inferSegmentWidth(contentLineTexts);
|
|
64
|
+
const outputLines = [];
|
|
65
|
+
let outLineNo = 0;
|
|
66
|
+
for (let i = 0; i <= keywordIdx; i++) {
|
|
67
|
+
outputLines.push(lines[i]);
|
|
68
|
+
outLineNo++;
|
|
69
|
+
lineMap.set(outLineNo, i + 1);
|
|
70
|
+
}
|
|
71
|
+
for (let i = keywordIdx + 1; i < lines.length; i++) {
|
|
72
|
+
const line = lines[i];
|
|
73
|
+
const trimmed = line.trim();
|
|
74
|
+
const origLineNo = i + 1;
|
|
75
|
+
if (trimmed === "") {
|
|
76
|
+
outputLines.push(line);
|
|
77
|
+
outLineNo++;
|
|
78
|
+
lineMap.set(outLineNo, origLineNo);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (COMMENT_LINE.test(line)) {
|
|
82
|
+
outputLines.push(line);
|
|
83
|
+
outLineNo++;
|
|
84
|
+
lineMap.set(outLineNo, origLineNo);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (METADATA_LINE.test(line)) {
|
|
88
|
+
outputLines.push(line);
|
|
89
|
+
outLineNo++;
|
|
90
|
+
lineMap.set(outLineNo, origLineNo);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (DECORATION_ONLY.test(line)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const normalized = line.replace(/\t/g, " ");
|
|
97
|
+
const branchMatch = BRANCH_CHAR.exec(normalized);
|
|
98
|
+
if ((branchMatch == null ? void 0 : branchMatch.index) !== void 0) {
|
|
99
|
+
const branchCol = branchMatch.index;
|
|
100
|
+
const depth = Math.round(branchCol / segmentWidth) + 1;
|
|
101
|
+
let pos = branchCol + 1;
|
|
102
|
+
while (pos < normalized.length && DASH_CHAR.test(normalized[pos])) {
|
|
103
|
+
pos++;
|
|
104
|
+
}
|
|
105
|
+
while (pos < normalized.length && normalized[pos] === " ") {
|
|
106
|
+
pos++;
|
|
107
|
+
}
|
|
108
|
+
const content = normalized.slice(pos).trimEnd();
|
|
109
|
+
if (!content) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
`Line ${origLineNo}: Empty node — expected a filename or directory name after the box-drawing prefix`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const indent = INDENT_UNIT.repeat(depth);
|
|
115
|
+
outputLines.push(indent + content);
|
|
116
|
+
outLineNo++;
|
|
117
|
+
lineMap.set(outLineNo, origLineNo);
|
|
118
|
+
} else if (/^[\s─━│┃└┗├┣]+$/.test(normalized)) {
|
|
119
|
+
continue;
|
|
120
|
+
} else if (ALL_BOX_CHARS.test(normalized)) {
|
|
121
|
+
outputLines.push(line);
|
|
122
|
+
outLineNo++;
|
|
123
|
+
lineMap.set(outLineNo, origLineNo);
|
|
124
|
+
} else if (/^\s+/.test(normalized)) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
`Line ${origLineNo}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`
|
|
127
|
+
);
|
|
128
|
+
} else {
|
|
129
|
+
outputLines.push(line);
|
|
130
|
+
outLineNo++;
|
|
131
|
+
lineMap.set(outLineNo, origLineNo);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return { text: outputLines.join("\n"), lineMap };
|
|
135
|
+
}
|
|
136
|
+
__name(preprocessBoxDrawing, "preprocessBoxDrawing");
|
|
137
|
+
var state = new ImperativeState(() => ({
|
|
138
|
+
cnt: 1,
|
|
139
|
+
stack: [
|
|
140
|
+
{
|
|
141
|
+
id: 0,
|
|
142
|
+
level: -1,
|
|
143
|
+
name: "/",
|
|
144
|
+
nodeType: "directory",
|
|
145
|
+
children: []
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}));
|
|
149
|
+
var clear2 = /* @__PURE__ */ __name(() => {
|
|
150
|
+
state.reset();
|
|
151
|
+
clear();
|
|
152
|
+
}, "clear");
|
|
153
|
+
var getRoot = /* @__PURE__ */ __name(() => {
|
|
154
|
+
return state.records.stack[0];
|
|
155
|
+
}, "getRoot");
|
|
156
|
+
var getCount = /* @__PURE__ */ __name(() => state.records.cnt, "getCount");
|
|
157
|
+
var defaultConfig = defaultConfig_default.treeView;
|
|
158
|
+
var getConfig2 = /* @__PURE__ */ __name(() => {
|
|
159
|
+
return cleanAndMerge(defaultConfig, getConfig().treeView);
|
|
160
|
+
}, "getConfig");
|
|
161
|
+
var addNode = /* @__PURE__ */ __name((level, name, nodeType, cssClass, icon, description) => {
|
|
162
|
+
while (level <= state.records.stack[state.records.stack.length - 1].level) {
|
|
163
|
+
state.records.stack.pop();
|
|
164
|
+
}
|
|
165
|
+
const node = {
|
|
166
|
+
id: state.records.cnt++,
|
|
167
|
+
level,
|
|
168
|
+
name,
|
|
169
|
+
nodeType,
|
|
170
|
+
icon,
|
|
171
|
+
cssClass,
|
|
172
|
+
description,
|
|
173
|
+
children: []
|
|
174
|
+
};
|
|
175
|
+
state.records.stack[state.records.stack.length - 1].children.push(node);
|
|
176
|
+
state.records.stack.push(node);
|
|
177
|
+
}, "addNode");
|
|
178
|
+
var db = {
|
|
179
|
+
clear: clear2,
|
|
180
|
+
addNode,
|
|
181
|
+
getRoot,
|
|
182
|
+
getCount,
|
|
183
|
+
getConfig: getConfig2,
|
|
184
|
+
getAccTitle,
|
|
185
|
+
getAccDescription,
|
|
186
|
+
getDiagramTitle,
|
|
187
|
+
setAccDescription,
|
|
188
|
+
setAccTitle,
|
|
189
|
+
setDiagramTitle
|
|
190
|
+
};
|
|
191
|
+
var db_default = db;
|
|
192
|
+
var populate = /* @__PURE__ */ __name((ast) => {
|
|
193
|
+
populateCommonDb(ast, db_default);
|
|
194
|
+
for (const node of ast.nodes) {
|
|
195
|
+
const level = typeof node.indent === "number" ? node.indent : 0;
|
|
196
|
+
let name = node.name;
|
|
197
|
+
const isDirectory = name.endsWith("/");
|
|
198
|
+
if (isDirectory) {
|
|
199
|
+
name = name.slice(0, -1);
|
|
200
|
+
}
|
|
201
|
+
const nodeType = isDirectory ? "directory" : "file";
|
|
202
|
+
const cssClass = node.classAnnotation || void 0;
|
|
203
|
+
const rawIcon = node.iconAnnotation;
|
|
204
|
+
const icon = rawIcon !== void 0 ? rawIcon || "none" : void 0;
|
|
205
|
+
const rawDesc = node.descAnnotation || void 0;
|
|
206
|
+
const description = rawDesc ? sanitizeText(rawDesc, getConfig()) : void 0;
|
|
207
|
+
db_default.addNode(level, name, nodeType, cssClass, icon, description);
|
|
208
|
+
}
|
|
209
|
+
}, "populate");
|
|
210
|
+
var parser = {
|
|
211
|
+
parse: /* @__PURE__ */ __name(async (input) => {
|
|
212
|
+
const { text, lineMap } = preprocessBoxDrawing(input);
|
|
213
|
+
try {
|
|
214
|
+
const ast = await parse("treeView", text);
|
|
215
|
+
log.debug(ast);
|
|
216
|
+
populate(ast);
|
|
217
|
+
} catch (error) {
|
|
218
|
+
if (lineMap.size > 0 && error instanceof Error) {
|
|
219
|
+
error.message = remapErrorLines(error.message, lineMap);
|
|
220
|
+
}
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
}, "parse")
|
|
224
|
+
};
|
|
225
|
+
var treeViewIcons = {
|
|
226
|
+
prefix: "mermaid-treeview",
|
|
227
|
+
height: 24,
|
|
228
|
+
width: 24,
|
|
229
|
+
icons: {
|
|
230
|
+
folder: {
|
|
231
|
+
body: '<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'
|
|
232
|
+
},
|
|
233
|
+
file: {
|
|
234
|
+
body: '<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
function detectIcon(name, config) {
|
|
239
|
+
var _a;
|
|
240
|
+
const filenameIcon = (_a = config == null ? void 0 : config.filenameIcons) == null ? void 0 : _a[name];
|
|
241
|
+
if (filenameIcon) {
|
|
242
|
+
return filenameIcon;
|
|
243
|
+
}
|
|
244
|
+
const dotIdx = name.lastIndexOf(".");
|
|
245
|
+
if (dotIdx > 0) {
|
|
246
|
+
const ext = name.substring(dotIdx).toLowerCase();
|
|
247
|
+
const extensionIcons = config == null ? void 0 : config.extensionIcons;
|
|
248
|
+
return (extensionIcons == null ? void 0 : extensionIcons[ext]) ?? (extensionIcons == null ? void 0 : extensionIcons[ext.slice(1)]);
|
|
249
|
+
}
|
|
250
|
+
return void 0;
|
|
251
|
+
}
|
|
252
|
+
__name(detectIcon, "detectIcon");
|
|
253
|
+
function qualifyIcon(icon, defaultIconPack) {
|
|
254
|
+
if (icon.includes(":")) {
|
|
255
|
+
return icon;
|
|
256
|
+
}
|
|
257
|
+
if (icon in treeViewIcons.icons || !defaultIconPack) {
|
|
258
|
+
return `${treeViewIcons.prefix}:${icon}`;
|
|
259
|
+
}
|
|
260
|
+
return `${defaultIconPack}:${icon}`;
|
|
261
|
+
}
|
|
262
|
+
__name(qualifyIcon, "qualifyIcon");
|
|
263
|
+
function getNodeIcon(node, config) {
|
|
264
|
+
if (node.icon === "none") {
|
|
265
|
+
return void 0;
|
|
266
|
+
}
|
|
267
|
+
if (node.icon) {
|
|
268
|
+
return qualifyIcon(node.icon, config.defaultIconPack);
|
|
269
|
+
}
|
|
270
|
+
if (!config.showIcons) {
|
|
271
|
+
return void 0;
|
|
272
|
+
}
|
|
273
|
+
if (node.nodeType === "file") {
|
|
274
|
+
const detected = detectIcon(node.name, config);
|
|
275
|
+
if (detected === "none") {
|
|
276
|
+
return void 0;
|
|
277
|
+
}
|
|
278
|
+
if (detected) {
|
|
279
|
+
return qualifyIcon(detected, config.defaultIconPack);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return `${treeViewIcons.prefix}:${node.nodeType === "directory" ? "folder" : "file"}`;
|
|
283
|
+
}
|
|
284
|
+
__name(getNodeIcon, "getNodeIcon");
|
|
285
|
+
registerIconPacks([
|
|
286
|
+
{
|
|
287
|
+
name: treeViewIcons.prefix,
|
|
288
|
+
icons: treeViewIcons
|
|
289
|
+
}
|
|
290
|
+
]);
|
|
291
|
+
var ICON_SIZE = 14;
|
|
292
|
+
var ICON_GAP = 4;
|
|
293
|
+
var DESC_GAP = 16;
|
|
294
|
+
var iconSymbolId = /* @__PURE__ */ __name((diagramId, icon) => `tv-icon-${diagramId}-${icon.replace(/[^\w-]/g, "-")}`, "iconSymbolId");
|
|
295
|
+
var injectIconDefs = /* @__PURE__ */ __name(async (svg, root, config, diagramId) => {
|
|
296
|
+
const usedIcons = /* @__PURE__ */ new Set();
|
|
297
|
+
const collect = /* @__PURE__ */ __name((node) => {
|
|
298
|
+
const icon = getNodeIcon(node, config);
|
|
299
|
+
if (icon) {
|
|
300
|
+
usedIcons.add(icon);
|
|
301
|
+
}
|
|
302
|
+
node.children.forEach(collect);
|
|
303
|
+
}, "collect");
|
|
304
|
+
collect(root);
|
|
305
|
+
if (usedIcons.size === 0) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const iconSVGs = await Promise.all(
|
|
309
|
+
[...usedIcons].map(async (icon) => ({
|
|
310
|
+
icon,
|
|
311
|
+
svg: await getIconSVG(icon, {
|
|
312
|
+
height: ICON_SIZE,
|
|
313
|
+
width: ICON_SIZE
|
|
314
|
+
})
|
|
315
|
+
}))
|
|
316
|
+
);
|
|
317
|
+
const defs = svg.append("defs");
|
|
318
|
+
for (const { icon, svg: iconSVG } of iconSVGs) {
|
|
319
|
+
defs.append("g").attr("id", iconSymbolId(diagramId, icon)).html(iconSVG);
|
|
320
|
+
}
|
|
321
|
+
}, "injectIconDefs");
|
|
322
|
+
var positionLabel = /* @__PURE__ */ __name((x, y, node, domElem, config, diagramId) => {
|
|
323
|
+
var _a;
|
|
324
|
+
const nodeGroup = domElem.append("g");
|
|
325
|
+
let cssClasses = "treeView-node-label";
|
|
326
|
+
if (node.nodeType === "directory") {
|
|
327
|
+
cssClasses += " treeView-node-dir";
|
|
328
|
+
}
|
|
329
|
+
if (node.cssClass) {
|
|
330
|
+
cssClasses += ` ${node.cssClass}`;
|
|
331
|
+
}
|
|
332
|
+
const iconOffset = ICON_SIZE + ICON_GAP;
|
|
333
|
+
const icon = getNodeIcon(node, config);
|
|
334
|
+
const showIcon = icon !== void 0;
|
|
335
|
+
if (icon) {
|
|
336
|
+
nodeGroup.append("use").attr("xlink:href", `#${iconSymbolId(diagramId, icon)}`).attr("x", x + config.paddingX).attr("y", y + config.paddingY).attr("class", "treeView-node-icon");
|
|
337
|
+
}
|
|
338
|
+
const label = nodeGroup.append("text").text(node.name).attr("dominant-baseline", "middle").attr("class", cssClasses);
|
|
339
|
+
const { height: labelHeight, width: labelWidth } = label.node().getBBox();
|
|
340
|
+
const height = labelHeight + config.paddingY * 2;
|
|
341
|
+
const labelX = x + config.paddingX + (showIcon ? iconOffset : 0);
|
|
342
|
+
label.attr("x", labelX);
|
|
343
|
+
label.attr("y", y + height / 2);
|
|
344
|
+
const labelRightEdge = labelX + labelWidth;
|
|
345
|
+
const width = labelWidth + config.paddingX * 2 + (showIcon ? iconOffset : 0);
|
|
346
|
+
node.BBox = { x, y, width, height };
|
|
347
|
+
if ((_a = node.cssClass) == null ? void 0 : _a.split(/\s+/).includes("highlight")) {
|
|
348
|
+
nodeGroup.insert("rect", ":first-child").attr("x", x).attr("y", y + 1).attr("width", 0).attr("height", height - 2).attr("rx", 3).attr("class", "treeView-highlight-bg");
|
|
349
|
+
}
|
|
350
|
+
return { node, nodeGroup, labelRightEdge, centerY: y + height / 2 };
|
|
351
|
+
}, "positionLabel");
|
|
352
|
+
var positionLine = /* @__PURE__ */ __name((domElem, x1, y1, x2, y2, lineThickness) => {
|
|
353
|
+
return domElem.append("line").attr("x1", x1).attr("y1", y1).attr("x2", x2).attr("y2", y2).attr("stroke-width", lineThickness).attr("class", "treeView-node-line");
|
|
354
|
+
}, "positionLine");
|
|
355
|
+
var drawTree = /* @__PURE__ */ __name((elem, root, config, diagramId) => {
|
|
356
|
+
var _a;
|
|
357
|
+
let totalHeight = 0;
|
|
358
|
+
let totalWidth = 0;
|
|
359
|
+
const renderInfos = [];
|
|
360
|
+
const drawNode = /* @__PURE__ */ __name((elem2, node, config2, depth) => {
|
|
361
|
+
const indent = depth * (config2.rowIndent + config2.paddingX);
|
|
362
|
+
const info = positionLabel(indent, totalHeight, node, elem2, config2, diagramId);
|
|
363
|
+
renderInfos.push(info);
|
|
364
|
+
const { height, width } = node.BBox;
|
|
365
|
+
positionLine(
|
|
366
|
+
elem2,
|
|
367
|
+
indent - config2.rowIndent,
|
|
368
|
+
totalHeight + height / 2,
|
|
369
|
+
indent,
|
|
370
|
+
totalHeight + height / 2,
|
|
371
|
+
config2.lineThickness
|
|
372
|
+
);
|
|
373
|
+
totalWidth = Math.max(totalWidth, indent + width);
|
|
374
|
+
totalHeight += height;
|
|
375
|
+
}, "drawNode");
|
|
376
|
+
const processNode = /* @__PURE__ */ __name((node, depth = 0) => {
|
|
377
|
+
drawNode(elem, node, config, depth);
|
|
378
|
+
node.children.forEach((child) => {
|
|
379
|
+
processNode(child, depth + 1);
|
|
380
|
+
});
|
|
381
|
+
const { x, y, height } = node.BBox;
|
|
382
|
+
if (node.children.length) {
|
|
383
|
+
const { y: endY, height: endHeight } = node.children[node.children.length - 1].BBox;
|
|
384
|
+
positionLine(
|
|
385
|
+
elem,
|
|
386
|
+
x + config.paddingX,
|
|
387
|
+
y + height,
|
|
388
|
+
x + config.paddingX,
|
|
389
|
+
endY + endHeight / 2 + config.lineThickness / 2,
|
|
390
|
+
config.lineThickness
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
}, "processNode");
|
|
394
|
+
processNode(root);
|
|
395
|
+
const nodesWithDesc = renderInfos.filter((ri) => ri.node.description);
|
|
396
|
+
if (nodesWithDesc.length > 0) {
|
|
397
|
+
const maxLabelRight = Math.max(...renderInfos.map((ri) => ri.labelRightEdge));
|
|
398
|
+
const descX = maxLabelRight + DESC_GAP;
|
|
399
|
+
for (const ri of nodesWithDesc) {
|
|
400
|
+
const desc = ri.nodeGroup.append("text").text(ri.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", descX).attr("y", ri.centerY);
|
|
401
|
+
const descBBox = desc.node().getBBox();
|
|
402
|
+
totalWidth = Math.max(totalWidth, descX + descBBox.width + config.paddingX);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
for (const ri of renderInfos) {
|
|
406
|
+
if ((_a = ri.node.cssClass) == null ? void 0 : _a.split(/\s+/).includes("highlight")) {
|
|
407
|
+
const rect = ri.nodeGroup.select(".treeView-highlight-bg");
|
|
408
|
+
if (!rect.empty()) {
|
|
409
|
+
const rectWidth = totalWidth - ri.node.BBox.x + 8;
|
|
410
|
+
rect.attr("width", rectWidth);
|
|
411
|
+
totalWidth = Math.max(totalWidth, ri.node.BBox.x + rectWidth + 2);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return { totalHeight, totalWidth };
|
|
416
|
+
}, "drawTree");
|
|
417
|
+
var draw = /* @__PURE__ */ __name(async (text, id, _ver, diagObj) => {
|
|
418
|
+
log.debug("Rendering treeView diagram\n" + text);
|
|
419
|
+
const db2 = diagObj.db;
|
|
420
|
+
const root = db2.getRoot();
|
|
421
|
+
const config = db2.getConfig();
|
|
422
|
+
const svg = selectSvgElement(id);
|
|
423
|
+
await injectIconDefs(svg, root, config, id);
|
|
424
|
+
const treeElem = svg.append("g");
|
|
425
|
+
treeElem.attr("class", "tree-view");
|
|
426
|
+
const { totalHeight, totalWidth } = drawTree(treeElem, root, config, id);
|
|
427
|
+
svg.attr("viewBox", `-${config.lineThickness / 2} 0 ${totalWidth} ${totalHeight}`);
|
|
428
|
+
configureSvgSize(svg, totalHeight, totalWidth, config.useMaxWidth);
|
|
429
|
+
}, "draw");
|
|
430
|
+
var renderer = {
|
|
431
|
+
draw
|
|
432
|
+
};
|
|
433
|
+
var renderer_default = renderer;
|
|
434
|
+
var defaultTreeViewDiagramStyles = {
|
|
435
|
+
labelFontSize: "16px",
|
|
436
|
+
labelColor: "black",
|
|
437
|
+
lineColor: "black",
|
|
438
|
+
iconColor: "#546e7a",
|
|
439
|
+
descriptionColor: "#6a9955",
|
|
440
|
+
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
441
|
+
highlightStroke: "#ffc107"
|
|
442
|
+
};
|
|
443
|
+
var styles = /* @__PURE__ */ __name(({
|
|
444
|
+
treeView
|
|
445
|
+
}) => {
|
|
446
|
+
const {
|
|
447
|
+
labelFontSize,
|
|
448
|
+
labelColor,
|
|
449
|
+
lineColor,
|
|
450
|
+
iconColor,
|
|
451
|
+
descriptionColor,
|
|
452
|
+
highlightBg,
|
|
453
|
+
highlightStroke
|
|
454
|
+
} = cleanAndMerge(defaultTreeViewDiagramStyles, treeView);
|
|
455
|
+
return `
|
|
456
|
+
.treeView-node-label {
|
|
457
|
+
font-size: ${labelFontSize};
|
|
458
|
+
fill: ${labelColor};
|
|
459
|
+
white-space: pre;
|
|
460
|
+
}
|
|
461
|
+
.treeView-node-dir {
|
|
462
|
+
font-weight: bold;
|
|
463
|
+
}
|
|
464
|
+
.treeView-node-line {
|
|
465
|
+
stroke: ${lineColor};
|
|
466
|
+
}
|
|
467
|
+
.treeView-node-icon {
|
|
468
|
+
color: ${iconColor};
|
|
469
|
+
}
|
|
470
|
+
.treeView-node-description {
|
|
471
|
+
font-size: ${labelFontSize};
|
|
472
|
+
fill: ${descriptionColor};
|
|
473
|
+
font-style: italic;
|
|
474
|
+
white-space: pre;
|
|
475
|
+
}
|
|
476
|
+
.treeView-highlight-bg {
|
|
477
|
+
fill: ${highlightBg};
|
|
478
|
+
stroke: ${highlightStroke};
|
|
479
|
+
stroke-width: 1;
|
|
480
|
+
}
|
|
481
|
+
`;
|
|
482
|
+
}, "styles");
|
|
483
|
+
var styles_default = styles;
|
|
484
|
+
var diagram = {
|
|
485
|
+
db: db_default,
|
|
486
|
+
renderer: renderer_default,
|
|
487
|
+
parser,
|
|
488
|
+
styles: styles_default
|
|
489
|
+
};
|
|
490
|
+
export {
|
|
491
|
+
diagram
|
|
492
|
+
};
|