@smarter.sh/ui-chat 0.8.0 → 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/README.md +328 -107
- package/dist/embed/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/embed/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/embed/mermaid/abnfDiagram-VCTEODGH-1SbERmPs.js +89 -0
- package/dist/embed/mermaid/arc-VicTtbbz.js +82 -0
- package/dist/embed/mermaid/architecture-7GRP2DOG-D0nnNZ3B.js +2 -0
- package/dist/embed/mermaid/architectureDiagram-5GKGNRK7-CQABdiy9.js +4138 -0
- package/dist/embed/mermaid/array-CApNbSU9.js +6 -0
- package/dist/embed/mermaid/blockDiagram-I7D4REHJ-CtjOz0Jt.js +1911 -0
- package/dist/embed/mermaid/c4Diagram-7LVT6UL2-_qBudB6C.js +3010 -0
- package/dist/embed/mermaid/channel-BXMcYHk2.js +5 -0
- package/dist/embed/mermaid/chunk-2E4U76K2-CBll2dEU.js +346 -0
- package/dist/embed/mermaid/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
- package/dist/embed/mermaid/chunk-4HAMMTFA-Dhz0SVnN.js +4188 -0
- package/dist/embed/mermaid/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
- package/dist/embed/mermaid/chunk-75Z2AOVW-BsWtLgfj.js +1330 -0
- package/dist/embed/mermaid/chunk-CLGD4ZFX-Bkjwlxy9.js +14 -0
- package/dist/embed/mermaid/chunk-DU6HZSFF-1zIarP1Q.js +3900 -0
- package/dist/embed/mermaid/chunk-F27PBJKO-CiOL12VY.js +61 -0
- package/dist/embed/mermaid/chunk-FOHPRMQF-DS9zEyR5.js +21447 -0
- package/dist/embed/mermaid/chunk-GMAD6QVW-Dc0gE_3Q.js +1804 -0
- package/dist/embed/mermaid/chunk-GVQU2GXP-CWFtOgtb.js +37 -0
- package/dist/embed/mermaid/chunk-IMKFNOWR-CLyTlLwx.js +2042 -0
- package/dist/embed/mermaid/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
- package/dist/embed/mermaid/chunk-L3NEJ4N5-DnkSrVO8.js +245 -0
- package/dist/embed/mermaid/chunk-LNGE3PJU-ByFTjlja.js +1517 -0
- package/dist/embed/mermaid/chunk-OSK3NFVY-B57tZZIG.js +672 -0
- package/dist/embed/mermaid/chunk-P2QGCYS3-BUVAOFF-.js +67 -0
- package/dist/embed/mermaid/chunk-POPQ4Y6H-BsUdeJ_J.js +26 -0
- package/dist/embed/mermaid/chunk-PWAF6VOD-Cb-w19aO.js +275 -0
- package/dist/embed/mermaid/chunk-SHT3W25Y-znBBpcIu.js +4183 -0
- package/dist/embed/mermaid/chunk-SVP7TREG-DrHUM-6R.js +490 -0
- package/dist/embed/mermaid/chunk-TICWLB2K-xlGqZZYJ.js +3357 -0
- package/dist/embed/mermaid/chunk-TLUHSLCS-COwDpXBa.js +59 -0
- package/dist/embed/mermaid/chunk-XXDRQBXY-pOp8MAr9.js +9 -0
- package/dist/embed/mermaid/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
- package/dist/embed/mermaid/classDiagram-ZZMXUADV-C8BeuQnA.js +30 -0
- package/dist/embed/mermaid/classDiagram-v2-VYDZK3BY-B3jylZLr.js +30 -0
- package/dist/embed/mermaid/cose-bilkent-JH36ORCC-DFvJxZ7v.js +2240 -0
- package/dist/embed/mermaid/cynefin-OW5HDTMX-B6YJOAMM.js +2 -0
- package/dist/embed/mermaid/cynefinDiagram-5FMLGOSQ-CCm5IQBE.js +355 -0
- package/dist/embed/mermaid/cytoscape.esm-BstmGtAB.js +18047 -0
- package/dist/embed/mermaid/dagre-BwzzJJA_.js +1932 -0
- package/dist/embed/mermaid/dagre-GXQ25YYZ-B3d3iNF-.js +423 -0
- package/dist/embed/mermaid/defaultLocale-N-0uLSyg.js +198 -0
- package/dist/embed/mermaid/diagram-S7CK7UJ4-BeA5UJrt.js +293 -0
- package/dist/embed/mermaid/diagram-UQ7AKVKN-DK0uHb-2.js +214 -0
- package/dist/embed/mermaid/diagram-VSXAHHWV-D5JXip1B.js +432 -0
- package/dist/embed/mermaid/diagram-VX7I27RA-B1VysvG9.js +527 -0
- package/dist/embed/mermaid/diagram-Z3DM3KII-ZGUJaFq-.js +134 -0
- package/dist/embed/mermaid/dist-DRRwZ4Yi.js +59 -0
- package/dist/embed/mermaid/ebnfDiagram-PWID7BFC-BOahZhWx.js +100 -0
- package/dist/embed/mermaid/erDiagram-RLTQ6QDP-7cGpGRQo.js +1966 -0
- package/dist/embed/mermaid/eventmodeling-NTZA5JFV-C3kU50Cz.js +2 -0
- package/dist/embed/mermaid/flowDiagram-HODETNUW-D-eJN2AO.js +16 -0
- package/dist/embed/mermaid/ganttDiagram-EL5Y4UJY-s6Kx4KlU.js +3072 -0
- package/dist/embed/mermaid/gitGraph-4MIJSDKK-CqdlGRFk.js +2 -0
- package/dist/embed/mermaid/gitGraphDiagram-WWUBYQGX-Blwdy0b7.js +733 -0
- package/dist/embed/mermaid/graphlib-XW-Jr8pF.js +1267 -0
- package/dist/embed/mermaid/info-A6RAGUB7-2pwra5F3.js +2 -0
- package/dist/embed/mermaid/infoDiagram-27XIBGKW-CstzbQPb.js +20 -0
- package/dist/embed/mermaid/init-CsQUQz36.js +13 -0
- package/dist/embed/mermaid/ishikawaDiagram-5VMMS53U-C6y_w0kd.js +717 -0
- package/dist/embed/mermaid/journeyDiagram-3NMN7TZE-BHVux_z1.js +884 -0
- package/dist/embed/mermaid/kanban-definition-UXKFOSKX-Cgj-7IHi.js +976 -0
- package/dist/embed/mermaid/katex-DmPOayaq.js +21968 -0
- package/dist/embed/mermaid/line-brkWVSn0.js +34 -0
- package/dist/embed/mermaid/linear-CiZWLcTr.js +287 -0
- package/dist/embed/mermaid/mermaid-parser.core-BjLg_By9.js +632 -0
- package/dist/embed/mermaid/mermaid.js +1092 -0
- package/dist/embed/mermaid/mindmap-definition-YA3MSWOX-DRc-FzI_.js +1006 -0
- package/dist/embed/mermaid/ordinal-BubEveRk.js +65 -0
- package/dist/embed/mermaid/packet-AYTQ26CC-C3h9OoFk.js +2 -0
- package/dist/embed/mermaid/path-CnWkkRiY.js +84 -0
- package/dist/embed/mermaid/pegDiagram-XKGWAZYB-Cw-aYwaF.js +94 -0
- package/dist/embed/mermaid/pie-WAS4IAKB-CaECYpHT.js +2 -0
- package/dist/embed/mermaid/pieDiagram-E7YTZNPT-DoguGyzq.js +203 -0
- package/dist/embed/mermaid/quadrantDiagram-AXDQQJYC-Cu4dMFZL.js +2001 -0
- package/dist/embed/mermaid/radar-RG4KPBEZ-CoS7pnd_.js +2 -0
- package/dist/embed/mermaid/railroad-74A4TZTK-BjHa6MAk.js +2 -0
- package/dist/embed/mermaid/railroad-abnf-HS5TGJTU-Bm2YWqjG.js +2 -0
- package/dist/embed/mermaid/railroad-ebnf-LZEXJU2U-C7mPpgM3.js +2 -0
- package/dist/embed/mermaid/railroad-peg-WCYAUIDC-Cyp07M5x.js +2 -0
- package/dist/embed/mermaid/railroadDiagram-O6MQD6OU-DDX-9GRQ.js +76 -0
- package/dist/embed/mermaid/requirementDiagram-BXWQKSXE-z8PPo06M.js +2224 -0
- package/dist/embed/mermaid/rough.esm-DXYGHN3m.js +1361 -0
- package/dist/embed/mermaid/sankeyDiagram-P5KCCOFB-CeD0II3M.js +972 -0
- package/dist/embed/mermaid/sequenceDiagram-WJ2MYXX4-Cs-Wxyvw.js +4156 -0
- package/dist/embed/mermaid/sizeCapture-INFHLROL-DujrpAYz.js +46 -0
- package/dist/embed/mermaid/src-DbyMbLVK.js +2141 -0
- package/dist/embed/mermaid/stateDiagram-D77RDMKH-CqWtgHSc.js +220 -0
- package/dist/embed/mermaid/stateDiagram-v2-MP3YSRHH-CPideWIU.js +30 -0
- package/dist/embed/mermaid/swimlanes-42K2YHIH-MutR4uV4.js +4957 -0
- package/dist/embed/mermaid/swimlanesDiagram-VR7AAH4N-BC_o7pti.js +31 -0
- package/dist/embed/mermaid/timeline-definition-24CTP7MA-rZfNRFiT.js +1069 -0
- package/dist/embed/mermaid/treeView-Q6P3EWNA-C94eS7gV.js +2 -0
- package/dist/embed/mermaid/treemap-WGGIJYW6-DnrVJ1h3.js +2 -0
- package/dist/embed/mermaid/vennDiagram-4TSXK5OY-KwMHebDQ.js +1880 -0
- package/dist/embed/mermaid/wardley-WFR3VGLG-DRDACyIN.js +2 -0
- package/dist/embed/mermaid/wardleyDiagram-VM6X3IG4-C-Fm7GGB.js +645 -0
- package/dist/embed/mermaid/xychartDiagram-S5SC5T6Z-DZX43ay9.js +2210 -0
- package/dist/embed.js +903 -0
- package/dist/embed.js.map +1 -0
- package/dist/smarter-chat-library.es.js +2722 -2805
- package/dist/smarter-chat-library.es.js.map +1 -1
- package/dist/smarter-chat-library.umd.js +56 -56
- package/dist/smarter-chat-library.umd.js.map +1 -1
- package/dist/types/src/components/SmarterChat/Component.d.ts +1 -1
- package/dist/types/src/embed/EmbedApp.d.ts +10 -0
- package/dist/types/src/embed/assets.d.ts +7 -0
- package/dist/types/src/embed/autoMount.d.ts +18 -0
- package/dist/types/src/embed/css.d.ts +15 -0
- package/dist/types/src/embed/element.d.ts +19 -0
- package/dist/types/src/embed/index.d.ts +17 -0
- package/dist/types/src/embed/mermaid.d.ts +2 -0
- package/dist/types/src/embed/mermaidImport.d.ts +1 -0
- package/dist/types/src/embed/options.d.ts +69 -0
- package/dist/types/src/lib/cookie.d.ts +4 -3
- package/dist/types/src/lib/mermaidImport.d.ts +8 -0
- package/dist/types/src/types.d.ts +7 -0
- package/package.json +10 -4
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { m as e } from "./src-DbyMbLVK.js";
|
|
2
|
+
import { n as t } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
3
|
+
import { H as n, K as r, U as i, a, b as o, c as s, f as c, v as l, w as u, y as d, z as f } from "./chunk-DU6HZSFF-1zIarP1Q.js";
|
|
4
|
+
import { i as p } from "./chunk-75Z2AOVW-BsWtLgfj.js";
|
|
5
|
+
import { t as m } from "./chunk-CLGD4ZFX-Bkjwlxy9.js";
|
|
6
|
+
import { r as h, t as g } from "./chunk-PWAF6VOD-Cb-w19aO.js";
|
|
7
|
+
import { n as _ } from "./mermaid-parser.core-BjLg_By9.js";
|
|
8
|
+
import { t as v } from "./chunk-JWPE2WC7-Ccb0QaC8.js";
|
|
9
|
+
import { t as y } from "./chunk-2Q5K7J3B-kzxEEeTu.js";
|
|
10
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-S7CK7UJ4.mjs
|
|
11
|
+
var b = /[─━│┃└┗├┣]/, x = /[└┗├┣]/, S = /[─━]/, C = /^[\s│┃]+$/, w = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, T = /^\s*%%/, E = " ";
|
|
12
|
+
function D(e) {
|
|
13
|
+
return e.some((e) => b.test(e));
|
|
14
|
+
}
|
|
15
|
+
t(D, "isBoxDrawingFormat");
|
|
16
|
+
function O(e) {
|
|
17
|
+
for (let t of e) {
|
|
18
|
+
let e = x.exec(t);
|
|
19
|
+
if (e?.index && e.index > 0) return e.index;
|
|
20
|
+
}
|
|
21
|
+
return 4;
|
|
22
|
+
}
|
|
23
|
+
t(O, "inferSegmentWidth");
|
|
24
|
+
function k(e, t) {
|
|
25
|
+
return e.replace(/\bline\s+(\d+)\b/gi, (e, n) => {
|
|
26
|
+
let r = parseInt(n, 10), i = t.get(r);
|
|
27
|
+
return i ? `line ${i}` : e;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
t(k, "remapErrorLines");
|
|
31
|
+
function A(e) {
|
|
32
|
+
let t = e.split("\n"), n = /* @__PURE__ */ new Map(), r = -1;
|
|
33
|
+
for (let [e, n] of t.entries()) if (n.trim() === "treeView-beta") {
|
|
34
|
+
r = e;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (r === -1) return {
|
|
38
|
+
text: e,
|
|
39
|
+
lineMap: n
|
|
40
|
+
};
|
|
41
|
+
let i = [];
|
|
42
|
+
for (let e = r + 1; e < t.length; e++) {
|
|
43
|
+
let n = t[e];
|
|
44
|
+
n.trim() === "" || T.test(n) || w.test(n) || C.test(n) || i.push(n.replace(/\t/g, " "));
|
|
45
|
+
}
|
|
46
|
+
if (!D(i)) return {
|
|
47
|
+
text: e,
|
|
48
|
+
lineMap: n
|
|
49
|
+
};
|
|
50
|
+
let a = O(i), o = [], s = 0;
|
|
51
|
+
for (let e = 0; e <= r; e++) o.push(t[e]), s++, n.set(s, e + 1);
|
|
52
|
+
for (let e = r + 1; e < t.length; e++) {
|
|
53
|
+
let r = t[e], i = r.trim(), c = e + 1;
|
|
54
|
+
if (i === "" || T.test(r) || w.test(r)) {
|
|
55
|
+
o.push(r), s++, n.set(s, c);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (C.test(r)) continue;
|
|
59
|
+
let l = r.replace(/\t/g, " "), u = x.exec(l);
|
|
60
|
+
if (u?.index !== void 0) {
|
|
61
|
+
let e = u.index, t = Math.round(e / a) + 1, r = e + 1;
|
|
62
|
+
for (; r < l.length && S.test(l[r]);) r++;
|
|
63
|
+
for (; r < l.length && l[r] === " ";) r++;
|
|
64
|
+
let i = l.slice(r).trimEnd();
|
|
65
|
+
if (!i) throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);
|
|
66
|
+
let d = E.repeat(t);
|
|
67
|
+
o.push(d + i), s++, n.set(s, c);
|
|
68
|
+
} else if (/^[\s─━│┃└┗├┣]+$/.test(l)) continue;
|
|
69
|
+
else if (b.test(l)) o.push(r), s++, n.set(s, c);
|
|
70
|
+
else if (/^\s+/.test(l)) throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);
|
|
71
|
+
else o.push(r), s++, n.set(s, c);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
text: o.join("\n"),
|
|
75
|
+
lineMap: n
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
t(A, "preprocessBoxDrawing");
|
|
79
|
+
var j = new y(() => ({
|
|
80
|
+
cnt: 1,
|
|
81
|
+
stack: [{
|
|
82
|
+
id: 0,
|
|
83
|
+
level: -1,
|
|
84
|
+
name: "/",
|
|
85
|
+
nodeType: "directory",
|
|
86
|
+
children: []
|
|
87
|
+
}]
|
|
88
|
+
})), M = /* @__PURE__ */ t(() => {
|
|
89
|
+
j.reset(), a();
|
|
90
|
+
}, "clear"), N = /* @__PURE__ */ t(() => j.records.stack[0], "getRoot"), P = /* @__PURE__ */ t(() => j.records.cnt, "getCount"), F = c.treeView, I = {
|
|
91
|
+
clear: M,
|
|
92
|
+
addNode: /* @__PURE__ */ t((e, t, n, r, i, a) => {
|
|
93
|
+
for (; e <= j.records.stack[j.records.stack.length - 1].level;) j.records.stack.pop();
|
|
94
|
+
let o = {
|
|
95
|
+
id: j.records.cnt++,
|
|
96
|
+
level: e,
|
|
97
|
+
name: t,
|
|
98
|
+
nodeType: n,
|
|
99
|
+
icon: i,
|
|
100
|
+
cssClass: r,
|
|
101
|
+
description: a,
|
|
102
|
+
children: []
|
|
103
|
+
};
|
|
104
|
+
j.records.stack[j.records.stack.length - 1].children.push(o), j.records.stack.push(o);
|
|
105
|
+
}, "addNode"),
|
|
106
|
+
getRoot: N,
|
|
107
|
+
getCount: P,
|
|
108
|
+
getConfig: /* @__PURE__ */ t(() => p(F, o().treeView), "getConfig"),
|
|
109
|
+
getAccTitle: d,
|
|
110
|
+
getAccDescription: l,
|
|
111
|
+
getDiagramTitle: u,
|
|
112
|
+
setAccDescription: n,
|
|
113
|
+
setAccTitle: i,
|
|
114
|
+
setDiagramTitle: r
|
|
115
|
+
}, L = /* @__PURE__ */ t((e) => {
|
|
116
|
+
v(e, I);
|
|
117
|
+
for (let t of e.nodes) {
|
|
118
|
+
let e = typeof t.indent == "number" ? t.indent : 0, n = t.name, r = n.endsWith("/");
|
|
119
|
+
r && (n = n.slice(0, -1));
|
|
120
|
+
let i = r ? "directory" : "file", a = t.classAnnotation || void 0, s = t.iconAnnotation, c = s === void 0 ? void 0 : s || "none", l = t.descAnnotation || void 0, u = l ? f(l, o()) : void 0;
|
|
121
|
+
I.addNode(e, n, i, a, c, u);
|
|
122
|
+
}
|
|
123
|
+
}, "populate"), R = { parse: /* @__PURE__ */ t(async (t) => {
|
|
124
|
+
let { text: n, lineMap: r } = A(t);
|
|
125
|
+
try {
|
|
126
|
+
let t = await _("treeView", n);
|
|
127
|
+
e.debug(t), L(t);
|
|
128
|
+
} catch (e) {
|
|
129
|
+
throw r.size > 0 && e instanceof Error && (e.message = k(e.message, r)), e;
|
|
130
|
+
}
|
|
131
|
+
}, "parse") }, z = {
|
|
132
|
+
prefix: "mermaid-treeview",
|
|
133
|
+
height: 24,
|
|
134
|
+
width: 24,
|
|
135
|
+
icons: {
|
|
136
|
+
folder: { 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\"/>" },
|
|
137
|
+
file: { 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\"/>" }
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
function B(e, t) {
|
|
141
|
+
let n = t?.filenameIcons?.[e];
|
|
142
|
+
if (n) return n;
|
|
143
|
+
let r = e.lastIndexOf(".");
|
|
144
|
+
if (r > 0) {
|
|
145
|
+
let n = e.substring(r).toLowerCase(), i = t?.extensionIcons;
|
|
146
|
+
return i?.[n] ?? i?.[n.slice(1)];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
t(B, "detectIcon");
|
|
150
|
+
function V(e, t) {
|
|
151
|
+
return e.includes(":") ? e : e in z.icons || !t ? `${z.prefix}:${e}` : `${t}:${e}`;
|
|
152
|
+
}
|
|
153
|
+
t(V, "qualifyIcon");
|
|
154
|
+
function H(e, t) {
|
|
155
|
+
if (e.icon !== "none") {
|
|
156
|
+
if (e.icon) return V(e.icon, t.defaultIconPack);
|
|
157
|
+
if (t.showIcons) {
|
|
158
|
+
if (e.nodeType === "file") {
|
|
159
|
+
let n = B(e.name, t);
|
|
160
|
+
if (n === "none") return;
|
|
161
|
+
if (n) return V(n, t.defaultIconPack);
|
|
162
|
+
}
|
|
163
|
+
return `${z.prefix}:${e.nodeType === "directory" ? "folder" : "file"}`;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
t(H, "getNodeIcon"), h([{
|
|
168
|
+
name: z.prefix,
|
|
169
|
+
icons: z
|
|
170
|
+
}]);
|
|
171
|
+
var U = 14, W = 4, G = 16, K = /* @__PURE__ */ t(async (e, n) => {
|
|
172
|
+
let r = [], i = /* @__PURE__ */ t((e) => {
|
|
173
|
+
let t = H(e, n);
|
|
174
|
+
t && r.push({
|
|
175
|
+
icon: t,
|
|
176
|
+
node: e
|
|
177
|
+
}), e.children.forEach(i);
|
|
178
|
+
}, "collect");
|
|
179
|
+
i(e);
|
|
180
|
+
let a = await Promise.all(r.map(async ({ icon: e, node: t }) => ({
|
|
181
|
+
id: t.id,
|
|
182
|
+
svg: await g(e, {
|
|
183
|
+
height: U,
|
|
184
|
+
width: U
|
|
185
|
+
})
|
|
186
|
+
})));
|
|
187
|
+
return new Map(a.map(({ id: e, svg: t }) => [e, t]));
|
|
188
|
+
}, "resolveNodeIcons"), q = /* @__PURE__ */ t((e, t, n, r, i, a) => {
|
|
189
|
+
let o = r.append("g"), s = "treeView-node-label";
|
|
190
|
+
n.nodeType === "directory" && (s += " treeView-node-dir"), n.cssClass && (s += ` ${n.cssClass}`);
|
|
191
|
+
let c = U + W, l = H(n, i), u = l !== void 0;
|
|
192
|
+
l && o.append("g").attr("class", "treeView-node-icon").attr("transform", `translate(${e + i.paddingX}, ${t + i.paddingY})`).html(a.get(n.id) ?? "");
|
|
193
|
+
let d = o.append("text").text(n.name).attr("dominant-baseline", "middle").attr("class", s), { height: f, width: p } = d.node().getBBox(), m = f + i.paddingY * 2, h = e + i.paddingX + (u ? c : 0);
|
|
194
|
+
d.attr("x", h), d.attr("y", t + m / 2);
|
|
195
|
+
let g = h + p;
|
|
196
|
+
return n.BBox = {
|
|
197
|
+
x: e,
|
|
198
|
+
y: t,
|
|
199
|
+
width: p + i.paddingX * 2 + (u ? c : 0),
|
|
200
|
+
height: m
|
|
201
|
+
}, n.cssClass?.split(/\s+/).includes("highlight") && o.insert("rect", ":first-child").attr("x", e).attr("y", t + 1).attr("width", 0).attr("height", m - 2).attr("rx", 3).attr("class", "treeView-highlight-bg"), {
|
|
202
|
+
node: n,
|
|
203
|
+
nodeGroup: o,
|
|
204
|
+
labelRightEdge: g,
|
|
205
|
+
centerY: t + m / 2
|
|
206
|
+
};
|
|
207
|
+
}, "positionLabel"), J = /* @__PURE__ */ t((e, t, n, r, i, a) => e.append("line").attr("x1", t).attr("y1", n).attr("x2", r).attr("y2", i).attr("stroke-width", a).attr("class", "treeView-node-line"), "positionLine"), Y = /* @__PURE__ */ t((e, n, r, i) => {
|
|
208
|
+
let a = 0, o = 0, s = [], c = /* @__PURE__ */ t((e, t, n, r) => {
|
|
209
|
+
let c = r * (n.rowIndent + n.paddingX), l = q(c, a, t, e, n, i);
|
|
210
|
+
s.push(l);
|
|
211
|
+
let { height: u, width: d } = t.BBox;
|
|
212
|
+
J(e, c - n.rowIndent, a + u / 2, c, a + u / 2, n.lineThickness), o = Math.max(o, c + d), a += u;
|
|
213
|
+
}, "drawNode"), l = /* @__PURE__ */ t((t, n = 0) => {
|
|
214
|
+
c(e, t, r, n), t.children.forEach((e) => {
|
|
215
|
+
l(e, n + 1);
|
|
216
|
+
});
|
|
217
|
+
let { x: i, y: a, height: o } = t.BBox;
|
|
218
|
+
if (t.children.length) {
|
|
219
|
+
let { y: n, height: s } = t.children[t.children.length - 1].BBox;
|
|
220
|
+
J(e, i + r.paddingX, a + o, i + r.paddingX, n + s / 2 + r.lineThickness / 2, r.lineThickness);
|
|
221
|
+
}
|
|
222
|
+
}, "processNode");
|
|
223
|
+
l(n);
|
|
224
|
+
let u = s.filter((e) => e.node.description);
|
|
225
|
+
if (u.length > 0) {
|
|
226
|
+
let e = Math.max(...s.map((e) => e.labelRightEdge)) + G;
|
|
227
|
+
for (let t of u) {
|
|
228
|
+
let n = t.nodeGroup.append("text").text(t.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", e).attr("y", t.centerY).node().getBBox();
|
|
229
|
+
o = Math.max(o, e + n.width + r.paddingX);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
for (let e of s) if (e.node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
233
|
+
let t = e.nodeGroup.select(".treeView-highlight-bg");
|
|
234
|
+
if (!t.empty()) {
|
|
235
|
+
let n = o - e.node.BBox.x + 8;
|
|
236
|
+
t.attr("width", n), o = Math.max(o, e.node.BBox.x + n + 2);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
totalHeight: a,
|
|
241
|
+
totalWidth: o
|
|
242
|
+
};
|
|
243
|
+
}, "drawTree"), X = { draw: /* @__PURE__ */ t(async (t, n, r, i) => {
|
|
244
|
+
e.debug("Rendering treeView diagram\n" + t);
|
|
245
|
+
let a = i.db, o = a.getRoot(), c = a.getConfig(), l = m(n), u = l.append("g");
|
|
246
|
+
u.attr("class", "tree-view");
|
|
247
|
+
let { totalHeight: d, totalWidth: f } = Y(u, o, c, await K(o, c));
|
|
248
|
+
l.attr("viewBox", `-${c.lineThickness / 2} 0 ${f} ${d}`), s(l, d, f, c.useMaxWidth);
|
|
249
|
+
}, "draw") }, Z = {
|
|
250
|
+
labelFontSize: "16px",
|
|
251
|
+
labelColor: "black",
|
|
252
|
+
lineColor: "black",
|
|
253
|
+
iconColor: "#546e7a",
|
|
254
|
+
descriptionColor: "#6a9955",
|
|
255
|
+
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
256
|
+
highlightStroke: "#ffc107"
|
|
257
|
+
}, Q = {
|
|
258
|
+
db: I,
|
|
259
|
+
renderer: X,
|
|
260
|
+
parser: R,
|
|
261
|
+
styles: /* @__PURE__ */ t(({ treeView: e }) => {
|
|
262
|
+
let { labelFontSize: t, labelColor: n, lineColor: r, iconColor: i, descriptionColor: a, highlightBg: o, highlightStroke: s } = p(Z, e);
|
|
263
|
+
return `
|
|
264
|
+
.treeView-node-label {
|
|
265
|
+
font-size: ${t};
|
|
266
|
+
fill: ${n};
|
|
267
|
+
white-space: pre;
|
|
268
|
+
}
|
|
269
|
+
.treeView-node-dir {
|
|
270
|
+
font-weight: bold;
|
|
271
|
+
}
|
|
272
|
+
.treeView-node-line {
|
|
273
|
+
stroke: ${r};
|
|
274
|
+
}
|
|
275
|
+
.treeView-node-icon {
|
|
276
|
+
color: ${i};
|
|
277
|
+
}
|
|
278
|
+
.treeView-node-description {
|
|
279
|
+
font-size: ${t};
|
|
280
|
+
fill: ${a};
|
|
281
|
+
font-style: italic;
|
|
282
|
+
white-space: pre;
|
|
283
|
+
}
|
|
284
|
+
.treeView-highlight-bg {
|
|
285
|
+
fill: ${o};
|
|
286
|
+
stroke: ${s};
|
|
287
|
+
stroke-width: 1;
|
|
288
|
+
}
|
|
289
|
+
`;
|
|
290
|
+
}, "styles")
|
|
291
|
+
};
|
|
292
|
+
//#endregion
|
|
293
|
+
export { Q as diagram };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { m as e } from "./src-DbyMbLVK.js";
|
|
2
|
+
import { n as t } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
3
|
+
import { D as n, H as r, K as i, U as a, a as o, b as s, c, f as l, v as u, w as d, y as f } from "./chunk-DU6HZSFF-1zIarP1Q.js";
|
|
4
|
+
import { i as p } from "./chunk-75Z2AOVW-BsWtLgfj.js";
|
|
5
|
+
import { t as m } from "./chunk-CLGD4ZFX-Bkjwlxy9.js";
|
|
6
|
+
import { n as h } from "./mermaid-parser.core-BjLg_By9.js";
|
|
7
|
+
import { t as g } from "./chunk-JWPE2WC7-Ccb0QaC8.js";
|
|
8
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-UQ7AKVKN.mjs
|
|
9
|
+
var _ = {
|
|
10
|
+
showLegend: !0,
|
|
11
|
+
ticks: 5,
|
|
12
|
+
max: null,
|
|
13
|
+
min: 0,
|
|
14
|
+
graticule: "circle"
|
|
15
|
+
}, v = 32, y = {
|
|
16
|
+
axes: [],
|
|
17
|
+
curves: [],
|
|
18
|
+
options: _
|
|
19
|
+
}, b = structuredClone(y), x = l.radar, S = /* @__PURE__ */ t(() => p({
|
|
20
|
+
...x,
|
|
21
|
+
...s().radar
|
|
22
|
+
}), "getConfig"), C = /* @__PURE__ */ t(() => b.axes, "getAxes"), w = /* @__PURE__ */ t(() => b.curves, "getCurves"), T = /* @__PURE__ */ t(() => b.options, "getOptions"), E = /* @__PURE__ */ t((e) => {
|
|
23
|
+
b.axes = e.map((e) => ({
|
|
24
|
+
name: e.name,
|
|
25
|
+
label: e.label ?? e.name
|
|
26
|
+
}));
|
|
27
|
+
}, "setAxes"), D = /* @__PURE__ */ t((e) => {
|
|
28
|
+
b.curves = e.map((e) => ({
|
|
29
|
+
name: e.name,
|
|
30
|
+
label: e.label ?? e.name,
|
|
31
|
+
entries: O(e.entries)
|
|
32
|
+
}));
|
|
33
|
+
}, "setCurves"), O = /* @__PURE__ */ t((e) => {
|
|
34
|
+
if (e[0].axis == null) return e.map((e) => e.value);
|
|
35
|
+
let t = C();
|
|
36
|
+
if (t.length === 0) throw Error("Axes must be populated before curves for reference entries");
|
|
37
|
+
return t.map((t) => {
|
|
38
|
+
let n = e.find((e) => e.axis?.$refText === t.name);
|
|
39
|
+
if (n === void 0) throw Error("Missing entry for axis " + t.label);
|
|
40
|
+
return n.value;
|
|
41
|
+
});
|
|
42
|
+
}, "computeCurveEntries"), k = {
|
|
43
|
+
getAxes: C,
|
|
44
|
+
getCurves: w,
|
|
45
|
+
getOptions: T,
|
|
46
|
+
setAxes: E,
|
|
47
|
+
setCurves: D,
|
|
48
|
+
setOptions: /* @__PURE__ */ t((t) => {
|
|
49
|
+
let n = t.reduce((e, t) => (e[t.name] = t, e), {});
|
|
50
|
+
b.options = {
|
|
51
|
+
showLegend: n.showLegend?.value ?? _.showLegend,
|
|
52
|
+
ticks: n.ticks?.value ?? _.ticks,
|
|
53
|
+
max: n.max?.value ?? _.max,
|
|
54
|
+
min: n.min?.value ?? _.min,
|
|
55
|
+
graticule: n.graticule?.value ?? _.graticule
|
|
56
|
+
}, b.options.ticks > v && (e.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`), b.options.ticks = v);
|
|
57
|
+
}, "setOptions"),
|
|
58
|
+
getConfig: S,
|
|
59
|
+
clear: /* @__PURE__ */ t(() => {
|
|
60
|
+
o(), b = structuredClone(y);
|
|
61
|
+
}, "clear"),
|
|
62
|
+
setAccTitle: a,
|
|
63
|
+
getAccTitle: f,
|
|
64
|
+
setDiagramTitle: i,
|
|
65
|
+
getDiagramTitle: d,
|
|
66
|
+
getAccDescription: u,
|
|
67
|
+
setAccDescription: r
|
|
68
|
+
}, A = /* @__PURE__ */ t((e) => {
|
|
69
|
+
g(e, k);
|
|
70
|
+
let { axes: t, curves: n, options: r } = e;
|
|
71
|
+
k.setAxes(t), k.setCurves(n), k.setOptions(r);
|
|
72
|
+
}, "populate"), j = { parse: /* @__PURE__ */ t(async (t) => {
|
|
73
|
+
let n = await h("radar", t);
|
|
74
|
+
e.debug(n), A(n);
|
|
75
|
+
}, "parse") }, M = /* @__PURE__ */ t((e, t, n, r) => {
|
|
76
|
+
let i = r.db, a = i.getAxes(), o = i.getCurves(), s = i.getOptions(), c = i.getConfig(), l = i.getDiagramTitle(), u = N(m(t), c), d = s.max ?? Math.max(...o.map((e) => Math.max(...e.entries))), f = s.min, p = Math.min(c.width, c.height) / 2;
|
|
77
|
+
P(u, a, p, s.ticks, s.graticule), F(u, a, p, c), I(u, a, o, f, d, s.graticule, c), z(u, o, s.showLegend, c), u.append("text").attr("class", "radarTitle").text(l).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
|
|
78
|
+
}, "draw"), N = /* @__PURE__ */ t((e, t) => {
|
|
79
|
+
let n = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, i = {
|
|
80
|
+
x: t.marginLeft + t.width / 2,
|
|
81
|
+
y: t.marginTop + t.height / 2
|
|
82
|
+
};
|
|
83
|
+
return c(e, r, n, t.useMaxWidth ?? !0), e.attr("viewBox", `0 0 ${n} ${r}`).attr("overflow", "visible"), e.append("g").attr("transform", `translate(${i.x}, ${i.y})`);
|
|
84
|
+
}, "drawFrame"), P = /* @__PURE__ */ t((e, t, n, r, i) => {
|
|
85
|
+
if (i === "circle") for (let t = 0; t < r; t++) {
|
|
86
|
+
let i = n * (t + 1) / r;
|
|
87
|
+
e.append("circle").attr("r", i).attr("class", "radarGraticule");
|
|
88
|
+
}
|
|
89
|
+
else if (i === "polygon") {
|
|
90
|
+
let i = t.length;
|
|
91
|
+
for (let a = 0; a < r; a++) {
|
|
92
|
+
let o = n * (a + 1) / r, s = t.map((e, t) => {
|
|
93
|
+
let n = 2 * t * Math.PI / i - Math.PI / 2;
|
|
94
|
+
return `${o * Math.cos(n)},${o * Math.sin(n)}`;
|
|
95
|
+
}).join(" ");
|
|
96
|
+
e.append("polygon").attr("points", s).attr("class", "radarGraticule");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, "drawGraticule"), F = /* @__PURE__ */ t((e, t, n, r) => {
|
|
100
|
+
let i = t.length;
|
|
101
|
+
for (let a = 0; a < i; a++) {
|
|
102
|
+
let o = t[a].label, s = 2 * a * Math.PI / i - Math.PI / 2, c = Math.cos(s), l = Math.sin(s);
|
|
103
|
+
e.append("line").attr("x1", 0).attr("y1", 0).attr("x2", n * r.axisScaleFactor * c).attr("y2", n * r.axisScaleFactor * l).attr("class", "radarAxisLine");
|
|
104
|
+
let u = c > .01 ? "start" : c < -.01 ? "end" : "middle", d = l > .01 ? "hanging" : l < -.01 ? "auto" : "central";
|
|
105
|
+
e.append("text").text(o).attr("x", n * r.axisLabelFactor * c + 4 * c).attr("y", n * r.axisLabelFactor * l + 4 * l).attr("text-anchor", u).attr("dominant-baseline", d).attr("class", "radarAxisLabel");
|
|
106
|
+
}
|
|
107
|
+
}, "drawAxes");
|
|
108
|
+
function I(e, t, n, r, i, a, o) {
|
|
109
|
+
let s = t.length, c = Math.min(o.width, o.height) / 2;
|
|
110
|
+
n.forEach((t, n) => {
|
|
111
|
+
if (t.entries.length !== s) return;
|
|
112
|
+
let l = t.entries.map((e, t) => {
|
|
113
|
+
let n = 2 * Math.PI * t / s - Math.PI / 2, a = L(e, r, i, c);
|
|
114
|
+
return {
|
|
115
|
+
x: a * Math.cos(n),
|
|
116
|
+
y: a * Math.sin(n)
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
a === "circle" ? e.append("path").attr("d", R(l, o.curveTension)).attr("class", `radarCurve-${n}`) : a === "polygon" && e.append("polygon").attr("points", l.map((e) => `${e.x},${e.y}`).join(" ")).attr("class", `radarCurve-${n}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
t(I, "drawCurves");
|
|
123
|
+
function L(e, t, n, r) {
|
|
124
|
+
return r * (Math.min(Math.max(e, t), n) - t) / (n - t);
|
|
125
|
+
}
|
|
126
|
+
t(L, "relativeRadius");
|
|
127
|
+
function R(e, t) {
|
|
128
|
+
let n = e.length, r = `M${e[0].x},${e[0].y}`;
|
|
129
|
+
for (let i = 0; i < n; i++) {
|
|
130
|
+
let a = e[(i - 1 + n) % n], o = e[i], s = e[(i + 1) % n], c = e[(i + 2) % n], l = {
|
|
131
|
+
x: o.x + (s.x - a.x) * t,
|
|
132
|
+
y: o.y + (s.y - a.y) * t
|
|
133
|
+
}, u = {
|
|
134
|
+
x: s.x - (c.x - o.x) * t,
|
|
135
|
+
y: s.y - (c.y - o.y) * t
|
|
136
|
+
};
|
|
137
|
+
r += ` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`;
|
|
138
|
+
}
|
|
139
|
+
return `${r} Z`;
|
|
140
|
+
}
|
|
141
|
+
t(R, "closedRoundCurve");
|
|
142
|
+
function z(e, t, n, r) {
|
|
143
|
+
if (!n) return;
|
|
144
|
+
let i = (r.width / 2 + r.marginRight) * 3 / 4, a = -(r.height / 2 + r.marginTop) * 3 / 4;
|
|
145
|
+
t.forEach((t, n) => {
|
|
146
|
+
let r = e.append("g").attr("transform", `translate(${i}, ${a + n * 20})`);
|
|
147
|
+
r.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${n}`), r.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(t.label);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
t(z, "drawLegend");
|
|
151
|
+
var B = { draw: M }, V = /* @__PURE__ */ t((e, t) => {
|
|
152
|
+
let n = "";
|
|
153
|
+
for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) {
|
|
154
|
+
let i = e[`cScale${r}`];
|
|
155
|
+
n += `
|
|
156
|
+
.radarCurve-${r} {
|
|
157
|
+
color: ${i};
|
|
158
|
+
fill: ${i};
|
|
159
|
+
fill-opacity: ${t.curveOpacity};
|
|
160
|
+
stroke: ${i};
|
|
161
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
162
|
+
}
|
|
163
|
+
.radarLegendBox-${r} {
|
|
164
|
+
fill: ${i};
|
|
165
|
+
fill-opacity: ${t.curveOpacity};
|
|
166
|
+
stroke: ${i};
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
170
|
+
return n;
|
|
171
|
+
}, "genIndexStyles"), H = /* @__PURE__ */ t((e) => {
|
|
172
|
+
let t = n(), r = s(), i = p(t, r.themeVariables);
|
|
173
|
+
return {
|
|
174
|
+
themeVariables: i,
|
|
175
|
+
radarOptions: p(i.radar, e)
|
|
176
|
+
};
|
|
177
|
+
}, "buildRadarStyleOptions"), U = {
|
|
178
|
+
parser: j,
|
|
179
|
+
db: k,
|
|
180
|
+
renderer: B,
|
|
181
|
+
styles: /* @__PURE__ */ t(({ radar: e } = {}) => {
|
|
182
|
+
let { themeVariables: t, radarOptions: n } = H(e);
|
|
183
|
+
return `
|
|
184
|
+
.radarTitle {
|
|
185
|
+
font-size: ${t.fontSize};
|
|
186
|
+
color: ${t.titleColor};
|
|
187
|
+
dominant-baseline: hanging;
|
|
188
|
+
text-anchor: middle;
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLine {
|
|
191
|
+
stroke: ${n.axisColor};
|
|
192
|
+
stroke-width: ${n.axisStrokeWidth};
|
|
193
|
+
}
|
|
194
|
+
.radarAxisLabel {
|
|
195
|
+
font-size: ${n.axisLabelFontSize}px;
|
|
196
|
+
color: ${n.axisColor};
|
|
197
|
+
}
|
|
198
|
+
.radarGraticule {
|
|
199
|
+
fill: ${n.graticuleColor};
|
|
200
|
+
fill-opacity: ${n.graticuleOpacity};
|
|
201
|
+
stroke: ${n.graticuleColor};
|
|
202
|
+
stroke-width: ${n.graticuleStrokeWidth};
|
|
203
|
+
}
|
|
204
|
+
.radarLegendText {
|
|
205
|
+
text-anchor: start;
|
|
206
|
+
font-size: ${n.legendFontSize}px;
|
|
207
|
+
dominant-baseline: hanging;
|
|
208
|
+
}
|
|
209
|
+
${V(t, n)}
|
|
210
|
+
`;
|
|
211
|
+
}, "styles")
|
|
212
|
+
};
|
|
213
|
+
//#endregion
|
|
214
|
+
export { U as diagram };
|