@nxgt/material-vue 0.16.0 → 0.19.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 +4 -0
- package/dist/_baseIsEqual-Cj6hHjs0.js +226 -0
- package/dist/abnfDiagram-O67JEVCF-Cl_I9xuI.js +89 -0
- package/dist/arc-DNNg1pxp.js +80 -0
- package/dist/architecture-7GRP2DOG-DDr0RGVC.js +3 -0
- package/dist/architectureDiagram-NJMV4G6O-CVS4UUCi.js +4146 -0
- package/dist/array-CApNbSU9.js +6 -0
- package/dist/blockDiagram-BEXU5L5S-B5Z0jbc8.js +1946 -0
- package/dist/c4Diagram-YGBWAQC7-B6jKsl3h.js +2990 -0
- package/dist/{camera-Cbd1TWFd.js → camera-oxz1xItP.js} +4 -4
- package/dist/channel-BA1GJyZ7.js +5 -0
- package/dist/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
- package/dist/chunk-3FUC2YCW-CX-v_TQz.js +364 -0
- package/dist/chunk-5DYCD2WN-B9vjeX2u.js +37 -0
- package/dist/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
- package/dist/chunk-6AEJRKK7-D9IaQdwq.js +10 -0
- package/dist/chunk-742MDFTN-BIhVe9GR.js +275 -0
- package/dist/chunk-7INBJB4K-CwPgdc2G.js +4487 -0
- package/dist/chunk-7M6MHVWA-Deh_-m6x.js +4256 -0
- package/dist/chunk-7PRAP22T-CofnNOEr.js +67 -0
- package/dist/chunk-DUW6YSOI-BdOla2G8.js +10 -0
- package/dist/chunk-FOHPRMQF-Crq0JMf2.js +21388 -0
- package/dist/chunk-GNY47TPC-rS2K544k.js +75 -0
- package/dist/chunk-GTNCS2PH-BR0O70z_.js +490 -0
- package/dist/chunk-GWA4HPMP-DU9lUCZD.js +61 -0
- package/dist/chunk-J5ZVWO5B-CYzz6Pq8.js +12 -0
- package/dist/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
- package/dist/chunk-LNGE3PJU-CiGrDO_F.js +1513 -0
- package/dist/chunk-MBY4JIJT-HYVRUG_P.js +1847 -0
- package/dist/chunk-NETBCI7D-C8amwD_P.js +236 -0
- package/dist/chunk-O7XYJQB3-WMQqqzRb.js +3922 -0
- package/dist/chunk-UA2S7LBM-DtBatid7.js +363 -0
- package/dist/chunk-WEXAMYUT-Cc10h8ed.js +26 -0
- package/dist/chunk-XXDRQBXY-B2pGFcse.js +9 -0
- package/dist/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
- package/dist/chunk-Z7XXMR3K-CJmsOGTV.js +676 -0
- package/dist/chunk-ZIGJFQKS-DBdWb0bj.js +1366 -0
- package/dist/classDiagram-v2-NBCMYWYE-Caqw5P6A.js +3397 -0
- package/dist/{components-DLtnz66n.js → components-IbdMALGv.js} +43465 -18610
- package/dist/components.js +5 -5
- package/dist/{composables-BJ2GgDD0.js → composables-6zV0t-y7.js} +1 -1
- package/dist/composables.js +1 -1
- package/dist/cose-bilkent-JH36ORCC-DStMi-eo.js +2251 -0
- package/dist/cynefin-OW5HDTMX-B8HVdZhp.js +3 -0
- package/dist/cynefinDiagram-VND7K2PF-0Mq0e5NQ.js +349 -0
- package/dist/cytoscape.esm-_jXi1N4y.js +18151 -0
- package/dist/dagre-6A5THRUB-EHXNn6Wq.js +2192 -0
- package/dist/defaultLocale-DnzPsei5.js +201 -0
- package/dist/diagram-22UHCM2B-B3RAQlqQ.js +5084 -0
- package/dist/diagram-3UASUU5V-BznCZHss.js +525 -0
- package/dist/diagram-ATOU4E4O-DtIUxSAn.js +432 -0
- package/dist/diagram-CDSNMT55-DOjN3BR2.js +301 -0
- package/dist/diagram-MLGK6HIB-Dx2UboD6.js +134 -0
- package/dist/diagram-MPIPVDR6-DnPL3RV0.js +214 -0
- package/dist/dist-D9zvfe2i.js +59 -0
- package/dist/{dnd-Cmcrm28l.js → dnd-CaDeYjQx.js} +1 -1
- package/dist/dnd.js +1 -1
- package/dist/ebnfDiagram-ZINNZB2B-BNbxCL0b.js +100 -0
- package/dist/elk-276RUBZZ-B9WeHolc.js +47597 -0
- package/dist/erDiagram-OPXOYQCR-DReZElBu.js +1970 -0
- package/dist/eventmodeling-NTZA5JFV-C1CEo-26.js +3 -0
- package/dist/flowDiagram-KWPJA3E3-DYss4vEI.js +17 -0
- package/dist/ganttDiagram-FUAMR5RP-64EZDDmC.js +3083 -0
- package/dist/gitGraph-4MIJSDKK-BTeCS_5q.js +3 -0
- package/dist/gitGraphDiagram-X574FWY7-DmMMrp5A.js +729 -0
- package/dist/graphlib-CrmIPC4m.js +372 -0
- package/dist/{i18n-DmMS3ID3.js → i18n-OBzfa-B7.js} +233 -924
- package/dist/i18n.js +2 -2
- package/dist/info-A6RAGUB7-BvtuPd9C.js +3 -0
- package/dist/infoDiagram-VRGFBTTK-XlBUAu0t.js +20 -0
- package/dist/init-MwSGRDIl.js +15 -0
- package/dist/isArrayLikeObject-VG1KOJ3m.js +539 -0
- package/dist/isEmpty-CMjyBU-a.js +136 -0
- package/dist/ishikawaDiagram-OU5B5YK6-C9cMWMPO.js +719 -0
- package/dist/journeyDiagram-ZHPQQLJL-DXdfP9BW.js +884 -0
- package/dist/kanban-definition-PNTS6WVX-DhOBy3A0.js +976 -0
- package/dist/katex-BMQ6LGsM.js +21962 -0
- package/dist/lib/components/index.d.ts +4 -0
- package/dist/lib/components/ui/chat/chat-composer-mentions.vue.d.ts +13 -0
- package/dist/lib/components/ui/chat/chat-composer.vue.d.ts +6 -2
- package/dist/lib/components/ui/contacts/consts.d.ts +1 -1
- package/dist/lib/components/ui/emoji/emoji-list.vue.d.ts +11 -0
- package/dist/lib/components/ui/emoji/emoji-picker.vue.d.ts +12 -0
- package/dist/lib/components/ui/emoji/emoji.utils.d.ts +2 -0
- package/dist/lib/components/ui/emoji/index.d.ts +4 -0
- package/dist/lib/components/ui/emoji/types.d.ts +6 -0
- package/dist/lib/components/ui/markdown/index.d.ts +2 -0
- package/dist/lib/components/ui/markdown/markdown.utils.d.ts +10 -0
- package/dist/lib/components/ui/markdown/markdown.vue.d.ts +10 -0
- package/dist/lib/components/ui/markdown/mermaid.lazy.d.ts +12 -0
- package/dist/lib/components/ui/markdown/partials/mermaid-diagram.vue.d.ts +7 -0
- package/dist/lib/components/ui/mentions/index.d.ts +4 -0
- package/dist/lib/components/ui/mentions/mention-list.vue.d.ts +16 -0
- package/dist/lib/components/ui/mentions/mentions.utils.d.ts +7 -0
- package/dist/lib/components/ui/mentions/types.d.ts +5 -0
- package/dist/lib/components/ui/terminal/index.d.ts +3 -0
- package/dist/lib/components/ui/terminal/terminal.utils.d.ts +5 -0
- package/dist/lib/components/ui/terminal/terminal.vue.d.ts +17 -0
- package/dist/lib/i18n/resources/en/index.d.ts +7 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +7 -0
- package/dist/lib/i18n/resources/fr/index.d.ts +7 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +7 -0
- package/dist/lib/i18n/resources/index.d.ts +14 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/nuxt/component-names.d.ts +1 -1
- package/dist/lib-B9AHrvmh.js +389 -0
- package/dist/lib.js +1 -1
- package/dist/line-UP6dkL36.js +34 -0
- package/dist/linear-bD_QoED_.js +289 -0
- package/dist/main.js +9 -9
- package/dist/material-vue.css +1 -1
- package/dist/merge-B4IBXGaq.js +170 -0
- package/dist/mermaid-parser.core-Cz-MfB4Z.js +638 -0
- package/dist/mermaid.core-C_Rtflmc.js +1096 -0
- package/dist/mindmap-definition-NLK3R4M7-CO6s2Afv.js +1008 -0
- package/dist/ordinal-D_ZgubzR.js +65 -0
- package/dist/packet-AYTQ26CC-CshIswP8.js +3 -0
- package/dist/path-DGNPZRdx.js +85 -0
- package/dist/{pdf-outline-sidebar-BBXJRwdt.js → pdf-outline-sidebar-D5VedBgk.js} +3 -2
- package/dist/{pdf-page-DZyTFukn.js → pdf-page-B1Ze518d.js} +1 -1
- package/dist/{pdf-page-list-C3GukJ3_.js → pdf-page-list-CBJziavm.js} +3 -2
- package/dist/{pdf-reader-Ci4v2Ff9.js → pdf-reader-Cn1uxtJN.js} +13 -13
- package/dist/{pdf-sidebar-Dl8fQStG.js → pdf-sidebar-PXfgGlmq.js} +4 -4
- package/dist/{pdf-thumbnail-sidebar-GS_V0PGc.js → pdf-thumbnail-sidebar-7agqWsXT.js} +4 -3
- package/dist/{pdf-toolbar-D37w-WIK.js → pdf-toolbar-Blm9CFvh.js} +22 -21
- package/dist/pegDiagram-GJSIUBJH-gvsGke9W.js +94 -0
- package/dist/pie-WAS4IAKB-CYs22y4X.js +3 -0
- package/dist/pieDiagram-5QR66LMP-DLBcErnI.js +205 -0
- package/dist/quadrantDiagram-O4NWA36T-Bn3CmGxM.js +2001 -0
- package/dist/radar-RG4KPBEZ-BOJKjbGv.js +3 -0
- package/dist/railroad-74A4TZTK-Dt1BmUkI.js +3 -0
- package/dist/railroad-abnf-HS5TGJTU-Cs9GMUMY.js +3 -0
- package/dist/railroad-ebnf-LZEXJU2U-D4y0fXoW.js +3 -0
- package/dist/railroad-peg-WCYAUIDC-D2f_ZNR5.js +3 -0
- package/dist/railroadDiagram-XR7U4H2S-DLeBxWbV.js +76 -0
- package/dist/requirementDiagram-PLB6GJNP-JpWB5sEv.js +2228 -0
- package/dist/rolldown-runtime-CWhphoD1.js +23 -0
- package/dist/rough.esm-rcMoXTJj.js +1352 -0
- package/dist/sankeyDiagram-IPEJSGJF-a4rFl5rR.js +970 -0
- package/dist/sequenceDiagram-PO4LG4MO-CjUigcL2.js +4200 -0
- package/dist/sizeCapture-INFHLROL-CHXIsPO_.js +46 -0
- package/dist/src-CNRY2AUH.js +2142 -0
- package/dist/stateDiagram-v2-GCMORJYK-DJkVDIb0.js +2143 -0
- package/dist/{stx-player-C0FOaRjU.js → stx-player-rs3uH0iI.js} +17 -17
- package/dist/swimlanes-2SLR337P-D7Ff0hLr.js +4763 -0
- package/dist/swimlanesDiagram-TC7HE7FX-DZZ9d76C.js +28 -0
- package/dist/timeline-definition-EJHVYXUP-C0aHlt9K.js +1073 -0
- package/dist/treeView-Q6P3EWNA-BrJylG9N.js +3 -0
- package/dist/treemap-WGGIJYW6-DpIZuqbj.js +3 -0
- package/dist/usecaseDiagram-POWQR4AR-BrRAt7Wu.js +9932 -0
- package/dist/vennDiagram-UO4OBE2U-B22Jhju8.js +1880 -0
- package/dist/wardley-WFR3VGLG-CbwdAAbH.js +3 -0
- package/dist/wardleyDiagram-VNRHLVJA-Dw4YgRiQ.js +645 -0
- package/dist/xychartDiagram-PMCCYNJV-DtuDs9I7.js +2214 -0
- package/lib/nuxt/component-names.ts +2 -0
- package/package.json +5 -1
- package/dist/lib-CT0uRn8S.js +0 -611
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { n as e } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
2
|
+
import { m as t } from "./src-CNRY2AUH.js";
|
|
3
|
+
import { b as n, s as r } from "./chunk-O7XYJQB3-WMQqqzRb.js";
|
|
4
|
+
import { d as i } from "./chunk-ZIGJFQKS-DBdWb0bj.js";
|
|
5
|
+
import { t as a } from "./chunk-DUW6YSOI-BdOla2G8.js";
|
|
6
|
+
import { o } from "./chunk-7INBJB4K-CwPgdc2G.js";
|
|
7
|
+
import { r as s } from "./chunk-5DYCD2WN-B9vjeX2u.js";
|
|
8
|
+
import { a as c, c as l, i as u, l as d } from "./chunk-Z7XXMR3K-CJmsOGTV.js";
|
|
9
|
+
import { r as f } from "./chunk-UA2S7LBM-DtBatid7.js";
|
|
10
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-GNY47TPC.mjs
|
|
11
|
+
var p = {
|
|
12
|
+
common: r,
|
|
13
|
+
getConfig: n,
|
|
14
|
+
insertCluster: f,
|
|
15
|
+
insertEdge: u,
|
|
16
|
+
insertEdgeLabel: c,
|
|
17
|
+
insertMarkers: l,
|
|
18
|
+
insertNode: s,
|
|
19
|
+
interpolateToCurve: i,
|
|
20
|
+
labelHelper: o,
|
|
21
|
+
log: t,
|
|
22
|
+
positionEdgeLabel: d
|
|
23
|
+
}, m = [
|
|
24
|
+
"elk.stress",
|
|
25
|
+
"elk.force",
|
|
26
|
+
"elk.mrtree",
|
|
27
|
+
"elk.sporeOverlap",
|
|
28
|
+
"elk.box",
|
|
29
|
+
"elk.rectpacking"
|
|
30
|
+
], h = /* @__PURE__ */ Object.create(null), g = /* @__PURE__ */ e((e) => {
|
|
31
|
+
for (let t of e) h[t.name] = t;
|
|
32
|
+
}, "registerLayoutLoaders"), _ = /* @__PURE__ */ e(() => {
|
|
33
|
+
let t = /* @__PURE__ */ e(async () => await import("./elk-276RUBZZ-B9WeHolc.js"), "loader");
|
|
34
|
+
return [{
|
|
35
|
+
name: "elk",
|
|
36
|
+
loader: t,
|
|
37
|
+
algorithm: "elk.layered"
|
|
38
|
+
}, ...m.map((e) => ({
|
|
39
|
+
name: e,
|
|
40
|
+
loader: t,
|
|
41
|
+
algorithm: e
|
|
42
|
+
}))];
|
|
43
|
+
}, "elkLayoutLoaders");
|
|
44
|
+
(/* @__PURE__ */ e(() => {
|
|
45
|
+
g([
|
|
46
|
+
{
|
|
47
|
+
name: "dagre",
|
|
48
|
+
loader: /* @__PURE__ */ e(async () => await import("./dagre-6A5THRUB-EHXNn6Wq.js"), "loader")
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "swimlane",
|
|
52
|
+
loader: /* @__PURE__ */ e(async () => await import("./swimlanes-2SLR337P-D7Ff0hLr.js"), "loader")
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "cose-bilkent",
|
|
56
|
+
loader: /* @__PURE__ */ e(async () => await import("./cose-bilkent-JH36ORCC-DStMi-eo.js"), "loader")
|
|
57
|
+
},
|
|
58
|
+
..._()
|
|
59
|
+
]);
|
|
60
|
+
}, "registerDefaultLayoutLoaders"))();
|
|
61
|
+
var v = /* @__PURE__ */ e(async (e, t) => {
|
|
62
|
+
if (!Object.hasOwn(h, e.layoutAlgorithm)) throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);
|
|
63
|
+
if (e.diagramId) for (let t of e.nodes) {
|
|
64
|
+
let n = t.domId || t.id;
|
|
65
|
+
t.domId = `${e.diagramId}-${n}`;
|
|
66
|
+
}
|
|
67
|
+
let n = h[e.layoutAlgorithm], r = await n.loader();
|
|
68
|
+
return a(t, e.config), r.render(e, t, p, { algorithm: n.algorithm });
|
|
69
|
+
}, "render"), y = "dagre", b = /* @__PURE__ */ e((e = "", { fallback: n = y } = {}) => {
|
|
70
|
+
if (Object.hasOwn(h, e)) return e;
|
|
71
|
+
for (let r of [n, y]) if (Object.hasOwn(h, r)) return t.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`), r;
|
|
72
|
+
throw Error(`Neither layout algorithm ${e}, ${n}, nor ${y} is registered.`);
|
|
73
|
+
}, "getRegisteredLayoutAlgorithm");
|
|
74
|
+
//#endregion
|
|
75
|
+
export { g as n, v as r, b as t };
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { n as e } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
2
|
+
import { m as t } from "./src-CNRY2AUH.js";
|
|
3
|
+
import { D as n, a as r, b as i, c as a, x as o, z as s } from "./chunk-O7XYJQB3-WMQqqzRb.js";
|
|
4
|
+
import { t as c } from "./chunk-6AEJRKK7-D9IaQdwq.js";
|
|
5
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-GTNCS2PH.mjs
|
|
6
|
+
var l = "", u = "", d = "", f = [], p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ e((e) => s(e, o()), "sanitizeText"), h = /* @__PURE__ */ e((e) => {
|
|
7
|
+
switch (e.type) {
|
|
8
|
+
case "terminal": return {
|
|
9
|
+
...e,
|
|
10
|
+
value: m(e.value)
|
|
11
|
+
};
|
|
12
|
+
case "nonterminal": return {
|
|
13
|
+
...e,
|
|
14
|
+
name: m(e.name)
|
|
15
|
+
};
|
|
16
|
+
case "sequence": return {
|
|
17
|
+
...e,
|
|
18
|
+
elements: e.elements.map(h)
|
|
19
|
+
};
|
|
20
|
+
case "choice": return {
|
|
21
|
+
...e,
|
|
22
|
+
alternatives: e.alternatives.map(h)
|
|
23
|
+
};
|
|
24
|
+
case "optional": return {
|
|
25
|
+
...e,
|
|
26
|
+
element: h(e.element)
|
|
27
|
+
};
|
|
28
|
+
case "repetition": return {
|
|
29
|
+
...e,
|
|
30
|
+
element: h(e.element),
|
|
31
|
+
separator: e.separator ? h(e.separator) : void 0
|
|
32
|
+
};
|
|
33
|
+
case "special": return {
|
|
34
|
+
...e,
|
|
35
|
+
text: m(e.text)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}, "sanitizeAstNode"), g = /* @__PURE__ */ e(() => {
|
|
39
|
+
l = "", u = "", d = "", f.length = 0, p.clear(), r(), t.debug("[Railroad] Database cleared");
|
|
40
|
+
}, "clear"), _ = /* @__PURE__ */ e((e) => {
|
|
41
|
+
l = m(e), t.debug("[Railroad] Title set:", e);
|
|
42
|
+
}, "setTitle"), v = /* @__PURE__ */ e(() => l, "getTitle"), y = {
|
|
43
|
+
clear: g,
|
|
44
|
+
setTitle: _,
|
|
45
|
+
getTitle: v,
|
|
46
|
+
addRule: /* @__PURE__ */ e((e) => {
|
|
47
|
+
let n = {
|
|
48
|
+
...e,
|
|
49
|
+
name: m(e.name),
|
|
50
|
+
definition: h(e.definition),
|
|
51
|
+
comment: e.comment ? m(e.comment) : void 0
|
|
52
|
+
};
|
|
53
|
+
t.debug("[Railroad] Adding rule:", n.name), p.has(n.name) && t.warn(`[Railroad] Rule '${n.name}' is already defined. Overwriting.`), f.push(n), p.set(n.name, n);
|
|
54
|
+
}, "addRule"),
|
|
55
|
+
getRules: /* @__PURE__ */ e(() => f, "getRules"),
|
|
56
|
+
getRule: /* @__PURE__ */ e((e) => p.get(e), "getRule"),
|
|
57
|
+
setAccTitle: /* @__PURE__ */ e((e) => {
|
|
58
|
+
u = m(e).replace(/^\s+/g, ""), t.debug("[Railroad] Accessibility title set:", e);
|
|
59
|
+
}, "setAccTitle"),
|
|
60
|
+
getAccTitle: /* @__PURE__ */ e(() => u, "getAccTitle"),
|
|
61
|
+
setAccDescription: /* @__PURE__ */ e((e) => {
|
|
62
|
+
d = m(e).replace(/\n\s+/g, "\n"), t.debug("[Railroad] Accessibility description set:", e);
|
|
63
|
+
}, "setAccDescription"),
|
|
64
|
+
getAccDescription: /* @__PURE__ */ e(() => d, "getAccDescription"),
|
|
65
|
+
setDiagramTitle: _,
|
|
66
|
+
getDiagramTitle: v
|
|
67
|
+
}, b = {
|
|
68
|
+
compactMode: !1,
|
|
69
|
+
padding: 10,
|
|
70
|
+
verticalSeparation: 8,
|
|
71
|
+
horizontalSeparation: 10,
|
|
72
|
+
arcRadius: 10,
|
|
73
|
+
fontSize: 14,
|
|
74
|
+
fontFamily: "monospace",
|
|
75
|
+
terminalFill: "#FFFFC0",
|
|
76
|
+
terminalStroke: "#000000",
|
|
77
|
+
terminalTextColor: "#000000",
|
|
78
|
+
nonTerminalFill: "#FFFFFF",
|
|
79
|
+
nonTerminalStroke: "#000000",
|
|
80
|
+
nonTerminalTextColor: "#000000",
|
|
81
|
+
lineColor: "#000000",
|
|
82
|
+
strokeWidth: 2,
|
|
83
|
+
markerFill: "#000000",
|
|
84
|
+
commentFill: "#E8E8E8",
|
|
85
|
+
commentStroke: "#888888",
|
|
86
|
+
commentTextColor: "#666666",
|
|
87
|
+
specialFill: "#F0E0FF",
|
|
88
|
+
specialStroke: "#8800CC",
|
|
89
|
+
ruleNameColor: "#000066",
|
|
90
|
+
showMarkers: !0,
|
|
91
|
+
markerRadius: 5
|
|
92
|
+
}, x = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i, S = /^[\w "',.-]+$/, C = /* @__PURE__ */ new Set([
|
|
93
|
+
"compactMode",
|
|
94
|
+
"padding",
|
|
95
|
+
"verticalSeparation",
|
|
96
|
+
"horizontalSeparation",
|
|
97
|
+
"arcRadius",
|
|
98
|
+
"fontSize",
|
|
99
|
+
"fontFamily",
|
|
100
|
+
"terminalFill",
|
|
101
|
+
"terminalStroke",
|
|
102
|
+
"terminalTextColor",
|
|
103
|
+
"nonTerminalFill",
|
|
104
|
+
"nonTerminalStroke",
|
|
105
|
+
"nonTerminalTextColor",
|
|
106
|
+
"lineColor",
|
|
107
|
+
"strokeWidth",
|
|
108
|
+
"markerFill",
|
|
109
|
+
"commentFill",
|
|
110
|
+
"commentStroke",
|
|
111
|
+
"commentTextColor",
|
|
112
|
+
"specialFill",
|
|
113
|
+
"specialStroke",
|
|
114
|
+
"ruleNameColor",
|
|
115
|
+
"showMarkers",
|
|
116
|
+
"markerRadius"
|
|
117
|
+
]), w = /* @__PURE__ */ e((e) => e ? Object.keys(e).every((e) => e === "railroad" || C.has(e)) : !1, "isRailroadStyleOptions"), T = /* @__PURE__ */ e((e) => e ? "railroad" in e && e.railroad ? e.railroad : w(e) ? e : {} : {}, "extractRailroadOverrides"), E = /* @__PURE__ */ e((e) => {
|
|
118
|
+
if (!e || w(e)) return {};
|
|
119
|
+
let { railroad: t, svgId: n, theme: r, look: i, ...a } = e;
|
|
120
|
+
return a;
|
|
121
|
+
}, "extractThemeOverrides"), D = /* @__PURE__ */ e((e, t) => {
|
|
122
|
+
if (typeof e != "string") return t;
|
|
123
|
+
let n = e.trim();
|
|
124
|
+
return x.test(n) ? n : t;
|
|
125
|
+
}, "sanitizeColorValue"), O = /* @__PURE__ */ e((e, t) => {
|
|
126
|
+
if (typeof e != "string") return t;
|
|
127
|
+
let n = e.trim();
|
|
128
|
+
return S.test(n) ? n : t;
|
|
129
|
+
}, "sanitizeFontFamilyValue"), k = /* @__PURE__ */ e((e, t) => {
|
|
130
|
+
let n = typeof e == "number" ? e : typeof e == "string" ? Number.parseFloat(e) : NaN;
|
|
131
|
+
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
132
|
+
}, "sanitizeNumberValue"), A = /* @__PURE__ */ e((e) => {
|
|
133
|
+
let t = typeof e == "number" ? e : typeof e == "string" ? Number.parseFloat(e) : NaN;
|
|
134
|
+
return Number.isFinite(t) && t > 0 ? t : void 0;
|
|
135
|
+
}, "parseThemeFontSize"), j = /* @__PURE__ */ e((e) => {
|
|
136
|
+
let t = O(e.fontFamily, b.fontFamily), n = A(e.fontSize) ?? b.fontSize;
|
|
137
|
+
return {
|
|
138
|
+
...b,
|
|
139
|
+
fontFamily: t,
|
|
140
|
+
fontSize: n,
|
|
141
|
+
terminalFill: D(e.secondBkg ?? e.secondaryColor, b.terminalFill),
|
|
142
|
+
terminalStroke: D(e.secondaryBorderColor ?? e.lineColor, b.terminalStroke),
|
|
143
|
+
terminalTextColor: D(e.secondaryTextColor ?? e.textColor, b.terminalTextColor),
|
|
144
|
+
nonTerminalFill: D(e.mainBkg ?? e.background, b.nonTerminalFill),
|
|
145
|
+
nonTerminalStroke: D(e.primaryBorderColor ?? e.lineColor, b.nonTerminalStroke),
|
|
146
|
+
nonTerminalTextColor: D(e.primaryTextColor ?? e.textColor, b.nonTerminalTextColor),
|
|
147
|
+
lineColor: D(e.lineColor, b.lineColor),
|
|
148
|
+
markerFill: D(e.lineColor, b.markerFill),
|
|
149
|
+
commentFill: D(e.labelBackground ?? e.tertiaryColor, b.commentFill),
|
|
150
|
+
commentStroke: D(e.tertiaryBorderColor ?? e.lineColor, b.commentStroke),
|
|
151
|
+
commentTextColor: D(e.tertiaryTextColor ?? e.textColor, b.commentTextColor),
|
|
152
|
+
specialFill: D(e.tertiaryColor ?? e.secondaryColor, b.specialFill),
|
|
153
|
+
specialStroke: D(e.tertiaryBorderColor ?? e.secondaryBorderColor, b.specialStroke),
|
|
154
|
+
ruleNameColor: D(e.titleColor ?? e.textColor, b.ruleNameColor)
|
|
155
|
+
};
|
|
156
|
+
}, "buildThemeDefaults"), M = /* @__PURE__ */ e((e) => {
|
|
157
|
+
let t = i(), r = j({
|
|
158
|
+
...n(),
|
|
159
|
+
...t.themeVariables ?? {},
|
|
160
|
+
...E(e)
|
|
161
|
+
}), a = {
|
|
162
|
+
...t.railroad ?? {},
|
|
163
|
+
...T(e)
|
|
164
|
+
};
|
|
165
|
+
return {
|
|
166
|
+
compactMode: a.compactMode ?? r.compactMode,
|
|
167
|
+
padding: k(a.padding, r.padding),
|
|
168
|
+
verticalSeparation: k(a.verticalSeparation, r.verticalSeparation),
|
|
169
|
+
horizontalSeparation: k(a.horizontalSeparation, r.horizontalSeparation),
|
|
170
|
+
arcRadius: k(a.arcRadius, r.arcRadius),
|
|
171
|
+
fontSize: k(a.fontSize, r.fontSize),
|
|
172
|
+
fontFamily: O(a.fontFamily, r.fontFamily),
|
|
173
|
+
terminalFill: D(a.terminalFill, r.terminalFill),
|
|
174
|
+
terminalStroke: D(a.terminalStroke, r.terminalStroke),
|
|
175
|
+
terminalTextColor: D(a.terminalTextColor, r.terminalTextColor),
|
|
176
|
+
nonTerminalFill: D(a.nonTerminalFill, r.nonTerminalFill),
|
|
177
|
+
nonTerminalStroke: D(a.nonTerminalStroke, r.nonTerminalStroke),
|
|
178
|
+
nonTerminalTextColor: D(a.nonTerminalTextColor, r.nonTerminalTextColor),
|
|
179
|
+
lineColor: D(a.lineColor, r.lineColor),
|
|
180
|
+
strokeWidth: k(a.strokeWidth, r.strokeWidth),
|
|
181
|
+
markerFill: D(a.markerFill, r.markerFill),
|
|
182
|
+
commentFill: D(a.commentFill, r.commentFill),
|
|
183
|
+
commentStroke: D(a.commentStroke, r.commentStroke),
|
|
184
|
+
commentTextColor: D(a.commentTextColor, r.commentTextColor),
|
|
185
|
+
specialFill: D(a.specialFill, r.specialFill),
|
|
186
|
+
specialStroke: D(a.specialStroke, r.specialStroke),
|
|
187
|
+
ruleNameColor: D(a.ruleNameColor, r.ruleNameColor),
|
|
188
|
+
showMarkers: a.showMarkers ?? r.showMarkers,
|
|
189
|
+
markerRadius: k(a.markerRadius, r.markerRadius)
|
|
190
|
+
};
|
|
191
|
+
}, "buildRailroadStyleOptions"), N = /* @__PURE__ */ e((e) => {
|
|
192
|
+
let { fontFamily: t, fontSize: n, terminalFill: r, terminalStroke: i, terminalTextColor: a, nonTerminalFill: o, nonTerminalStroke: s, nonTerminalTextColor: c, lineColor: l, strokeWidth: u, markerFill: d, commentFill: f, commentStroke: p, commentTextColor: m, specialFill: h, specialStroke: g, ruleNameColor: _ } = M(e);
|
|
193
|
+
return `
|
|
194
|
+
.railroad-diagram {
|
|
195
|
+
font-family: ${t};
|
|
196
|
+
font-size: ${n}px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.railroad-terminal rect {
|
|
200
|
+
fill: ${r};
|
|
201
|
+
stroke: ${i};
|
|
202
|
+
stroke-width: ${u}px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.railroad-terminal text {
|
|
206
|
+
fill: ${a};
|
|
207
|
+
font-family: ${t};
|
|
208
|
+
font-size: ${n}px;
|
|
209
|
+
text-anchor: middle;
|
|
210
|
+
dominant-baseline: middle;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.railroad-nonterminal rect {
|
|
214
|
+
fill: ${o};
|
|
215
|
+
stroke: ${s};
|
|
216
|
+
stroke-width: ${u}px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.railroad-nonterminal text {
|
|
220
|
+
fill: ${c};
|
|
221
|
+
font-family: ${t};
|
|
222
|
+
font-size: ${n}px;
|
|
223
|
+
text-anchor: middle;
|
|
224
|
+
dominant-baseline: middle;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.railroad-line {
|
|
228
|
+
stroke: ${l};
|
|
229
|
+
stroke-width: ${u}px;
|
|
230
|
+
fill: none;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.railroad-start circle,
|
|
234
|
+
.railroad-end circle {
|
|
235
|
+
fill: ${d};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.railroad-comment ellipse {
|
|
239
|
+
fill: ${f};
|
|
240
|
+
stroke: ${p};
|
|
241
|
+
stroke-width: ${u}px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.railroad-comment text {
|
|
245
|
+
fill: ${m};
|
|
246
|
+
font-style: italic;
|
|
247
|
+
font-family: ${t};
|
|
248
|
+
font-size: ${n}px;
|
|
249
|
+
text-anchor: middle;
|
|
250
|
+
dominant-baseline: middle;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.railroad-special rect {
|
|
254
|
+
fill: ${h};
|
|
255
|
+
stroke: ${g};
|
|
256
|
+
stroke-width: ${u}px;
|
|
257
|
+
stroke-dasharray: 5,3;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.railroad-special text {
|
|
261
|
+
fill: ${c};
|
|
262
|
+
font-family: ${t};
|
|
263
|
+
font-size: ${n}px;
|
|
264
|
+
text-anchor: middle;
|
|
265
|
+
dominant-baseline: middle;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.railroad-rule-name {
|
|
269
|
+
font-weight: bold;
|
|
270
|
+
fill: ${_};
|
|
271
|
+
font-family: ${t};
|
|
272
|
+
font-size: ${n}px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.railroad-group {
|
|
276
|
+
/* Grouping container, no specific styles */
|
|
277
|
+
}
|
|
278
|
+
`;
|
|
279
|
+
}, "getStyles"), P = class {
|
|
280
|
+
constructor() {
|
|
281
|
+
this.d = "";
|
|
282
|
+
}
|
|
283
|
+
static {
|
|
284
|
+
e(this, "PathBuilder");
|
|
285
|
+
}
|
|
286
|
+
moveTo(e, t) {
|
|
287
|
+
return this.d += `M ${e} ${t} `, this;
|
|
288
|
+
}
|
|
289
|
+
lineTo(e, t) {
|
|
290
|
+
return this.d += `L ${e} ${t} `, this;
|
|
291
|
+
}
|
|
292
|
+
horizontalTo(e) {
|
|
293
|
+
return this.d += `H ${e} `, this;
|
|
294
|
+
}
|
|
295
|
+
verticalTo(e) {
|
|
296
|
+
return this.d += `V ${e} `, this;
|
|
297
|
+
}
|
|
298
|
+
arcTo(e, t, n, r, i, a, o) {
|
|
299
|
+
return this.d += `A ${e} ${t} ${n} ${+!!r} ${+!!i} ${a} ${o} `, this;
|
|
300
|
+
}
|
|
301
|
+
build() {
|
|
302
|
+
return this.d.trim();
|
|
303
|
+
}
|
|
304
|
+
}, F = class {
|
|
305
|
+
constructor(e, t = M()) {
|
|
306
|
+
this.textCache = /* @__PURE__ */ new Map(), this.svg = e, this.config = t;
|
|
307
|
+
}
|
|
308
|
+
static {
|
|
309
|
+
e(this, "RailroadRenderer");
|
|
310
|
+
}
|
|
311
|
+
measureText(e) {
|
|
312
|
+
if (this.textCache.has(e)) return this.textCache.get(e);
|
|
313
|
+
let t = this.svg.append("text").attr("font-family", this.config.fontFamily).attr("font-size", this.config.fontSize).text(e), n = t.node().getBBox(), r = {
|
|
314
|
+
width: n.width,
|
|
315
|
+
height: n.height
|
|
316
|
+
};
|
|
317
|
+
return t.remove(), this.textCache.set(e, r), r;
|
|
318
|
+
}
|
|
319
|
+
renderTerminal(e, t) {
|
|
320
|
+
let n = this.measureText(t), r = n.width + this.config.padding * 2, i = n.height + this.config.padding * 2, a = e.append("g").attr("class", "railroad-terminal");
|
|
321
|
+
return a.append("rect").attr("x", 0).attr("y", 0).attr("width", r).attr("height", i).attr("rx", 10).attr("ry", 10), a.append("text").attr("x", r / 2).attr("y", i / 2).text(t), {
|
|
322
|
+
element: a.node(),
|
|
323
|
+
dimensions: {
|
|
324
|
+
width: r,
|
|
325
|
+
height: i,
|
|
326
|
+
up: i / 2,
|
|
327
|
+
down: i / 2
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
renderNonTerminal(e, t) {
|
|
332
|
+
let n = this.measureText(t), r = n.width + this.config.padding * 2, i = n.height + this.config.padding * 2, a = e.append("g").attr("class", "railroad-nonterminal");
|
|
333
|
+
return a.append("rect").attr("x", 0).attr("y", 0).attr("width", r).attr("height", i), a.append("text").attr("x", r / 2).attr("y", i / 2).text(t), {
|
|
334
|
+
element: a.node(),
|
|
335
|
+
dimensions: {
|
|
336
|
+
width: r,
|
|
337
|
+
height: i,
|
|
338
|
+
up: i / 2,
|
|
339
|
+
down: i / 2
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
renderSequence(e, t) {
|
|
344
|
+
let n = t.map((t) => this.renderExpression(e, t)), r = 0, i = 0, a = 0;
|
|
345
|
+
for (let e of n) r += e.dimensions.width, i = Math.max(i, e.dimensions.up), a = Math.max(a, e.dimensions.down);
|
|
346
|
+
r += (n.length - 1) * this.config.horizontalSeparation;
|
|
347
|
+
let o = e.append("g").attr("class", "railroad-sequence"), s = 0;
|
|
348
|
+
for (let e = 0; e < n.length; e++) {
|
|
349
|
+
let t = n[e], r = i - t.dimensions.up;
|
|
350
|
+
if (o.node().appendChild(t.element).setAttribute("transform", `translate(${s}, ${r})`), e < n.length - 1) {
|
|
351
|
+
let e = s + t.dimensions.width, n = e + this.config.horizontalSeparation, r = i;
|
|
352
|
+
o.append("path").attr("class", "railroad-line").attr("d", new P().moveTo(e, r).lineTo(n, r).build());
|
|
353
|
+
}
|
|
354
|
+
s += t.dimensions.width + this.config.horizontalSeparation;
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
element: o.node(),
|
|
358
|
+
dimensions: {
|
|
359
|
+
width: r,
|
|
360
|
+
height: i + a,
|
|
361
|
+
up: i,
|
|
362
|
+
down: a
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
renderChoice(e, t) {
|
|
367
|
+
let n = t.map((t) => this.renderExpression(e, t)), r = 0, i = 0;
|
|
368
|
+
for (let e of n) r = Math.max(r, e.dimensions.width), i += e.dimensions.height;
|
|
369
|
+
i += (n.length - 1) * this.config.verticalSeparation;
|
|
370
|
+
let a = this.config.arcRadius, o = a * 4, s = r + o, c = e.append("g").attr("class", "railroad-choice"), l = 0, u = i / 2;
|
|
371
|
+
for (let e of n) {
|
|
372
|
+
let t = l, n = t + e.dimensions.up, i = a * 2 + (r - e.dimensions.width) / 2;
|
|
373
|
+
c.node().appendChild(e.element).setAttribute("transform", `translate(${i}, ${t})`);
|
|
374
|
+
let o = new P(), d = n > u;
|
|
375
|
+
n === u ? o.moveTo(0, u).lineTo(i, n) : o.moveTo(0, u).arcTo(a, a, 0, !1, d, a, u + (d ? a : -a)).lineTo(a, n - (d ? a : -a)).arcTo(a, a, 0, !1, !d, a * 2, n).lineTo(i, n), c.append("path").attr("class", "railroad-line").attr("d", o.build());
|
|
376
|
+
let f = new P(), p = i + e.dimensions.width, m = s - a * 2;
|
|
377
|
+
n === u ? f.moveTo(p, n).lineTo(s, u) : f.moveTo(p, n).lineTo(m, n).arcTo(a, a, 0, !1, !d, s - a, n + (d ? -a : a)).lineTo(s - a, u + (d ? a : -a)).arcTo(a, a, 0, !1, d, s, u), c.append("path").attr("class", "railroad-line").attr("d", f.build()), l += e.dimensions.height + this.config.verticalSeparation;
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
element: c.node(),
|
|
381
|
+
dimensions: {
|
|
382
|
+
width: s,
|
|
383
|
+
height: i,
|
|
384
|
+
up: u,
|
|
385
|
+
down: i - u
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
renderOptional(e, t) {
|
|
390
|
+
let n = this.renderExpression(e, t), r = this.config.arcRadius, i = r * 2, a = n.dimensions.width + r * 4, o = n.dimensions.height + i, s = e.append("g").attr("class", "railroad-optional"), c = r * 2, l = i;
|
|
391
|
+
s.node().appendChild(n.element).setAttribute("transform", `translate(${c}, ${l})`);
|
|
392
|
+
let u = l + n.dimensions.up, d = new P().moveTo(0, u).lineTo(r * 2, u);
|
|
393
|
+
s.append("path").attr("class", "railroad-line").attr("d", d.build());
|
|
394
|
+
let f = new P().moveTo(c + n.dimensions.width, u).lineTo(a, u);
|
|
395
|
+
s.append("path").attr("class", "railroad-line").attr("d", f.build());
|
|
396
|
+
let p = new P().moveTo(0, u).arcTo(r, r, 0, !1, !1, r, u - r).lineTo(r, r).arcTo(r, r, 0, !1, !0, r * 2, 0).lineTo(a - r * 2, 0).arcTo(r, r, 0, !1, !0, a - r, r).lineTo(a - r, u - r).arcTo(r, r, 0, !1, !1, a, u);
|
|
397
|
+
return s.append("path").attr("class", "railroad-line").attr("d", p.build()), {
|
|
398
|
+
element: s.node(),
|
|
399
|
+
dimensions: {
|
|
400
|
+
width: a,
|
|
401
|
+
height: o,
|
|
402
|
+
up: u,
|
|
403
|
+
down: o - u
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
renderRepetition(e, t, n) {
|
|
408
|
+
let r = this.renderExpression(e, t), i = this.config.arcRadius, a = i * 2, o = r.dimensions.width + i * 4, s = n === 0, c = r.dimensions.height + a + (s ? a : 0), l = e.append("g").attr("class", "railroad-repetition"), u = i * 2, d = s ? a : 0;
|
|
409
|
+
l.node().appendChild(r.element).setAttribute("transform", `translate(${u}, ${d})`);
|
|
410
|
+
let f = d + r.dimensions.up;
|
|
411
|
+
l.append("path").attr("class", "railroad-line").attr("d", new P().moveTo(0, f).lineTo(i * 2, f).build()), l.append("path").attr("class", "railroad-line").attr("d", new P().moveTo(u + r.dimensions.width, f).lineTo(o, f).build());
|
|
412
|
+
let p = d + r.dimensions.height + i, m = new P().moveTo(u + r.dimensions.width, f).arcTo(i, i, 0, !1, !0, u + r.dimensions.width + i, f + i).lineTo(u + r.dimensions.width + i, p).arcTo(i, i, 0, !1, !0, u + r.dimensions.width, p + i).lineTo(i * 2, p + i).arcTo(i, i, 0, !1, !0, i, p).lineTo(i, f + i).arcTo(i, i, 0, !1, !0, i * 2, f);
|
|
413
|
+
if (l.append("path").attr("class", "railroad-line").attr("d", m.build()), s) {
|
|
414
|
+
let e = new P().moveTo(0, f).arcTo(i, i, 0, !1, !1, i, f - i).lineTo(i, i).arcTo(i, i, 0, !1, !0, i * 2, 0).lineTo(o - i * 2, 0).arcTo(i, i, 0, !1, !0, o - i, i).lineTo(o - i, f - i).arcTo(i, i, 0, !1, !1, o, f);
|
|
415
|
+
l.append("path").attr("class", "railroad-line").attr("d", e.build());
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
element: l.node(),
|
|
419
|
+
dimensions: {
|
|
420
|
+
width: o,
|
|
421
|
+
height: c,
|
|
422
|
+
up: f,
|
|
423
|
+
down: c - f
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
renderSpecial(e, t) {
|
|
428
|
+
let n = this.measureText("? " + t + " ?"), r = n.width + this.config.padding * 2, i = n.height + this.config.padding * 2, a = e.append("g").attr("class", "railroad-special");
|
|
429
|
+
return a.append("rect").attr("x", 0).attr("y", 0).attr("width", r).attr("height", i), a.append("text").attr("x", r / 2).attr("y", i / 2).text("? " + t + " ?"), {
|
|
430
|
+
element: a.node(),
|
|
431
|
+
dimensions: {
|
|
432
|
+
width: r,
|
|
433
|
+
height: i,
|
|
434
|
+
up: i / 2,
|
|
435
|
+
down: i / 2
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
renderExpression(e, t) {
|
|
440
|
+
switch (t.type) {
|
|
441
|
+
case "terminal": return this.renderTerminal(e, t.value);
|
|
442
|
+
case "nonterminal": return this.renderNonTerminal(e, t.name);
|
|
443
|
+
case "sequence": return this.renderSequence(e, t.elements);
|
|
444
|
+
case "choice": return this.renderChoice(e, t.alternatives);
|
|
445
|
+
case "optional": return this.renderOptional(e, t.element);
|
|
446
|
+
case "repetition": return this.renderRepetition(e, t.element, t.min);
|
|
447
|
+
case "special": return this.renderSpecial(e, t.text);
|
|
448
|
+
default: throw Error(`Unknown node type: ${t.type}`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
renderRule(e, t) {
|
|
452
|
+
let n = this.svg.append("g").attr("class", "railroad-rule").attr("transform", `translate(0, ${t})`), r = e.name + " =", i = this.measureText(r).width + 20, a = i + 20, o = n.append("g"), s = this.renderExpression(o, e.definition), c = Math.max(20, s.dimensions.up), l = c - s.dimensions.up;
|
|
453
|
+
return o.attr("transform", `translate(${a}, ${l})`), n.append("g").attr("class", "railroad-rule-name-group").append("text").attr("class", "railroad-rule-name").attr("x", 0).attr("y", c).text(r), n.append("g").attr("class", "railroad-start").append("circle").attr("cx", i).attr("cy", c).attr("r", this.config.markerRadius), n.append("g").attr("class", "railroad-end").append("circle").attr("cx", a + s.dimensions.width + 10).attr("cy", c).attr("r", this.config.markerRadius), n.append("path").attr("class", "railroad-line").attr("d", new P().moveTo(i + this.config.markerRadius, c).lineTo(a, c).build()), n.append("path").attr("class", "railroad-line").attr("d", new P().moveTo(a + s.dimensions.width, c).lineTo(a + s.dimensions.width + 10 - this.config.markerRadius, c).build()), {
|
|
454
|
+
height: Math.max(40, l + s.dimensions.height + this.config.padding * 2),
|
|
455
|
+
width: a + s.dimensions.width + 10 + this.config.markerRadius
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
renderDiagram(e) {
|
|
459
|
+
let t = this.config.padding, n = 0;
|
|
460
|
+
for (let r of e) {
|
|
461
|
+
let e = this.renderRule(r, t);
|
|
462
|
+
t += e.height + this.config.verticalSeparation, n = Math.max(n, e.width);
|
|
463
|
+
}
|
|
464
|
+
return {
|
|
465
|
+
width: n + this.config.padding * 2,
|
|
466
|
+
height: t + this.config.padding
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
}, I = /* @__PURE__ */ e((e, t, n) => {
|
|
470
|
+
a(e, t.height, t.width, n), e.attr("viewBox", `0 0 ${t.width} ${t.height}`);
|
|
471
|
+
}, "configureRailroadSvgSize"), L = { draw: /* @__PURE__ */ e((e, n, r) => {
|
|
472
|
+
t.debug("[Railroad] Rendering diagram\n" + e);
|
|
473
|
+
try {
|
|
474
|
+
let e = c(n);
|
|
475
|
+
e.attr("class", "railroad-diagram");
|
|
476
|
+
let r = i().railroad?.useMaxWidth ?? !0, a = y.getRules();
|
|
477
|
+
if (t.debug(`[Railroad] Rendering ${a.length} rules`), a.length === 0) {
|
|
478
|
+
t.warn("[Railroad] No rules to render"), I(e, {
|
|
479
|
+
height: 100,
|
|
480
|
+
width: 200
|
|
481
|
+
}, r);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
I(e, new F(e, M()).renderDiagram(a), r), t.debug("[Railroad] Render complete");
|
|
485
|
+
} catch (e) {
|
|
486
|
+
throw t.error("[Railroad] Render error:", e), e;
|
|
487
|
+
}
|
|
488
|
+
}, "draw") };
|
|
489
|
+
//#endregion
|
|
490
|
+
export { N as n, L as r, y as t };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { n as e } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
2
|
+
import { p as t } from "./src-CNRY2AUH.js";
|
|
3
|
+
import { j as n } from "./chunk-O7XYJQB3-WMQqqzRb.js";
|
|
4
|
+
import { t as r } from "./dist-D9zvfe2i.js";
|
|
5
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-GWA4HPMP.mjs
|
|
6
|
+
var i = r(), a = /* @__PURE__ */ e((e, t) => {
|
|
7
|
+
let n = e.append("rect");
|
|
8
|
+
if (n.attr("x", t.x), n.attr("y", t.y), n.attr("fill", t.fill), n.attr("stroke", t.stroke), n.attr("width", t.width), n.attr("height", t.height), t.name && n.attr("name", t.name), t.rx && n.attr("rx", t.rx), t.ry && n.attr("ry", t.ry), t.attrs !== void 0) for (let e in t.attrs) n.attr(e, t.attrs[e]);
|
|
9
|
+
return t.class && n.attr("class", t.class), n;
|
|
10
|
+
}, "drawRect"), o = /* @__PURE__ */ e((e, t) => {
|
|
11
|
+
a(e, {
|
|
12
|
+
x: t.startx,
|
|
13
|
+
y: t.starty,
|
|
14
|
+
width: t.stopx - t.startx,
|
|
15
|
+
height: t.stopy - t.starty,
|
|
16
|
+
fill: t.fill,
|
|
17
|
+
stroke: t.stroke,
|
|
18
|
+
class: "rect"
|
|
19
|
+
}).lower();
|
|
20
|
+
}, "drawBackgroundRect"), s = /* @__PURE__ */ e((e, t) => {
|
|
21
|
+
let r = t.text.replace(n, " "), i = e.append("text");
|
|
22
|
+
i.attr("x", t.x), i.attr("y", t.y), i.attr("class", "legend"), i.style("text-anchor", t.anchor), t.class && i.attr("class", t.class);
|
|
23
|
+
let a = i.append("tspan");
|
|
24
|
+
return a.attr("x", t.x + t.textMargin * 2), a.text(r), i;
|
|
25
|
+
}, "drawText"), c = /* @__PURE__ */ e((e, t, n, r) => {
|
|
26
|
+
let a = e.append("image");
|
|
27
|
+
a.attr("x", t), a.attr("y", n);
|
|
28
|
+
let o = (0, i.sanitizeUrl)(r);
|
|
29
|
+
a.attr("xlink:href", o);
|
|
30
|
+
}, "drawImage"), l = /* @__PURE__ */ e((e, t, n, r) => {
|
|
31
|
+
let a = e.append("use");
|
|
32
|
+
a.attr("x", t), a.attr("y", n);
|
|
33
|
+
let o = (0, i.sanitizeUrl)(r);
|
|
34
|
+
a.attr("xlink:href", `#${o}`);
|
|
35
|
+
}, "drawEmbeddedImage"), u = /* @__PURE__ */ e(() => ({
|
|
36
|
+
x: 0,
|
|
37
|
+
y: 0,
|
|
38
|
+
width: 100,
|
|
39
|
+
height: 100,
|
|
40
|
+
fill: "#EDF2AE",
|
|
41
|
+
stroke: "#666",
|
|
42
|
+
anchor: "start",
|
|
43
|
+
rx: 0,
|
|
44
|
+
ry: 0
|
|
45
|
+
}), "getNoteRect"), d = /* @__PURE__ */ e(() => ({
|
|
46
|
+
x: 0,
|
|
47
|
+
y: 0,
|
|
48
|
+
width: 100,
|
|
49
|
+
height: 100,
|
|
50
|
+
"text-anchor": "start",
|
|
51
|
+
style: "#666",
|
|
52
|
+
textMargin: 0,
|
|
53
|
+
rx: 0,
|
|
54
|
+
ry: 0,
|
|
55
|
+
tspan: !0
|
|
56
|
+
}), "getTextObj"), f = /* @__PURE__ */ e(() => {
|
|
57
|
+
let e = t(".mermaidTooltip");
|
|
58
|
+
return e.empty() && (e = t("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0).style("position", "absolute").style("text-align", "center").style("max-width", "200px").style("padding", "2px").style("font-size", "12px").style("background", "#ffffde").style("border", "1px solid #333").style("border-radius", "2px").style("pointer-events", "none").style("z-index", "100")), e;
|
|
59
|
+
}, "createTooltip");
|
|
60
|
+
//#endregion
|
|
61
|
+
export { a, d as c, c as i, o as n, s as o, l as r, u as s, f as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { n as e } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
2
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-J5ZVWO5B.mjs
|
|
3
|
+
var t = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), n = 12, r = 64, i = /* @__PURE__ */ e((e) => Array.isArray(e) && e.length > 0, "hasPalette"), a = /* @__PURE__ */ e((e, n) => e != null && t.has(e) && i(n), "isColorTheme"), o = /^[\w-]+$/, s = /* @__PURE__ */ e((e) => {
|
|
4
|
+
let t = typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
5
|
+
return o.test(t) ? t : "classic";
|
|
6
|
+
}, "safeLook"), c = /* @__PURE__ */ e((e) => i(e) ? e.length : 0, "paletteSlotCount"), l = /* @__PURE__ */ e((e, t) => i(t) ? c(t) : typeof e == "number" && Number.isInteger(e) && e > 0 && e <= r ? e : n, "colorSlotCount"), u = /* @__PURE__ */ e((e, t, n, r) => {
|
|
7
|
+
if (t === void 0 || !a(n, r)) return;
|
|
8
|
+
let i = t % c(r);
|
|
9
|
+
e.attr("data-color-id", `color-${i}`);
|
|
10
|
+
}, "stampColorSlot");
|
|
11
|
+
//#endregion
|
|
12
|
+
export { c as a, a as i, l as n, s as o, i as r, u as s, t };
|
|
@@ -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 };
|