@markdy/mcp-server 1.4.4 → 1.4.6
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/index.js +36 -10
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1818,7 +1818,8 @@ function parse(source, opts = {}) {
|
|
|
1818
1818
|
theme: "paper",
|
|
1819
1819
|
explicitTheme: false,
|
|
1820
1820
|
direction: "LR",
|
|
1821
|
-
explicitDirection: false
|
|
1821
|
+
explicitDirection: false,
|
|
1822
|
+
layoutMode: "auto"
|
|
1822
1823
|
};
|
|
1823
1824
|
const styles = {};
|
|
1824
1825
|
const nodes = {};
|
|
@@ -1919,11 +1920,19 @@ function parse(source, opts = {}) {
|
|
|
1919
1920
|
meta.title = title;
|
|
1920
1921
|
remainder = str.rest;
|
|
1921
1922
|
}
|
|
1922
|
-
const inlineLayout = remainder.match(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT)\b/i);
|
|
1923
|
+
const inlineLayout = remainder.match(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT|auto)\b/i);
|
|
1923
1924
|
if (inlineLayout) {
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1925
|
+
const val = inlineLayout[1].toUpperCase();
|
|
1926
|
+
if (val === "AUTO") {
|
|
1927
|
+
meta.direction = "LR";
|
|
1928
|
+
meta.explicitDirection = false;
|
|
1929
|
+
meta.layoutMode = "auto";
|
|
1930
|
+
} else {
|
|
1931
|
+
meta.direction = val;
|
|
1932
|
+
meta.explicitDirection = true;
|
|
1933
|
+
meta.layoutMode = "explicit";
|
|
1934
|
+
}
|
|
1935
|
+
remainder = remainder.replace(/\b(?:layout|direction|rankdir)\s+(LR|RL|TB|BT|auto)\b/i, " ");
|
|
1927
1936
|
}
|
|
1928
1937
|
const props = parseProps(remainder);
|
|
1929
1938
|
for (const [k, v] of Object.entries(props)) {
|
|
@@ -1945,8 +1954,16 @@ function parse(source, opts = {}) {
|
|
|
1945
1954
|
meta.theme = val;
|
|
1946
1955
|
meta.explicitTheme = val !== "auto";
|
|
1947
1956
|
} else if (k === "direction" || k === "layout" || k === "rankdir") {
|
|
1948
|
-
|
|
1949
|
-
|
|
1957
|
+
const val = String(v).toUpperCase();
|
|
1958
|
+
if (val === "AUTO") {
|
|
1959
|
+
meta.direction = "LR";
|
|
1960
|
+
meta.explicitDirection = false;
|
|
1961
|
+
meta.layoutMode = "auto";
|
|
1962
|
+
} else {
|
|
1963
|
+
meta.direction = val;
|
|
1964
|
+
meta.explicitDirection = true;
|
|
1965
|
+
meta.layoutMode = "explicit";
|
|
1966
|
+
}
|
|
1950
1967
|
} else if (PLAYER_FLAT_KEY_SET.has(k)) {
|
|
1951
1968
|
const error = applyPlayerSetting(meta.player ??= {}, "player", k, String(v));
|
|
1952
1969
|
if (error) diagnostics.push({ severity: "warning", message: error, line: lineNo });
|
|
@@ -1983,9 +2000,17 @@ function parse(source, opts = {}) {
|
|
|
1983
2000
|
i++;
|
|
1984
2001
|
continue;
|
|
1985
2002
|
}
|
|
1986
|
-
if (/^layout\s+(LR|RL|TB|BT)\b/i.test(line)) {
|
|
1987
|
-
|
|
1988
|
-
|
|
2003
|
+
if (/^layout\s+(LR|RL|TB|BT|auto)\b/i.test(line)) {
|
|
2004
|
+
const val = line.split(/\s+/)[1].toUpperCase();
|
|
2005
|
+
if (val === "AUTO") {
|
|
2006
|
+
meta.direction = "LR";
|
|
2007
|
+
meta.explicitDirection = false;
|
|
2008
|
+
meta.layoutMode = "auto";
|
|
2009
|
+
} else {
|
|
2010
|
+
meta.direction = val;
|
|
2011
|
+
meta.explicitDirection = true;
|
|
2012
|
+
meta.layoutMode = "explicit";
|
|
2013
|
+
}
|
|
1989
2014
|
i++;
|
|
1990
2015
|
continue;
|
|
1991
2016
|
}
|
|
@@ -3694,6 +3719,7 @@ function getIntelliCodeCompletions(docText, cursorLine, cursorCol) {
|
|
|
3694
3719
|
}
|
|
3695
3720
|
if (/(layout\s+|direction\s*=\s*)\w*$/i.test(ctx.linePrefix)) {
|
|
3696
3721
|
items.push(
|
|
3722
|
+
{ label: "auto", insertText: "auto", kind: "layout", detail: "Responsive Auto (LR / TB)", documentation: "Automatically adapts layout orientation between horizontal (LR) and vertical (TB) based on container width.", boost: 11 },
|
|
3697
3723
|
{ label: "LR", insertText: "LR", kind: "layout", detail: "Left-to-Right", documentation: "Horizontal left-to-right system flow layout.", boost: 10 },
|
|
3698
3724
|
{ label: "TB", insertText: "TB", kind: "layout", detail: "Top-to-Bottom", documentation: "Vertical top-to-bottom hierarchy layout.", boost: 9 },
|
|
3699
3725
|
{ label: "RL", insertText: "RL", kind: "layout", detail: "Right-to-Left", documentation: "Right-to-left reverse topology layout.", boost: 5 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/mcp-server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "Model Context Protocol server for Markdy diagram validation, transpilation, and generation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
42
|
-
"@markdy/
|
|
43
|
-
"@markdy/
|
|
42
|
+
"@markdy/core": "1.4.6",
|
|
43
|
+
"@markdy/compat": "1.4.6"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^25.9.5",
|