@smarter.sh/ui-chat 0.7.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/README.md +353 -106
- 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 +3048 -2808
- 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/DocsDialog/Component.d.ts +8 -0
- package/dist/types/src/components/DocsDialog/data.d.ts +18 -0
- package/dist/types/src/components/DocsDialog/index.d.ts +2 -0
- package/dist/types/src/components/SmarterChat/Component.d.ts +7 -3
- package/dist/types/src/components/SmarterChat/icons.d.ts +2 -0
- package/dist/types/src/contract.gen.d.ts +56 -0
- 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/lib/styles.d.ts +40 -0
- package/dist/types/src/types.d.ts +7 -0
- package/dist/ui-chat.css +1 -1
- package/package.json +10 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { n as e } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
2
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-JWPE2WC7.mjs
|
|
3
|
+
function t(e, t) {
|
|
4
|
+
e.accDescr && t.setAccDescription?.(e.accDescr), e.accTitle && t.setAccTitle?.(e.accTitle), e.title && t.setDiagramTitle?.(e.title);
|
|
5
|
+
}
|
|
6
|
+
e(t, "populateCommonDb");
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t };
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { m as e, p as t } from "./src-DbyMbLVK.js";
|
|
2
|
+
import { n } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
3
|
+
import { T as r, g as i, x as a } from "./chunk-DU6HZSFF-1zIarP1Q.js";
|
|
4
|
+
import { a as o, i as s } from "./chunk-P2QGCYS3-BUVAOFF-.js";
|
|
5
|
+
import { n as c } from "./chunk-GMAD6QVW-Dc0gE_3Q.js";
|
|
6
|
+
import { t as l } from "./rough.esm-DXYGHN3m.js";
|
|
7
|
+
import { n as u, r as d, t as f } from "./chunk-4HAMMTFA-Dhz0SVnN.js";
|
|
8
|
+
import { n as p } from "./chunk-GVQU2GXP-CWFtOgtb.js";
|
|
9
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-L3NEJ4N5.mjs
|
|
10
|
+
var m = /* @__PURE__ */ n(async (n, r) => {
|
|
11
|
+
let u = a(), { themeVariables: f, handDrawnSeed: p } = u, { clusterBkg: m, clusterBorder: h } = f, g = h, { labelStyles: _, nodeStyles: v, borderStyles: y, backgroundStyles: b } = s(r), x = n.insert("g").attr("class", "cluster swimlane " + (r.cssClasses || "")).attr("id", r.id).attr("data-id", r.id).attr("data-et", "cluster").attr("data-look", r.look), S = i(u.flowchart.htmlLabels), C = r.direction === "LR", w = x.insert("g").attr("class", "cluster-label swimlane-label"), T = await c(w, r.label, {
|
|
12
|
+
style: r.labelStyle,
|
|
13
|
+
useHtmlLabels: S,
|
|
14
|
+
isNode: !0,
|
|
15
|
+
width: r.width
|
|
16
|
+
}), E = T.getBBox();
|
|
17
|
+
if (S) {
|
|
18
|
+
let e = T.children[0], n = t(T);
|
|
19
|
+
E = e.getBoundingClientRect(), n.attr("width", E.width), n.attr("height", E.height);
|
|
20
|
+
}
|
|
21
|
+
let D = r.padding ?? 0, O = r.width <= E.width + D ? E.width + D : r.width;
|
|
22
|
+
r.diff = r.width <= E.width + D ? (O - r.width) / 2 - D : -D;
|
|
23
|
+
let k = r.height, A = r.y - k / 2, j = r.y + k / 2, M = r.x - O / 2, N = r.swimlaneContentTop === void 0 ? A + k / 3 : r.swimlaneContentTop, P = C ? 4 : 0, F = E.height + 2 * P, I, L;
|
|
24
|
+
if (C) {
|
|
25
|
+
let e = Math.max(F, E.height + 2 * P), t = M + e, n = Math.max(0, O - e);
|
|
26
|
+
if (r.look === "handDrawn") {
|
|
27
|
+
let i = l.svg(x), a = o(r, {
|
|
28
|
+
roughness: .7,
|
|
29
|
+
fill: m,
|
|
30
|
+
stroke: g,
|
|
31
|
+
fillWeight: 3,
|
|
32
|
+
seed: p
|
|
33
|
+
}), s = o(r, {
|
|
34
|
+
roughness: .7,
|
|
35
|
+
fill: "none",
|
|
36
|
+
stroke: g,
|
|
37
|
+
seed: p
|
|
38
|
+
}), c = i.rectangle(M, A, e, k, a);
|
|
39
|
+
I = x.insert(() => c, ":first-child");
|
|
40
|
+
let u = i.rectangle(t, A, n, k, s);
|
|
41
|
+
L = x.insert(() => u, ":first-child"), I.select("path:nth-child(2)").attr("style", y.join(";")), I.select("path").attr("style", b.join(";").replace("fill", "stroke"));
|
|
42
|
+
} else I = x.insert("rect", ":first-child"), L = x.insert("rect", ":first-child"), I.attr("class", "swimlane-title").attr("style", v).attr("x", M).attr("y", A).attr("width", e).attr("height", k).attr("fill", m).attr("stroke", g), L.attr("class", "swimlane-body").attr("style", v).attr("x", t).attr("y", A).attr("width", n).attr("height", k).attr("fill", "none").attr("stroke", g);
|
|
43
|
+
let i = M + e / 2, a = r.y;
|
|
44
|
+
w.attr("transform", `translate(${i}, ${a}) rotate(-90) translate(${-E.width / 2}, ${-E.height / 2})`);
|
|
45
|
+
} else {
|
|
46
|
+
let e = Math.max(0, N - A), t = Math.min(F, e), n = A + t, i = Math.max(0, j - n), a = r.x - O / 2;
|
|
47
|
+
if (r.look === "handDrawn") {
|
|
48
|
+
let e = l.svg(x), s = o(r, {
|
|
49
|
+
roughness: .7,
|
|
50
|
+
fill: m,
|
|
51
|
+
stroke: g,
|
|
52
|
+
fillWeight: 3,
|
|
53
|
+
seed: p
|
|
54
|
+
}), c = o(r, {
|
|
55
|
+
roughness: .7,
|
|
56
|
+
fill: "none",
|
|
57
|
+
stroke: g,
|
|
58
|
+
seed: p
|
|
59
|
+
}), u = e.rectangle(a, A, O, t, s);
|
|
60
|
+
I = x.insert(() => u, ":first-child");
|
|
61
|
+
let d = e.rectangle(a, n, O, i, c);
|
|
62
|
+
L = x.insert(() => d, ":first-child"), I.select("path:nth-child(2)").attr("style", y.join(";")), I.select("path").attr("style", b.join(";").replace("fill", "stroke"));
|
|
63
|
+
} else I = x.insert("rect", ":first-child"), L = x.insert("rect", ":first-child"), I.attr("class", "swimlane-title").attr("style", v).attr("x", a).attr("y", A).attr("width", O).attr("height", t).attr("fill", m).attr("stroke", g), L.attr("class", "swimlane-body").attr("style", v).attr("x", a).attr("y", n).attr("width", O).attr("height", i).attr("fill", "none").attr("stroke", g);
|
|
64
|
+
let s = r.x - E.width / 2, c = A + (t - E.height) / 2;
|
|
65
|
+
w.attr("transform", `translate(${s}, ${c})`);
|
|
66
|
+
}
|
|
67
|
+
if (e.trace("Swimlane data ", r, JSON.stringify(r)), _) {
|
|
68
|
+
let e = w.select("span");
|
|
69
|
+
e && e.attr("style", _);
|
|
70
|
+
}
|
|
71
|
+
return r.offsetX = 0, r.width = O, r.height = k, r.offsetY = E.height - D / 2, r.intersect = function(e) {
|
|
72
|
+
return d(r, e);
|
|
73
|
+
}, {
|
|
74
|
+
cluster: x,
|
|
75
|
+
labelBBox: E
|
|
76
|
+
};
|
|
77
|
+
}, "swimlane"), h = /* @__PURE__ */ n(async (n, i) => {
|
|
78
|
+
e.info("Creating subgraph rect for ", i.id, i);
|
|
79
|
+
let m = a(), { themeVariables: h, handDrawnSeed: g } = m, { clusterBkg: _, clusterBorder: v } = h, { labelStyles: y, nodeStyles: b, borderStyles: x, backgroundStyles: S } = s(i), C = n.insert("g").attr("class", "cluster " + i.cssClasses).attr("id", i.domId).attr("data-look", i.look), w = r(m), T = C.insert("g").attr("class", "cluster-label "), E;
|
|
80
|
+
E = i.labelType === "markdown" ? await c(T, i.label, {
|
|
81
|
+
style: i.labelStyle,
|
|
82
|
+
useHtmlLabels: w,
|
|
83
|
+
isNode: !0,
|
|
84
|
+
width: i.width
|
|
85
|
+
}) : await f(T, i.label, i.labelStyle || "", !1, !0);
|
|
86
|
+
let D = E.getBBox();
|
|
87
|
+
if (r(m)) {
|
|
88
|
+
let e = E.children[0], n = t(E);
|
|
89
|
+
D = e.getBoundingClientRect(), n.attr("width", D.width), n.attr("height", D.height);
|
|
90
|
+
}
|
|
91
|
+
let O = i.width <= D.width + i.padding ? D.width + i.padding : i.width;
|
|
92
|
+
i.diff = i.width <= D.width + i.padding ? (O - i.width) / 2 - i.padding : -i.padding;
|
|
93
|
+
let k = i.height, A = i.x - O / 2, j = i.y - k / 2;
|
|
94
|
+
e.trace("Data ", i, JSON.stringify(i));
|
|
95
|
+
let M;
|
|
96
|
+
if (i.look === "handDrawn") {
|
|
97
|
+
let t = l.svg(C), n = o(i, {
|
|
98
|
+
roughness: .7,
|
|
99
|
+
fill: _,
|
|
100
|
+
stroke: v,
|
|
101
|
+
fillWeight: 3,
|
|
102
|
+
seed: g
|
|
103
|
+
}), r = t.path(u(A, j, O, k, 0), n);
|
|
104
|
+
M = C.insert(() => (e.debug("Rough node insert CXC", r), r), ":first-child"), M.select("path:nth-child(2)").attr("style", x.join(";")), M.select("path").attr("style", S.join(";").replace("fill", "stroke"));
|
|
105
|
+
} else M = C.insert("rect", ":first-child"), M.attr("style", b).attr("rx", i.rx).attr("ry", i.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
|
|
106
|
+
let { subGraphTitleTopMargin: N } = p(m);
|
|
107
|
+
if (T.attr("transform", `translate(${i.x - D.width / 2}, ${i.y - i.height / 2 + N})`), y) {
|
|
108
|
+
let e = T.select("span");
|
|
109
|
+
e && e.attr("style", y);
|
|
110
|
+
}
|
|
111
|
+
let P = M.node().getBBox();
|
|
112
|
+
return i.offsetX = 0, i.width = P.width, i.height = P.height, i.offsetY = D.height - i.padding / 2, i.intersect = function(e) {
|
|
113
|
+
return d(i, e);
|
|
114
|
+
}, {
|
|
115
|
+
cluster: C,
|
|
116
|
+
labelBBox: D
|
|
117
|
+
};
|
|
118
|
+
}, "rect"), g = {
|
|
119
|
+
rect: h,
|
|
120
|
+
squareRect: h,
|
|
121
|
+
roundedWithTitle: /* @__PURE__ */ n(async (e, n) => {
|
|
122
|
+
let i = a(), { themeVariables: o, handDrawnSeed: s } = i, { altBackground: c, compositeBackground: p, compositeTitleBackground: m, nodeBorder: h } = o, g = e.insert("g").attr("class", n.cssClasses).attr("id", n.domId).attr("data-id", n.id).attr("data-look", n.look), _ = g.insert("g", ":first-child"), v = g.insert("g").attr("class", "cluster-label"), y = g.append("rect"), b = await f(v, n.label, n.labelStyle, void 0, !0), x = b.getBBox();
|
|
123
|
+
if (r(i)) {
|
|
124
|
+
let e = b.children[0], n = t(b);
|
|
125
|
+
x = e.getBoundingClientRect(), n.attr("width", x.width), n.attr("height", x.height);
|
|
126
|
+
}
|
|
127
|
+
let S = 0 * n.padding, C = S / 2, w = (n.width <= x.width + n.padding ? x.width + n.padding : n.width) + S;
|
|
128
|
+
n.diff = n.width <= x.width + n.padding ? (w - n.width) / 2 - n.padding : -n.padding;
|
|
129
|
+
let T = n.height + S, E = n.height + S - x.height - 6, D = n.x - w / 2, O = n.y - T / 2;
|
|
130
|
+
n.width = w;
|
|
131
|
+
let k = n.y - n.height / 2 - C + x.height + 2, A;
|
|
132
|
+
if (n.look === "handDrawn") {
|
|
133
|
+
let e = n.cssClasses.includes("statediagram-cluster-alt"), t = l.svg(g), r = n.rx || n.ry ? t.path(u(D, O, w, T, 10), {
|
|
134
|
+
roughness: .7,
|
|
135
|
+
fill: m,
|
|
136
|
+
fillStyle: "solid",
|
|
137
|
+
stroke: h,
|
|
138
|
+
seed: s
|
|
139
|
+
}) : t.rectangle(D, O, w, T, { seed: s });
|
|
140
|
+
A = g.insert(() => r, ":first-child");
|
|
141
|
+
let i = t.rectangle(D, k, w, E, {
|
|
142
|
+
fill: e ? c : p,
|
|
143
|
+
fillStyle: e ? "hachure" : "solid",
|
|
144
|
+
stroke: h,
|
|
145
|
+
seed: s
|
|
146
|
+
});
|
|
147
|
+
A = g.insert(() => r, ":first-child"), y = g.insert(() => i);
|
|
148
|
+
} else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look", n.look), y.attr("class", "inner").attr("x", D).attr("y", k).attr("width", w).attr("height", E);
|
|
149
|
+
return v.attr("transform", `translate(${n.x - x.width / 2}, ${O + 1 - (r(i) ? 0 : 3)})`), n.height = A.node().getBBox().height, n.offsetX = 0, n.offsetY = x.height - n.padding / 2, n.labelBBox = x, n.intersect = function(e) {
|
|
150
|
+
return d(n, e);
|
|
151
|
+
}, {
|
|
152
|
+
cluster: g,
|
|
153
|
+
labelBBox: x
|
|
154
|
+
};
|
|
155
|
+
}, "roundedWithTitle"),
|
|
156
|
+
noteGroup: /* @__PURE__ */ n((e, t) => {
|
|
157
|
+
let n = e.insert("g").attr("class", "note-cluster").attr("id", t.domId), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
|
|
158
|
+
r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
|
|
159
|
+
let o = r.node().getBBox();
|
|
160
|
+
return t.width = o.width, t.height = o.height, t.intersect = function(e) {
|
|
161
|
+
return d(t, e);
|
|
162
|
+
}, {
|
|
163
|
+
cluster: n,
|
|
164
|
+
labelBBox: {
|
|
165
|
+
width: 0,
|
|
166
|
+
height: 0
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}, "noteGroup"),
|
|
170
|
+
divider: /* @__PURE__ */ n((e, t) => {
|
|
171
|
+
let { themeVariables: n, handDrawnSeed: r } = a(), { nodeBorder: i } = n, o = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-look", t.look), s = o.insert("g", ":first-child"), c = 0 * t.padding, u = t.width + c;
|
|
172
|
+
t.diff = -t.padding;
|
|
173
|
+
let f = t.height + c, p = t.x - u / 2, m = t.y - f / 2;
|
|
174
|
+
t.width = u;
|
|
175
|
+
let h;
|
|
176
|
+
if (t.look === "handDrawn") {
|
|
177
|
+
let e = l.svg(o).rectangle(p, m, u, f, {
|
|
178
|
+
fill: "lightgrey",
|
|
179
|
+
roughness: .5,
|
|
180
|
+
strokeLineDash: [5],
|
|
181
|
+
stroke: i,
|
|
182
|
+
seed: r
|
|
183
|
+
});
|
|
184
|
+
h = o.insert(() => e, ":first-child");
|
|
185
|
+
} else {
|
|
186
|
+
h = s.insert("rect", ":first-child");
|
|
187
|
+
let e = "outer";
|
|
188
|
+
e = (t.look, "divider"), h.attr("class", e).attr("x", p).attr("y", m).attr("width", u).attr("height", f).attr("data-look", t.look);
|
|
189
|
+
}
|
|
190
|
+
return t.height = h.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
|
|
191
|
+
return d(t, e);
|
|
192
|
+
}, {
|
|
193
|
+
cluster: o,
|
|
194
|
+
labelBBox: {}
|
|
195
|
+
};
|
|
196
|
+
}, "divider"),
|
|
197
|
+
kanbanSection: /* @__PURE__ */ n(async (n, i) => {
|
|
198
|
+
e.info("Creating subgraph rect for ", i.id, i);
|
|
199
|
+
let f = a(), { themeVariables: m, handDrawnSeed: h } = f, { clusterBkg: g, clusterBorder: _ } = m, { labelStyles: v, nodeStyles: y, borderStyles: b, backgroundStyles: x } = s(i), S = n.insert("g").attr("class", "cluster " + i.cssClasses).attr("id", i.domId).attr("data-look", i.look), C = r(f), w = S.insert("g").attr("class", "cluster-label "), T = await c(w, i.label, {
|
|
200
|
+
style: i.labelStyle,
|
|
201
|
+
useHtmlLabels: C,
|
|
202
|
+
isNode: !0,
|
|
203
|
+
width: i.width
|
|
204
|
+
}), E = T.getBBox();
|
|
205
|
+
if (r(f)) {
|
|
206
|
+
let e = T.children[0], n = t(T);
|
|
207
|
+
E = e.getBoundingClientRect(), n.attr("width", E.width), n.attr("height", E.height);
|
|
208
|
+
}
|
|
209
|
+
let D = i.width <= E.width + i.padding ? E.width + i.padding : i.width;
|
|
210
|
+
i.diff = i.width <= E.width + i.padding ? (D - i.width) / 2 - i.padding : -i.padding;
|
|
211
|
+
let O = i.height, k = i.x - D / 2, A = i.y - O / 2;
|
|
212
|
+
e.trace("Data ", i, JSON.stringify(i));
|
|
213
|
+
let j;
|
|
214
|
+
if (i.look === "handDrawn") {
|
|
215
|
+
let t = l.svg(S), n = o(i, {
|
|
216
|
+
roughness: .7,
|
|
217
|
+
fill: g,
|
|
218
|
+
stroke: _,
|
|
219
|
+
fillWeight: 4,
|
|
220
|
+
seed: h
|
|
221
|
+
}), r = t.path(u(k, A, D, O, i.rx), n);
|
|
222
|
+
j = S.insert(() => (e.debug("Rough node insert CXC", r), r), ":first-child"), j.select("path:nth-child(2)").attr("style", b.join(";")), j.select("path").attr("style", x.join(";").replace("fill", "stroke"));
|
|
223
|
+
} else j = S.insert("rect", ":first-child"), j.attr("style", y).attr("rx", i.rx).attr("ry", i.ry).attr("x", k).attr("y", A).attr("width", D).attr("height", O);
|
|
224
|
+
let { subGraphTitleTopMargin: M } = p(f);
|
|
225
|
+
if (w.attr("transform", `translate(${i.x - E.width / 2}, ${i.y - i.height / 2 + M})`), v) {
|
|
226
|
+
let e = w.select("span");
|
|
227
|
+
e && e.attr("style", v);
|
|
228
|
+
}
|
|
229
|
+
let N = j.node().getBBox();
|
|
230
|
+
return i.offsetX = 0, i.width = N.width, i.height = N.height, i.offsetY = E.height - i.padding / 2, i.intersect = function(e) {
|
|
231
|
+
return d(i, e);
|
|
232
|
+
}, {
|
|
233
|
+
cluster: S,
|
|
234
|
+
labelBBox: E
|
|
235
|
+
};
|
|
236
|
+
}, "kanbanSection"),
|
|
237
|
+
swimlane: m
|
|
238
|
+
}, _ = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ n(async (e, t) => {
|
|
239
|
+
let n = await g[t.shape || "rect"](e, t);
|
|
240
|
+
return _.set(t.id, n), n;
|
|
241
|
+
}, "insertCluster"), y = /* @__PURE__ */ n(() => {
|
|
242
|
+
_ = /* @__PURE__ */ new Map();
|
|
243
|
+
}, "clear");
|
|
244
|
+
//#endregion
|
|
245
|
+
export { v as n, y as t };
|