@webskill/sdk 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1171 -73
- package/dist/{approval-Bbh_Apwg.js → approval-DWQlDPbY.js} +527 -29
- package/dist/arc-8U_6NQWm.js +130 -0
- package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
- package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
- package/dist/array-DQfpQNY8.js +8 -0
- package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
- package/dist/browser.d.ts +1129 -48
- package/dist/browser.js +3562 -278
- package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
- package/dist/channel-CZxxLrG7.js +9 -0
- package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
- package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
- package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
- package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
- package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
- package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
- package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
- package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
- package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
- package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
- package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
- package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
- package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
- package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
- package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
- package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
- package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
- package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
- package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
- package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
- package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
- package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
- package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
- package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
- package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
- package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
- package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
- package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
- package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
- package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
- package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
- package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
- package/dist/defaultLocale-B_EoOkSF.js +249 -0
- package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
- package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
- package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
- package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
- package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
- package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
- package/dist/dist-UajCDt3n.js +92 -0
- package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
- package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
- package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
- package/dist/{eventTypes-CwciaqCU.js → eventTypes-DcTQXSV1.js} +7 -1
- package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
- package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
- package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
- package/dist/geometry-wx5ZTYzi.js +715 -0
- package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
- package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
- package/dist/governance.d.ts +9 -3
- package/dist/governance.js +1 -1
- package/dist/graphlib-tk9gQYuN.js +4194 -0
- package/dist/{index-ad11wflI.d.ts → index-BiO9_XRk.d.ts} +2 -2
- package/dist/{index-DQ3-6GFu.d.ts → index-CjwdZQOS.d.ts} +945 -8
- package/dist/{index-BDyXe-a5.d.ts → index-YPd8ZSEa.d.ts} +413 -7
- package/dist/index.d.ts +4 -4
- package/dist/index.js +47 -41
- package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
- package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
- package/dist/init-CMOIWdg-.js +16 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
- package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
- package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
- package/dist/katex-BcRRvyh_.js +26465 -0
- package/dist/kind-Dc8x0HWz.js +110 -0
- package/dist/line-LgV8iVMV.js +48 -0
- package/dist/linear-BWKR0Tqd.js +393 -0
- package/dist/linkedDocument-CIuh_Yp0.js +416 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
- package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
- package/dist/mermaid.core-DMtwGCHy.js +1756 -0
- package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
- package/dist/node.d.ts +8 -3
- package/dist/node.js +79 -4
- package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
- package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
- package/dist/ordinal-CxA6GHQS.js +84 -0
- package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
- package/dist/path-C27Z2Bjv.js +106 -0
- package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
- package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
- package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
- package/dist/processSandboxEntry.js +5 -0
- package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
- package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
- package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
- package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
- package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
- package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
- package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
- package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
- package/dist/rough.cjs-AmDd_NQk.js +1395 -0
- package/dist/sandboxWorkerEntry.js +5 -0
- package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
- package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
- package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
- package/dist/{skillVersionStore-B24Jjjry-v2CCU0Xo.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
- package/dist/src-NkhI3UMl.js +2653 -0
- package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
- package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
- package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
- package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
- package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
- package/dist/{types-Btpdd1y--BcxQ10Fa.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +111 -9
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +3718 -77
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/untrustedText-BIaRvPZK.js +16 -0
- package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
- package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
- package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
- package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
- package/dist/{webSkillApi-CsvA69qk.js → webSkillApi-Dy-Zjv0y.js} +1 -1
- package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
- package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
- package/package.json +6 -5
- package/dist/kind-DxgS8LM-.js +0 -77
- package/dist/linkedDocument-xNXF-z8n.js +0 -94
- package/dist/types-DOJI5YC3.js +0 -90
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { n as parse } from "./mermaid-parser.core-pYR5siSx.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
3
|
+
import { m as log } from "./src-NkhI3UMl.js";
|
|
4
|
+
import { D as getThemeVariables3, H as setAccDescription, U as setAccTitle, a as clear, b as getConfig, c as configureSvgSize, f as defaultConfig_default, q as setDiagramTitle, v as getAccDescription, w as getDiagramTitle, y as getAccTitle } from "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
5
|
+
import { i as cleanAndMerge } from "./chunk-ZIGJFQKS-DqEFBuHR.js";
|
|
6
|
+
import { t as selectSvgElement } from "./chunk-6AEJRKK7-JXK89I-O.js";
|
|
7
|
+
import { t as populateCommonDb } from "./chunk-JWPE2WC7-D1rC79GS.js";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MPIPVDR6.mjs
|
|
10
|
+
var defaultOptions = {
|
|
11
|
+
showLegend: true,
|
|
12
|
+
ticks: 5,
|
|
13
|
+
max: null,
|
|
14
|
+
min: 0,
|
|
15
|
+
graticule: "circle"
|
|
16
|
+
};
|
|
17
|
+
var MAX_TICKS = 32;
|
|
18
|
+
var defaultRadarData = {
|
|
19
|
+
axes: [],
|
|
20
|
+
curves: [],
|
|
21
|
+
options: defaultOptions
|
|
22
|
+
};
|
|
23
|
+
var data = structuredClone(defaultRadarData);
|
|
24
|
+
var DEFAULT_RADAR_CONFIG = defaultConfig_default.radar;
|
|
25
|
+
var getConfig2 = /* @__PURE__ */ __name(() => {
|
|
26
|
+
return cleanAndMerge({
|
|
27
|
+
...DEFAULT_RADAR_CONFIG,
|
|
28
|
+
...getConfig().radar
|
|
29
|
+
});
|
|
30
|
+
}, "getConfig");
|
|
31
|
+
var getAxes = /* @__PURE__ */ __name(() => data.axes, "getAxes");
|
|
32
|
+
var getCurves = /* @__PURE__ */ __name(() => data.curves, "getCurves");
|
|
33
|
+
var getOptions = /* @__PURE__ */ __name(() => data.options, "getOptions");
|
|
34
|
+
var setAxes = /* @__PURE__ */ __name((axes) => {
|
|
35
|
+
data.axes = axes.map((axis) => {
|
|
36
|
+
return {
|
|
37
|
+
name: axis.name,
|
|
38
|
+
label: axis.label ?? axis.name
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}, "setAxes");
|
|
42
|
+
var setCurves = /* @__PURE__ */ __name((curves) => {
|
|
43
|
+
data.curves = curves.map((curve) => {
|
|
44
|
+
return {
|
|
45
|
+
name: curve.name,
|
|
46
|
+
label: curve.label ?? curve.name,
|
|
47
|
+
entries: computeCurveEntries(curve.entries)
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}, "setCurves");
|
|
51
|
+
var computeCurveEntries = /* @__PURE__ */ __name((entries) => {
|
|
52
|
+
if (entries[0].axis == void 0) return entries.map((entry) => entry.value);
|
|
53
|
+
const axes = getAxes();
|
|
54
|
+
if (axes.length === 0) throw new Error("Axes must be populated before curves for reference entries");
|
|
55
|
+
return axes.map((axis) => {
|
|
56
|
+
const entry = entries.find((entry2) => entry2.axis?.$refText === axis.name);
|
|
57
|
+
if (entry === void 0) throw new Error("Missing entry for axis " + axis.label);
|
|
58
|
+
return entry.value;
|
|
59
|
+
});
|
|
60
|
+
}, "computeCurveEntries");
|
|
61
|
+
var db = {
|
|
62
|
+
getAxes,
|
|
63
|
+
getCurves,
|
|
64
|
+
getOptions,
|
|
65
|
+
setAxes,
|
|
66
|
+
setCurves,
|
|
67
|
+
setOptions: /* @__PURE__ */ __name((options) => {
|
|
68
|
+
const optionMap = options.reduce((acc, option) => {
|
|
69
|
+
acc[option.name] = option;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
data.options = {
|
|
73
|
+
showLegend: optionMap.showLegend?.value ?? defaultOptions.showLegend,
|
|
74
|
+
ticks: optionMap.ticks?.value ?? defaultOptions.ticks,
|
|
75
|
+
max: optionMap.max?.value ?? defaultOptions.max,
|
|
76
|
+
min: optionMap.min?.value ?? defaultOptions.min,
|
|
77
|
+
graticule: optionMap.graticule?.value ?? defaultOptions.graticule
|
|
78
|
+
};
|
|
79
|
+
if (data.options.ticks > MAX_TICKS) {
|
|
80
|
+
log.warn(`Radar diagram ticks (${data.options.ticks}) exceeds maximum allowed (${MAX_TICKS}). Using ${MAX_TICKS} instead.`);
|
|
81
|
+
data.options.ticks = MAX_TICKS;
|
|
82
|
+
}
|
|
83
|
+
}, "setOptions"),
|
|
84
|
+
getConfig: getConfig2,
|
|
85
|
+
clear: /* @__PURE__ */ __name(() => {
|
|
86
|
+
clear();
|
|
87
|
+
data = structuredClone(defaultRadarData);
|
|
88
|
+
}, "clear"),
|
|
89
|
+
setAccTitle,
|
|
90
|
+
getAccTitle,
|
|
91
|
+
setDiagramTitle,
|
|
92
|
+
getDiagramTitle,
|
|
93
|
+
getAccDescription,
|
|
94
|
+
setAccDescription
|
|
95
|
+
};
|
|
96
|
+
var populate = /* @__PURE__ */ __name((ast) => {
|
|
97
|
+
populateCommonDb(ast, db);
|
|
98
|
+
const { axes, curves, options } = ast;
|
|
99
|
+
db.setAxes(axes);
|
|
100
|
+
db.setCurves(curves);
|
|
101
|
+
db.setOptions(options);
|
|
102
|
+
}, "populate");
|
|
103
|
+
var parser = { parse: /* @__PURE__ */ __name(async (input) => {
|
|
104
|
+
const ast = await parse("radar", input);
|
|
105
|
+
log.debug(ast);
|
|
106
|
+
populate(ast);
|
|
107
|
+
}, "parse") };
|
|
108
|
+
var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
|
|
109
|
+
const db2 = diagram2.db;
|
|
110
|
+
const axes = db2.getAxes();
|
|
111
|
+
const curves = db2.getCurves();
|
|
112
|
+
const options = db2.getOptions();
|
|
113
|
+
const config = db2.getConfig();
|
|
114
|
+
const title = db2.getDiagramTitle();
|
|
115
|
+
const g = drawFrame(selectSvgElement(id), config);
|
|
116
|
+
const maxValue = options.max ?? Math.max(...curves.map((curve) => Math.max(...curve.entries)));
|
|
117
|
+
const minValue = options.min;
|
|
118
|
+
const radius = Math.min(config.width, config.height) / 2;
|
|
119
|
+
drawGraticule(g, axes, radius, options.ticks, options.graticule);
|
|
120
|
+
drawAxes(g, axes, radius, config);
|
|
121
|
+
drawCurves(g, axes, curves, minValue, maxValue, options.graticule, config);
|
|
122
|
+
drawLegend(g, curves, options.showLegend, config);
|
|
123
|
+
g.append("text").attr("class", "radarTitle").text(title).attr("x", 0).attr("y", -config.height / 2 - config.marginTop);
|
|
124
|
+
}, "draw");
|
|
125
|
+
var drawFrame = /* @__PURE__ */ __name((svg, config) => {
|
|
126
|
+
const totalWidth = config.width + config.marginLeft + config.marginRight;
|
|
127
|
+
const totalHeight = config.height + config.marginTop + config.marginBottom;
|
|
128
|
+
const center = {
|
|
129
|
+
x: config.marginLeft + config.width / 2,
|
|
130
|
+
y: config.marginTop + config.height / 2
|
|
131
|
+
};
|
|
132
|
+
configureSvgSize(svg, totalHeight, totalWidth, config.useMaxWidth ?? true);
|
|
133
|
+
svg.attr("viewBox", `0 0 ${totalWidth} ${totalHeight}`).attr("overflow", "visible");
|
|
134
|
+
return svg.append("g").attr("transform", `translate(${center.x}, ${center.y})`);
|
|
135
|
+
}, "drawFrame");
|
|
136
|
+
var drawGraticule = /* @__PURE__ */ __name((g, axes, radius, ticks, graticule) => {
|
|
137
|
+
if (graticule === "circle") for (let i = 0; i < ticks; i++) {
|
|
138
|
+
const r = radius * (i + 1) / ticks;
|
|
139
|
+
g.append("circle").attr("r", r).attr("class", "radarGraticule");
|
|
140
|
+
}
|
|
141
|
+
else if (graticule === "polygon") {
|
|
142
|
+
const numAxes = axes.length;
|
|
143
|
+
for (let i = 0; i < ticks; i++) {
|
|
144
|
+
const r = radius * (i + 1) / ticks;
|
|
145
|
+
const points = axes.map((_, j) => {
|
|
146
|
+
const angle = 2 * j * Math.PI / numAxes - Math.PI / 2;
|
|
147
|
+
return `${r * Math.cos(angle)},${r * Math.sin(angle)}`;
|
|
148
|
+
}).join(" ");
|
|
149
|
+
g.append("polygon").attr("points", points).attr("class", "radarGraticule");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, "drawGraticule");
|
|
153
|
+
var drawAxes = /* @__PURE__ */ __name((g, axes, radius, config) => {
|
|
154
|
+
const numAxes = axes.length;
|
|
155
|
+
for (let i = 0; i < numAxes; i++) {
|
|
156
|
+
const label = axes[i].label;
|
|
157
|
+
const angle = 2 * i * Math.PI / numAxes - Math.PI / 2;
|
|
158
|
+
const cosA = Math.cos(angle);
|
|
159
|
+
const sinA = Math.sin(angle);
|
|
160
|
+
g.append("line").attr("x1", 0).attr("y1", 0).attr("x2", radius * config.axisScaleFactor * cosA).attr("y2", radius * config.axisScaleFactor * sinA).attr("class", "radarAxisLine");
|
|
161
|
+
const textAnchor = cosA > .01 ? "start" : cosA < -.01 ? "end" : "middle";
|
|
162
|
+
const dominantBaseline = sinA > .01 ? "hanging" : sinA < -.01 ? "auto" : "central";
|
|
163
|
+
const labelPad = 4;
|
|
164
|
+
g.append("text").text(label).attr("x", radius * config.axisLabelFactor * cosA + labelPad * cosA).attr("y", radius * config.axisLabelFactor * sinA + labelPad * sinA).attr("text-anchor", textAnchor).attr("dominant-baseline", dominantBaseline).attr("class", "radarAxisLabel");
|
|
165
|
+
}
|
|
166
|
+
}, "drawAxes");
|
|
167
|
+
function drawCurves(g, axes, curves, minValue, maxValue, graticule, config) {
|
|
168
|
+
const numAxes = axes.length;
|
|
169
|
+
const radius = Math.min(config.width, config.height) / 2;
|
|
170
|
+
curves.forEach((curve, index) => {
|
|
171
|
+
if (curve.entries.length !== numAxes) return;
|
|
172
|
+
const points = curve.entries.map((entry, i) => {
|
|
173
|
+
const angle = 2 * Math.PI * i / numAxes - Math.PI / 2;
|
|
174
|
+
const r = relativeRadius(entry, minValue, maxValue, radius);
|
|
175
|
+
return {
|
|
176
|
+
x: r * Math.cos(angle),
|
|
177
|
+
y: r * Math.sin(angle)
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
if (graticule === "circle") g.append("path").attr("d", closedRoundCurve(points, config.curveTension)).attr("class", `radarCurve-${index}`);
|
|
181
|
+
else if (graticule === "polygon") g.append("polygon").attr("points", points.map((p) => `${p.x},${p.y}`).join(" ")).attr("class", `radarCurve-${index}`);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
__name(drawCurves, "drawCurves");
|
|
185
|
+
function relativeRadius(value, minValue, maxValue, radius) {
|
|
186
|
+
return radius * (Math.min(Math.max(value, minValue), maxValue) - minValue) / (maxValue - minValue);
|
|
187
|
+
}
|
|
188
|
+
__name(relativeRadius, "relativeRadius");
|
|
189
|
+
function closedRoundCurve(points, tension) {
|
|
190
|
+
const numPoints = points.length;
|
|
191
|
+
let d = `M${points[0].x},${points[0].y}`;
|
|
192
|
+
for (let i = 0; i < numPoints; i++) {
|
|
193
|
+
const p0 = points[(i - 1 + numPoints) % numPoints];
|
|
194
|
+
const p1 = points[i];
|
|
195
|
+
const p2 = points[(i + 1) % numPoints];
|
|
196
|
+
const p3 = points[(i + 2) % numPoints];
|
|
197
|
+
const cp1 = {
|
|
198
|
+
x: p1.x + (p2.x - p0.x) * tension,
|
|
199
|
+
y: p1.y + (p2.y - p0.y) * tension
|
|
200
|
+
};
|
|
201
|
+
const cp2 = {
|
|
202
|
+
x: p2.x - (p3.x - p1.x) * tension,
|
|
203
|
+
y: p2.y - (p3.y - p1.y) * tension
|
|
204
|
+
};
|
|
205
|
+
d += ` C${cp1.x},${cp1.y} ${cp2.x},${cp2.y} ${p2.x},${p2.y}`;
|
|
206
|
+
}
|
|
207
|
+
return `${d} Z`;
|
|
208
|
+
}
|
|
209
|
+
__name(closedRoundCurve, "closedRoundCurve");
|
|
210
|
+
function drawLegend(g, curves, showLegend, config) {
|
|
211
|
+
if (!showLegend) return;
|
|
212
|
+
const legendX = (config.width / 2 + config.marginRight) * 3 / 4;
|
|
213
|
+
const legendY = -(config.height / 2 + config.marginTop) * 3 / 4;
|
|
214
|
+
const lineHeight = 20;
|
|
215
|
+
curves.forEach((curve, index) => {
|
|
216
|
+
const itemGroup = g.append("g").attr("transform", `translate(${legendX}, ${legendY + index * lineHeight})`);
|
|
217
|
+
itemGroup.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${index}`);
|
|
218
|
+
itemGroup.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(curve.label);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
__name(drawLegend, "drawLegend");
|
|
222
|
+
var renderer = { draw };
|
|
223
|
+
var genIndexStyles = /* @__PURE__ */ __name((themeVariables, radarOptions) => {
|
|
224
|
+
let sections = "";
|
|
225
|
+
for (let i = 0; i < themeVariables.THEME_COLOR_LIMIT; i++) {
|
|
226
|
+
const indexColor = themeVariables[`cScale${i}`];
|
|
227
|
+
sections += `
|
|
228
|
+
.radarCurve-${i} {
|
|
229
|
+
color: ${indexColor};
|
|
230
|
+
fill: ${indexColor};
|
|
231
|
+
fill-opacity: ${radarOptions.curveOpacity};
|
|
232
|
+
stroke: ${indexColor};
|
|
233
|
+
stroke-width: ${radarOptions.curveStrokeWidth};
|
|
234
|
+
}
|
|
235
|
+
.radarLegendBox-${i} {
|
|
236
|
+
fill: ${indexColor};
|
|
237
|
+
fill-opacity: ${radarOptions.curveOpacity};
|
|
238
|
+
stroke: ${indexColor};
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
}
|
|
242
|
+
return sections;
|
|
243
|
+
}, "genIndexStyles");
|
|
244
|
+
var buildRadarStyleOptions = /* @__PURE__ */ __name((radar) => {
|
|
245
|
+
const themeVariables = cleanAndMerge(getThemeVariables3(), getConfig().themeVariables);
|
|
246
|
+
return {
|
|
247
|
+
themeVariables,
|
|
248
|
+
radarOptions: cleanAndMerge(themeVariables.radar, radar)
|
|
249
|
+
};
|
|
250
|
+
}, "buildRadarStyleOptions");
|
|
251
|
+
var diagram = {
|
|
252
|
+
parser,
|
|
253
|
+
db,
|
|
254
|
+
renderer,
|
|
255
|
+
styles: /* @__PURE__ */ __name(({ radar } = {}) => {
|
|
256
|
+
const { themeVariables, radarOptions } = buildRadarStyleOptions(radar);
|
|
257
|
+
return `
|
|
258
|
+
.radarTitle {
|
|
259
|
+
font-size: ${themeVariables.fontSize};
|
|
260
|
+
color: ${themeVariables.titleColor};
|
|
261
|
+
dominant-baseline: hanging;
|
|
262
|
+
text-anchor: middle;
|
|
263
|
+
}
|
|
264
|
+
.radarAxisLine {
|
|
265
|
+
stroke: ${radarOptions.axisColor};
|
|
266
|
+
stroke-width: ${radarOptions.axisStrokeWidth};
|
|
267
|
+
}
|
|
268
|
+
.radarAxisLabel {
|
|
269
|
+
font-size: ${radarOptions.axisLabelFontSize}px;
|
|
270
|
+
color: ${radarOptions.axisColor};
|
|
271
|
+
}
|
|
272
|
+
.radarGraticule {
|
|
273
|
+
fill: ${radarOptions.graticuleColor};
|
|
274
|
+
fill-opacity: ${radarOptions.graticuleOpacity};
|
|
275
|
+
stroke: ${radarOptions.graticuleColor};
|
|
276
|
+
stroke-width: ${radarOptions.graticuleStrokeWidth};
|
|
277
|
+
}
|
|
278
|
+
.radarLegendText {
|
|
279
|
+
text-anchor: start;
|
|
280
|
+
font-size: ${radarOptions.legendFontSize}px;
|
|
281
|
+
dominant-baseline: hanging;
|
|
282
|
+
}
|
|
283
|
+
${genIndexStyles(themeVariables, radarOptions)}
|
|
284
|
+
`;
|
|
285
|
+
}, "styles")
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
//#endregion
|
|
289
|
+
export { diagram };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "./rolldown-runtime-BHkdefai.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js
|
|
4
|
+
const abs = Math.abs;
|
|
5
|
+
const atan2 = Math.atan2;
|
|
6
|
+
const cos = Math.cos;
|
|
7
|
+
const max = Math.max;
|
|
8
|
+
const min = Math.min;
|
|
9
|
+
const sin = Math.sin;
|
|
10
|
+
const sqrt = Math.sqrt;
|
|
11
|
+
const epsilon = 1e-12;
|
|
12
|
+
const pi = Math.PI;
|
|
13
|
+
const halfPi = pi / 2;
|
|
14
|
+
const tau = 2 * pi;
|
|
15
|
+
function acos(x) {
|
|
16
|
+
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
17
|
+
}
|
|
18
|
+
function asin(x) {
|
|
19
|
+
return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.2/node_modules/@braintree/sanitize-url/dist/constants.js
|
|
24
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.BLANK_URL = exports.relativeFirstCharacters = exports.whitespaceEscapeCharsRegex = exports.urlSchemeRegex = exports.ctrlCharactersRegex = exports.htmlCtrlEntityRegex = exports.htmlEntitiesRegex = exports.invalidProtocolRegex = void 0;
|
|
27
|
+
exports.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im;
|
|
28
|
+
exports.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g;
|
|
29
|
+
exports.htmlCtrlEntityRegex = /&(newline|tab);/gi;
|
|
30
|
+
exports.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
|
|
31
|
+
exports.urlSchemeRegex = /^.+(:|:)/gim;
|
|
32
|
+
exports.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;
|
|
33
|
+
exports.relativeFirstCharacters = [".", "/"];
|
|
34
|
+
exports.BLANK_URL = "about:blank";
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.2/node_modules/@braintree/sanitize-url/dist/index.js
|
|
39
|
+
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.sanitizeUrl = sanitizeUrl;
|
|
42
|
+
var constants_1 = require_constants();
|
|
43
|
+
function isRelativeUrlWithoutProtocol(url) {
|
|
44
|
+
return constants_1.relativeFirstCharacters.indexOf(url[0]) > -1;
|
|
45
|
+
}
|
|
46
|
+
function decodeHtmlCharacters(str) {
|
|
47
|
+
return str.replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.htmlEntitiesRegex, function(match, dec) {
|
|
48
|
+
return String.fromCharCode(dec);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function isValidUrl(url) {
|
|
52
|
+
return URL.canParse(url);
|
|
53
|
+
}
|
|
54
|
+
function decodeURI(uri) {
|
|
55
|
+
try {
|
|
56
|
+
return decodeURIComponent(uri);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
return uri;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function sanitizeUrl(url) {
|
|
62
|
+
if (!url) return constants_1.BLANK_URL;
|
|
63
|
+
var charsToDecode;
|
|
64
|
+
var decodedUrl = decodeURI(url.trim());
|
|
65
|
+
do {
|
|
66
|
+
decodedUrl = decodeHtmlCharacters(decodedUrl).replace(constants_1.htmlCtrlEntityRegex, "").replace(constants_1.ctrlCharactersRegex, "").replace(constants_1.whitespaceEscapeCharsRegex, "").trim();
|
|
67
|
+
decodedUrl = decodeURI(decodedUrl);
|
|
68
|
+
charsToDecode = decodedUrl.match(constants_1.ctrlCharactersRegex) || decodedUrl.match(constants_1.htmlEntitiesRegex) || decodedUrl.match(constants_1.htmlCtrlEntityRegex) || decodedUrl.match(constants_1.whitespaceEscapeCharsRegex);
|
|
69
|
+
} while (charsToDecode && charsToDecode.length > 0);
|
|
70
|
+
var sanitizedUrl = decodedUrl;
|
|
71
|
+
if (!sanitizedUrl) return constants_1.BLANK_URL;
|
|
72
|
+
if (isRelativeUrlWithoutProtocol(sanitizedUrl)) return sanitizedUrl;
|
|
73
|
+
var trimmedUrl = sanitizedUrl.trimStart();
|
|
74
|
+
var urlSchemeParseResults = trimmedUrl.match(constants_1.urlSchemeRegex);
|
|
75
|
+
if (!urlSchemeParseResults) return sanitizedUrl;
|
|
76
|
+
var urlScheme = urlSchemeParseResults[0].toLowerCase().trim();
|
|
77
|
+
if (constants_1.invalidProtocolRegex.test(urlScheme)) return constants_1.BLANK_URL;
|
|
78
|
+
var backSanitized = trimmedUrl.replace(/\\/g, "/");
|
|
79
|
+
if (urlScheme === "mailto:" || urlScheme.includes("://")) return backSanitized;
|
|
80
|
+
if (urlScheme === "http:" || urlScheme === "https:") {
|
|
81
|
+
if (!isValidUrl(backSanitized)) return constants_1.BLANK_URL;
|
|
82
|
+
var url_1 = new URL(backSanitized);
|
|
83
|
+
url_1.protocol = url_1.protocol.toLowerCase();
|
|
84
|
+
url_1.hostname = url_1.hostname.toLowerCase();
|
|
85
|
+
return url_1.toString();
|
|
86
|
+
}
|
|
87
|
+
return backSanitized;
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
export { atan2 as a, halfPi as c, pi as d, sin as f, asin as i, max as l, tau as m, abs as n, cos as o, sqrt as p, acos as r, epsilon as s, require_dist as t, min as u };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { f as createRailroadEbnfServices, t as MermaidParseError } from "./mermaid-parser.core-pYR5siSx.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
3
|
+
import { m as log } from "./src-NkhI3UMl.js";
|
|
4
|
+
import "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
5
|
+
import "./chunk-6AEJRKK7-JXK89I-O.js";
|
|
6
|
+
import { n as getStyles, r as renderer, t as db } from "./chunk-GTNCS2PH-CLmh4I2c.js";
|
|
7
|
+
import { t as populateCommonDb } from "./chunk-JWPE2WC7-D1rC79GS.js";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-ZINNZB2B.mjs
|
|
10
|
+
var langiumParser = createRailroadEbnfServices().RailroadEbnf.parser.LangiumParser;
|
|
11
|
+
var transformChoice = /* @__PURE__ */ __name((choice) => {
|
|
12
|
+
const alternatives = choice.alternatives.map(transformSequence);
|
|
13
|
+
if (alternatives.length === 1) return alternatives[0];
|
|
14
|
+
return {
|
|
15
|
+
type: "choice",
|
|
16
|
+
alternatives
|
|
17
|
+
};
|
|
18
|
+
}, "transformChoice");
|
|
19
|
+
var transformSequence = /* @__PURE__ */ __name((sequence) => {
|
|
20
|
+
const elements = sequence.elements.map(transformTerm);
|
|
21
|
+
if (elements.length === 1) return elements[0];
|
|
22
|
+
return {
|
|
23
|
+
type: "sequence",
|
|
24
|
+
elements
|
|
25
|
+
};
|
|
26
|
+
}, "transformSequence");
|
|
27
|
+
var transformPrimary = /* @__PURE__ */ __name((primary) => {
|
|
28
|
+
switch (primary.$type) {
|
|
29
|
+
case "EbnfTerminal": return {
|
|
30
|
+
type: "terminal",
|
|
31
|
+
value: primary.value
|
|
32
|
+
};
|
|
33
|
+
case "EbnfNonTerminal": return {
|
|
34
|
+
type: "nonterminal",
|
|
35
|
+
name: primary.name
|
|
36
|
+
};
|
|
37
|
+
case "EbnfSpecial": return {
|
|
38
|
+
type: "special",
|
|
39
|
+
text: primary.text
|
|
40
|
+
};
|
|
41
|
+
case "EbnfGroup": return transformChoice(primary.element);
|
|
42
|
+
case "EbnfOptional": return {
|
|
43
|
+
type: "optional",
|
|
44
|
+
element: transformChoice(primary.element)
|
|
45
|
+
};
|
|
46
|
+
case "EbnfRepetition": return {
|
|
47
|
+
type: "repetition",
|
|
48
|
+
element: transformChoice(primary.element),
|
|
49
|
+
min: 0,
|
|
50
|
+
max: Infinity
|
|
51
|
+
};
|
|
52
|
+
default: throw new Error(`Unsupported EBNF primary node: ${primary.$type}`);
|
|
53
|
+
}
|
|
54
|
+
}, "transformPrimary");
|
|
55
|
+
var transformPostfix = /* @__PURE__ */ __name((node, postfix) => {
|
|
56
|
+
switch (postfix.$type) {
|
|
57
|
+
case "EbnfOptionalPostfix": return {
|
|
58
|
+
type: "optional",
|
|
59
|
+
element: node
|
|
60
|
+
};
|
|
61
|
+
case "EbnfZeroOrMorePostfix": return {
|
|
62
|
+
type: "repetition",
|
|
63
|
+
element: node,
|
|
64
|
+
min: 0,
|
|
65
|
+
max: Infinity
|
|
66
|
+
};
|
|
67
|
+
case "EbnfOneOrMorePostfix": return {
|
|
68
|
+
type: "repetition",
|
|
69
|
+
element: node,
|
|
70
|
+
min: 1,
|
|
71
|
+
max: Infinity
|
|
72
|
+
};
|
|
73
|
+
case "EbnfExceptionPostfix": return {
|
|
74
|
+
type: "sequence",
|
|
75
|
+
elements: [
|
|
76
|
+
node,
|
|
77
|
+
{
|
|
78
|
+
type: "terminal",
|
|
79
|
+
value: "-"
|
|
80
|
+
},
|
|
81
|
+
transformPrimary(postfix.except)
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
default: throw new Error(`Unsupported EBNF postfix node: ${postfix.$type}`);
|
|
85
|
+
}
|
|
86
|
+
}, "transformPostfix");
|
|
87
|
+
var transformTerm = /* @__PURE__ */ __name((term) => {
|
|
88
|
+
return term.postfixes.reduce((currentNode, postfix) => {
|
|
89
|
+
return transformPostfix(currentNode, postfix);
|
|
90
|
+
}, transformPrimary(term.base));
|
|
91
|
+
}, "transformTerm");
|
|
92
|
+
var transformRule = /* @__PURE__ */ __name((rule) => {
|
|
93
|
+
return {
|
|
94
|
+
name: rule.name,
|
|
95
|
+
definition: transformChoice(rule.definition)
|
|
96
|
+
};
|
|
97
|
+
}, "transformRule");
|
|
98
|
+
var populateDb = /* @__PURE__ */ __name((ast) => {
|
|
99
|
+
populateCommonDb(ast, db);
|
|
100
|
+
if (ast.title) db.setTitle(ast.title);
|
|
101
|
+
ast.rules.map((rule) => db.addRule(transformRule(rule)));
|
|
102
|
+
}, "populateDb");
|
|
103
|
+
var diagram = {
|
|
104
|
+
parser: {
|
|
105
|
+
parse: /* @__PURE__ */ __name((input) => {
|
|
106
|
+
db.clear();
|
|
107
|
+
log.debug("[EBNF Parser] Starting Langium parse");
|
|
108
|
+
const result = langiumParser.parse(input);
|
|
109
|
+
if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) throw new MermaidParseError(result);
|
|
110
|
+
const ast = result.value;
|
|
111
|
+
log.debug("[EBNF Parser] Parsed rules:", ast.rules.length);
|
|
112
|
+
populateDb(ast);
|
|
113
|
+
log.debug("[EBNF Parser] Parse complete");
|
|
114
|
+
}, "parse"),
|
|
115
|
+
parser: { yy: db }
|
|
116
|
+
},
|
|
117
|
+
db,
|
|
118
|
+
renderer,
|
|
119
|
+
styles: getStyles
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { diagram };
|