worsoft-frontend-codegen-local-mcp 0.1.68 → 0.1.69

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.
Files changed (2) hide show
  1. package/mcp_server.js +1 -40
  2. package/package.json +1 -1
package/mcp_server.js CHANGED
@@ -5,7 +5,7 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
 
7
7
  const SERVER_NAME = 'worsoft-codegen-local';
8
- const SERVER_VERSION = '0.1.68';
8
+ const SERVER_VERSION = '0.1.69';
9
9
  const PROTOCOL_VERSION = '2024-11-05';
10
10
  const TOOL_NAME = 'worsoft_codegen_local_generate_frontend';
11
11
  const STYLE_CATALOG_PATH = path.join(__dirname, 'assets', 'style-catalog.json');
@@ -2108,45 +2108,6 @@ function includesAnyLabel(label, values) {
2108
2108
  }
2109
2109
 
2110
2110
  function getDefaultOptionFieldWidthV2(field) {
2111
- const label = normalizeWidthLabel(field);
2112
- const visibleLength = getLabelVisibleLength(label);
2113
-
2114
- if (field.formType === 'textarea') return '300';
2115
-
2116
- if (matchesAnyLabel(label, ['\u72b6\u6001', '\u5355\u636e\u72b6\u6001'])) return '80';
2117
- if (label === '\u9879\u76ee\u7f16\u53f7') return '80';
2118
- if (label === '\u7edf\u4e00\u793e\u4f1a\u4fe1\u7528\u4ee3\u7801') return '160';
2119
- if (matchesAnyLabel(label, ['\u56fd\u5bb6'])) return '100';
2120
- if (matchesAnyLabel(label, ['\u7701\u4efd', '\u57ce\u5e02'])) return '120';
2121
- if (matchesAnyLabel(label, ['\u89c4\u6a21'])) return '100';
2122
- if (matchesAnyLabel(label, ['\u9879\u76ee\u7b80\u79f0', '\u8d44\u8d28\u4f7f\u7528'])) return '200';
2123
- if (matchesAnyLabel(label, ['\u4e3b\u8ddf\u8e2a\u4eba', '\u8ddf\u8e2a\u5355\u4f4d', '\u7ec4\u7ec7\u673a\u6784\u5168\u8def\u5f84'])) return '200';
2124
- if (matchesAnyLabel(label, ['\u4e1a\u4e3b\u7b80\u79f0', '\u4f9b\u5e94\u5546\u7b80\u79f0', '\u7269\u8d44\u540d\u79f0', '\u4f5c\u4e1a\u540d\u79f0'])) return '150';
2125
- if (matchesAnyLabel(label, ['\u89c4\u683c\u578b\u53f7', '\u8ba1\u91cf\u5355\u4f4d'])) return '80';
2126
- if (matchesAnyLabel(label, ['\u4e1a\u4e3b\u5355\u4f4d', '\u76d1\u7406\u5355\u4f4d', '\u8bbe\u8ba1\u5355\u4f4d', '\u5206\u5305\u5355\u4f4d', '\u4f9b\u5e94\u5546\u540d\u79f0'])) return '250';
2127
- if (matchesAnyLabel(label, ['\u6750\u6599\u7279\u5f81'])) return '200';
2128
-
2129
- if (matchesAnyLabel(label, ['\u5408\u540c\u7f16\u53f7', '\u5355\u636e\u7f16\u53f7']) || (label !== '\u9879\u76ee\u7f16\u53f7' && label.endsWith('\u7f16\u7801'))) return '200';
2130
-
2131
- if (matchesAnyLabel(label, [
2132
- '\u9879\u76ee\u540d\u79f0',
2133
- '\u9879\u76ee\u540d\u79f0\u5408\u540c',
2134
- '\u9879\u76ee\u540d\u79f0\u4e2d\u6587',
2135
- '\u62db\u6807\u9879\u76ee\u540d\u79f0',
2136
- '\u5408\u540c\u540d\u79f0',
2137
- '\u5408\u540c\u540d\u79f0\u5408\u540c',
2138
- '\u5408\u540c\u540d\u79f0\u4e2d\u6587',
2139
- ])) return '350';
2140
-
2141
- if (includesAnyLabel(label, ['\u91d1\u989d'])) return '180';
2142
- if (includesAnyLabel(label, ['\u6570\u91cf', '\u5355\u4ef7', '\u6570\u989d'])) return '140';
2143
- if (label.endsWith('\u4eba')) return '90';
2144
- if (includesAnyLabel(label, ['\u7535\u8bdd'])) return '100';
2145
-
2146
- if (field.formType === 'datetime') return '150';
2147
- if (field.formType === 'date') return visibleLength > 7 ? '170' : '90';
2148
- if (field.formType === 'select') return visibleLength > 5 ? '200' : '100';
2149
-
2150
2111
  return '100';
2151
2112
  }
2152
2113
  function renderOptionFieldV2(field, labelKey, dictRegistryRefs, indent = ' ') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worsoft-frontend-codegen-local-mcp",
3
- "version": "0.1.68",
3
+ "version": "0.1.69",
4
4
  "description": "Worsoft frontend local-template code generation MCP server.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "worsoft <sw@worsoft.vip>",