@opentiny/tiny-vue-mcp 0.0.1-beta.1 → 0.0.1

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.d.ts CHANGED
@@ -8,13 +8,14 @@ export declare const createMcpTools: (instance: any, { server, business }: {
8
8
  server: McpServer;
9
9
  business: Business;
10
10
  }, componentMcpConfig: ComponentMcpConfig) => void;
11
- export declare const getTinyVueMcpConfig: ({ t, }: {
12
- t: ((path: string) => string) | null;
11
+ export declare const getTinyVueMcpConfig: ({ t }?: {
12
+ t?: ((path: string) => string) | null;
13
13
  }) => {
14
14
  name: string;
15
15
  version: string;
16
16
  components: {
17
17
  Grid: import('./src/utils/defineComponentTool').RealComponentTool;
18
18
  BaseSelect: import('./src/utils/defineComponentTool').RealComponentTool;
19
+ Button: import('./src/utils/defineComponentTool').RealComponentTool;
19
20
  };
20
21
  };
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { defineTool as n } from "./src/utils/defineTool.js";
2
- import { default as C } from "./src/lang/zh-CN.js";
3
- import { default as S } from "./src/lang/en.js";
1
+ import { defineTool as i } from "./src/utils/defineTool.js";
2
+ import { default as x } from "./src/lang/zh-CN.js";
3
+ import { default as T } from "./src/lang/en.js";
4
4
  import { getGridConfig as f } from "./src/grid/index.js";
5
5
  import { getBaseSelectConfig as m } from "./src/base-select/index.js";
6
- import { i18n as o } from "./src/utils/locale.js";
7
- const g = (e, { server: t, business: r }, i) => {
8
- n({ business: r, componentMcpConfig: i, instance: e, server: t });
9
- }, l = ({
10
- t: e
11
- }) => (o && (o.t = e), {
6
+ import { i18n as e } from "./src/utils/locale.js";
7
+ import { getButtonConfig as p } from "./src/button/index.js";
8
+ const l = (o, { server: t, business: r }, n) => {
9
+ i({ business: r, componentMcpConfig: n, instance: o, server: t });
10
+ }, d = ({ t: o } = {}) => (e && o && (e.t = o), {
12
11
  name: "tiny-vue-mcp",
13
12
  version: "0.0.1",
14
13
  components: {
15
14
  Grid: f(),
16
- BaseSelect: m()
15
+ BaseSelect: m(),
16
+ Button: p()
17
17
  }
18
18
  });
19
19
  export {
20
- g as createMcpTools,
21
- S as enUS,
22
- l as getTinyVueMcpConfig,
23
- o as i18n,
24
- C as zhCN
20
+ l as createMcpTools,
21
+ T as enUS,
22
+ d as getTinyVueMcpConfig,
23
+ e as i18n,
24
+ x as zhCN
25
25
  };
@@ -1,16 +1,37 @@
1
- import { z as s } from "zod";
2
- import { defineComponentTool as n } from "../utils/defineComponentTool.js";
3
- import { t as e } from "../utils/locale.js";
4
- const a = () => n({
1
+ import { z as c } from "zod";
2
+ import { defineComponentTool as l } from "../utils/defineComponentTool.js";
3
+ import { t as s } from "../utils/locale.js";
4
+ const b = () => l({
5
5
  name: "base_select_component_tools",
6
- description: e("ai.baseSelect.description"),
6
+ description: s("ai.baseSelect.description"),
7
7
  tools: {
8
8
  openMenu: {
9
- paramsSchema: s.boolean().describe(e("ai.baseSelect.openMenu")),
10
- cb: (o, t) => (o.state.visible = t, { type: "text", text: "success" })
9
+ paramsSchema: c.boolean().describe(s("ai.baseSelect.openMenu")),
10
+ cb: (e, t) => (e.state.visible = t, { type: "text", text: "success" })
11
+ },
12
+ selectByLabel: {
13
+ paramsSchema: c.string().describe(s("ai.baseSelect.selectByLabel")),
14
+ cb: (e, t) => {
15
+ const a = (e.state.cachedOptions || []).find((o) => o.label === t);
16
+ return a ? (e.updateModelValue(a.value), { type: "text", text: "success" }) : { type: "text", text: `Option with label "${t}" not found.` };
17
+ }
18
+ },
19
+ clearValue: {
20
+ paramsSchema: c.string().describe(s("ai.baseSelect.clearValue")),
21
+ cb: (e, t) => (e.updateModelValue(""), { type: "text", text: "success" })
22
+ },
23
+ getOptions: {
24
+ paramsSchema: c.string().describe(s("ai.baseSelect.getOptions")),
25
+ cb: (e, t) => {
26
+ const a = (e.state.cachedOptions || []).map((o) => ({
27
+ label: o.label,
28
+ value: o.value
29
+ }));
30
+ return { type: "text", text: JSON.stringify(a) };
31
+ }
11
32
  }
12
33
  }
13
34
  });
14
35
  export {
15
- a as getBaseSelectConfig
36
+ b as getBaseSelectConfig
16
37
  };
@@ -0,0 +1,5 @@
1
+ export declare const resources: {
2
+ zh: any;
3
+ en: any;
4
+ };
5
+ export declare const getButtonConfig: () => import('../utils/defineComponentTool').RealComponentTool;
@@ -0,0 +1,16 @@
1
+ import { z as i } from "zod";
2
+ import { defineComponentTool as n } from "../utils/defineComponentTool.js";
3
+ import { t } from "../utils/locale.js";
4
+ const p = () => n({
5
+ name: "button_component_tools",
6
+ description: t("ai.button.description"),
7
+ tools: {
8
+ triggerClick: {
9
+ paramsSchema: i.boolean().describe(t("ai.button.triggerClick")),
10
+ cb: (o, e) => (o.handleClick(e), { type: "text", text: "success" })
11
+ }
12
+ }
13
+ });
14
+ export {
15
+ p as getButtonConfig
16
+ };
@@ -1,39 +1,61 @@
1
- import { z as r } from "zod";
1
+ import { z as o } from "zod";
2
2
  import { defineComponentTool as s } from "../utils/defineComponentTool.js";
3
- import { t as a } from "../utils/locale.js";
4
- const p = () => s({
3
+ import { t as r } from "../utils/locale.js";
4
+ const b = () => s({
5
5
  name: "grid_component_tools",
6
- description: a("ai.grid.description"),
6
+ description: r("ai.grid.description"),
7
7
  tools: {
8
- scollToRow: {
9
- paramsSchema: r.number().optional().describe(a("ai.grid.scrollToRow")),
8
+ scrollToRow: {
9
+ paramsSchema: o.number().optional().describe(r("ai.grid.scrollToRow")),
10
10
  cb: (t, e) => {
11
- const o = t.getData()[e];
12
- if (o)
13
- return t.scrollToRow(o), { type: "text", text: "success" };
11
+ const a = t.getTableData().tableData[e];
12
+ if (a)
13
+ return t.scrollToRow(a), { type: "text", text: "success" };
14
14
  }
15
15
  },
16
16
  getTableData: {
17
- paramsSchema: r.boolean().optional().describe(a("ai.grid.getTableData")),
17
+ paramsSchema: o.boolean().optional().describe(r("ai.grid.getTableData")),
18
18
  cb: (t) => {
19
- const e = t.getData();
19
+ const e = t.getTableData().tableData;
20
20
  return { type: "text", text: JSON.stringify(e) };
21
21
  }
22
22
  },
23
23
  setSelection: {
24
- paramsSchema: r.number().optional().describe(a("ai.grid.setSelection")),
24
+ paramsSchema: o.number().optional().describe(r("ai.grid.setSelection")),
25
25
  cb: (t, e) => {
26
- const o = t.getData()[e];
27
- if (o)
28
- return t.setSelection(o, !0), { type: "text", text: "success" };
26
+ const a = t.getTableData().tableData[e];
27
+ if (a)
28
+ return t.setSelection(a, !0), { type: "text", text: "success" };
29
29
  }
30
30
  },
31
31
  setAllSelection: {
32
- paramsSchema: r.boolean().optional().describe(a("ai.grid.setAllSelection")),
32
+ paramsSchema: o.boolean().optional().describe(r("ai.grid.setAllSelection")),
33
33
  cb: (t, e) => (t.setAllSelection(e), { type: "text", text: "success" })
34
+ },
35
+ insertRow: {
36
+ paramsSchema: o.record(o.any()).optional().describe(r("ai.grid.insertRow")),
37
+ cb: (t, e) => (t.insert(e), { type: "text", text: "success" })
38
+ },
39
+ updateRow: {
40
+ paramsSchema: o.record(o.any()).optional().describe(r("ai.grid.updateRow")),
41
+ cb: (t, e) => {
42
+ if (e && typeof e.tiny_mcp_index == "number") {
43
+ const a = t.getTableData().tableData[e.tiny_mcp_index];
44
+ if (a)
45
+ return Object.assign(a, e), { type: "text", text: "success" };
46
+ }
47
+ return { type: "text", text: "failed" };
48
+ }
49
+ },
50
+ removeRow: {
51
+ paramsSchema: o.number().optional().describe(r("ai.grid.removeRow")),
52
+ cb: (t, e) => {
53
+ const a = t.getTableData().tableData[e];
54
+ return a ? (t.remove(a), { type: "text", text: "success" }) : { type: "text", text: "failed" };
55
+ }
34
56
  }
35
57
  }
36
58
  });
37
59
  export {
38
- p as getGridConfig
60
+ b as getGridConfig
39
61
  };
@@ -6,10 +6,20 @@ declare const _default: {
6
6
  getTableData: string;
7
7
  setSelection: string;
8
8
  setAllSelection: string;
9
+ insertRow: string;
10
+ updateRow: string;
11
+ removeRow: string;
9
12
  };
10
13
  baseSelect: {
11
14
  description: string;
12
15
  openMenu: string;
16
+ selectByLabel: string;
17
+ clearValue: string;
18
+ getOptions: string;
19
+ };
20
+ button: {
21
+ description: string;
22
+ triggerClick: string;
13
23
  };
14
24
  };
15
25
  };
@@ -5,11 +5,21 @@ const e = {
5
5
  scrollToRow: "Scroll to the specified row,need to get the table data first,then scroll to the row according to the index of the data in the table data",
6
6
  getTableData: "Get the table data",
7
7
  setSelection: "Select the specified row,need to get the table data first,then select the data according to the index of the data in the table data,requirement:scroll to the selected row before selecting",
8
- setAllSelection: "Set the table all selection status,true:all selection,false:cancel all selection,requirement:scroll to the selected row before selecting"
8
+ setAllSelection: "Set the table all selection status,true:all selection,false:cancel all selection,requirement:scroll to the selected row before selecting",
9
+ insertRow: "Insert or add a row of data,need to get the table data first,then add the corresponding data according to the format of the table data",
10
+ updateRow: 'Update the specified row data in the table,need to get the table data first,then update the corresponding data according to the index of the data in the table data,requirement:the index of the data in the table data is passed in as the "tiny_mcp_index" field',
11
+ removeRow: "Remove the specified row in the table,need to get the table data first,then remove the corresponding data according to the index of the data in the table data"
9
12
  },
10
13
  baseSelect: {
11
- description: "Base select component related tool set, including opening the drop-down panel",
12
- openMenu: "Open the drop-down panel"
14
+ description: "Base select component related tool set, including opening the drop-down panel,set selected value or clear selected value and get selected options",
15
+ openMenu: "Open the drop-down panel",
16
+ selectByLabel: "update select value by label",
17
+ clearValue: "clear select value,remove value",
18
+ getOptions: "get all options of the select component"
19
+ },
20
+ button: {
21
+ description: "Button component related tool set",
22
+ triggerClick: "trigger button click,click self"
13
23
  }
14
24
  }
15
25
  };
@@ -6,10 +6,20 @@ declare const _default: {
6
6
  getTableData: string;
7
7
  setSelection: string;
8
8
  setAllSelection: string;
9
+ insertRow: string;
10
+ updateRow: string;
11
+ removeRow: string;
9
12
  };
10
13
  baseSelect: {
11
14
  description: string;
12
15
  openMenu: string;
16
+ selectByLabel: string;
17
+ clearValue: string;
18
+ getOptions: string;
19
+ };
20
+ button: {
21
+ description: string;
22
+ triggerClick: string;
13
23
  };
14
24
  };
15
25
  };
@@ -2,14 +2,24 @@ const e = {
2
2
  ai: {
3
3
  grid: {
4
4
  description: "表格组件相关工具集合,包含滚动到指定行、表格全选等功能",
5
- scrollToRow: "滚动到指定行,要先获取表格数据,然后根据表格数据中的索引确定滚动行",
5
+ scrollToRow: "滚动到指定行,要先获取表格数据,然后根据表格数据中的数组下标索引确定滚动行",
6
6
  getTableData: "获取表格数据",
7
- setSelection: "选中表格一条数据,需要先获取表格数据,然后根据表格数据中的索引选中数据,要求:选中之前先滚动到选中行",
8
- setAllSelection: "用来设置表格全选状态,true:全选,false:取消全选"
7
+ setSelection: "选中或者选择表格一条数据,需要先获取表格数据,然后根据表格数据中的数组下标索引选中或者选择数据,要求:选中之前先滚动到选中行",
8
+ setAllSelection: "用来设置表格全选状态,true:全选,false:取消全选",
9
+ insertRow: "插入或者新增一行数据,需要先获取表格数据,根据表格数据的格式新增对应的数据",
10
+ updateRow: '更新修改表格中指定行数据,需要先获取表格数据,根据表格数据中的数组下标索引更新对应的数据,要求:将更新数据的数组下标以"tiny_mcp_index"字段传入',
11
+ removeRow: "删除表格中指定行,需要先获取表格数据,根据表格数据中的数组下标索引删除对应的数据"
9
12
  },
10
13
  baseSelect: {
11
- description: "下拉组件相关工具集合,包含获取下拉数据、选中下拉数据等功能",
12
- openMenu: "打开下拉面板"
14
+ description: "下拉组件相关工具集合,包含获取下拉数据、选中下拉数据,清除选中值等功能",
15
+ openMenu: "打开下拉面板",
16
+ selectByLabel: "根据标签选中下拉数据",
17
+ clearValue: "清除下拉值",
18
+ getOptions: "查询下拉选择的所有选项值"
19
+ },
20
+ button: {
21
+ description: "按钮组件相关工具集合",
22
+ triggerClick: "按钮点击,点击按钮"
13
23
  }
14
24
  }
15
25
  };
package/index.ts CHANGED
@@ -1,37 +1,35 @@
1
- import { defineTool } from "./src/utils/defineTool";
2
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
- import type { Business, ComponentMcpConfig } from "./src/utils/defineTool";
4
- import zhCN from "./src/lang/zh-CN";
5
- import enUS from "./src/lang/en";
6
- import { getGridConfig } from "./src/grid";
7
- import { getBaseSelectConfig } from "./src/base-select";
8
- import { i18n } from "./src/utils/locale";
1
+ import { defineTool } from './src/utils/defineTool'
2
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
3
+ import type { Business, ComponentMcpConfig } from './src/utils/defineTool'
4
+ import zhCN from './src/lang/zh-CN'
5
+ import enUS from './src/lang/en'
6
+ import { getGridConfig } from './src/grid'
7
+ import { getBaseSelectConfig } from './src/base-select'
8
+ import { i18n } from './src/utils/locale'
9
+ import { getButtonConfig } from './src/button'
9
10
 
10
- export { zhCN, enUS, i18n };
11
+ export { zhCN, enUS, i18n }
11
12
 
12
13
  export const createMcpTools = (
13
14
  instance: any,
14
15
  { server, business }: { server: McpServer; business: Business },
15
16
  componentMcpConfig: ComponentMcpConfig
16
17
  ) => {
17
- defineTool({ business, componentMcpConfig, instance, server });
18
- };
18
+ defineTool({ business, componentMcpConfig, instance, server })
19
+ }
19
20
 
20
- export const getTinyVueMcpConfig = ({
21
- t,
22
- }: {
23
- t: ((path: string) => string) | null;
24
- }) => {
25
- if (i18n) {
26
- i18n.t = t;
21
+ export const getTinyVueMcpConfig = ({ t }: { t?: ((path: string) => string) | null } = {}) => {
22
+ if (i18n && t) {
23
+ i18n.t = t
27
24
  }
28
25
 
29
26
  return {
30
- name: "tiny-vue-mcp",
31
- version: "0.0.1",
27
+ name: 'tiny-vue-mcp',
28
+ version: '0.0.1',
32
29
  components: {
33
30
  Grid: getGridConfig(),
34
31
  BaseSelect: getBaseSelectConfig(),
35
- },
36
- };
37
- };
32
+ Button: getButtonConfig()
33
+ }
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-vue-mcp",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -20,6 +20,40 @@ export const getBaseSelectConfig = () =>
20
20
  instance.state.visible = value
21
21
  return { type: 'text', text: 'success' }
22
22
  }
23
+ },
24
+ selectByLabel: {
25
+ paramsSchema: z.string().describe(t('ai.baseSelect.selectByLabel')),
26
+
27
+ cb: (instance, value) => {
28
+ const options = instance.state.cachedOptions || []
29
+ const targetOption = options.find((option) => option.label === value)
30
+ if (targetOption) {
31
+ instance.updateModelValue(targetOption.value)
32
+ return { type: 'text', text: 'success' }
33
+ } else {
34
+ return { type: 'text', text: `Option with label "${value}" not found.` }
35
+ }
36
+ }
37
+ },
38
+ clearValue: {
39
+ paramsSchema: z.string().describe(t('ai.baseSelect.clearValue')),
40
+
41
+ cb: (instance, value) => {
42
+ instance.updateModelValue('')
43
+ return { type: 'text', text: 'success' }
44
+ }
45
+ },
46
+ getOptions: {
47
+ paramsSchema: z.string().describe(t('ai.baseSelect.getOptions')),
48
+
49
+ cb: (instance, value) => {
50
+ const options = instance.state.cachedOptions || []
51
+ const cleanOptions = options.map((option) => ({
52
+ label: option.label,
53
+ value: option.value
54
+ }))
55
+ return { type: 'text', text: JSON.stringify(cleanOptions) }
56
+ }
23
57
  }
24
58
  }
25
59
  })
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod'
2
+ import { defineComponentTool } from '../utils/defineComponentTool'
3
+ import resourcesZh from './resouces.zh.md?raw'
4
+ import resourcesEn from './resouces.en.md?raw'
5
+ import { t } from '../utils/locale'
6
+
7
+ export const resources = {
8
+ zh: resourcesZh,
9
+ en: resourcesEn
10
+ }
11
+
12
+ export const getButtonConfig = () =>
13
+ defineComponentTool({
14
+ name: 'button_component_tools',
15
+ description: t('ai.button.description'),
16
+ tools: {
17
+ triggerClick: {
18
+ paramsSchema: z.boolean().describe(t('ai.button.triggerClick')),
19
+ cb: (instance, value) => {
20
+ instance.handleClick(value)
21
+ return { type: 'text', text: 'success' }
22
+ }
23
+ }
24
+ }
25
+ })
@@ -0,0 +1,3 @@
1
+ # Button
2
+
3
+ Button component
@@ -0,0 +1,3 @@
1
+ # Button 按钮组件
2
+
3
+ Button 是标准的按钮组件。
package/src/grid/index.ts CHANGED
@@ -1,60 +1,88 @@
1
- import { z } from "zod";
2
- import { defineComponentTool } from "../utils/defineComponentTool";
3
- import resourcesZh from "./resouces.zh.md?raw";
4
- import resourcesEn from "./resouces.en.md?raw";
5
- import { t } from "../utils/locale";
1
+ import { z } from 'zod'
2
+ import { defineComponentTool } from '../utils/defineComponentTool'
3
+ import resourcesZh from './resouces.zh.md?raw'
4
+ import resourcesEn from './resouces.en.md?raw'
5
+ import { t } from '../utils/locale'
6
6
 
7
7
  export const resources = {
8
8
  zh: resourcesZh,
9
- en: resourcesEn,
10
- };
9
+ en: resourcesEn
10
+ }
11
11
 
12
12
  export const getGridConfig = () =>
13
13
  defineComponentTool({
14
- name: "grid_component_tools",
15
- description: t("ai.grid.description"),
14
+ name: 'grid_component_tools',
15
+ description: t('ai.grid.description'),
16
16
  tools: {
17
- scollToRow: {
18
- paramsSchema: z.number().optional().describe(t("ai.grid.scrollToRow")),
17
+ scrollToRow: {
18
+ paramsSchema: z.number().optional().describe(t('ai.grid.scrollToRow')),
19
19
  cb: (instance, value) => {
20
- const tableData = instance.getData();
21
- const targetRow = tableData[value];
20
+ const tableData = instance.getTableData().tableData
21
+ const targetRow = tableData[value]
22
22
  if (targetRow) {
23
- instance.scrollToRow(targetRow);
24
- return { type: "text", text: "success" };
23
+ instance.scrollToRow(targetRow)
24
+ return { type: 'text', text: 'success' }
25
25
  }
26
- },
26
+ }
27
27
  },
28
28
  getTableData: {
29
- paramsSchema: z
30
- .boolean()
31
- .optional()
32
- .describe(t("ai.grid.getTableData")),
29
+ paramsSchema: z.boolean().optional().describe(t('ai.grid.getTableData')),
33
30
  cb: (instance) => {
34
- const tableData = instance.getData();
35
- return { type: "text", text: JSON.stringify(tableData) };
36
- },
31
+ const tableData = instance.getTableData().tableData
32
+
33
+ return { type: 'text', text: JSON.stringify(tableData) }
34
+ }
37
35
  },
38
36
  setSelection: {
39
- paramsSchema: z.number().optional().describe(t("ai.grid.setSelection")),
37
+ paramsSchema: z.number().optional().describe(t('ai.grid.setSelection')),
40
38
  cb: (instance, value) => {
41
- const tableData = instance.getData();
42
- const targetRow = tableData[value];
39
+ const tableData = instance.getTableData().tableData
40
+ const targetRow = tableData[value]
43
41
  if (targetRow) {
44
- instance.setSelection(targetRow, true);
45
- return { type: "text", text: "success" };
42
+ instance.setSelection(targetRow, true)
43
+ return { type: 'text', text: 'success' }
46
44
  }
47
- },
45
+ }
48
46
  },
49
47
  setAllSelection: {
50
- paramsSchema: z
51
- .boolean()
52
- .optional()
53
- .describe(t("ai.grid.setAllSelection")),
48
+ paramsSchema: z.boolean().optional().describe(t('ai.grid.setAllSelection')),
49
+ cb: (instance, value) => {
50
+ instance.setAllSelection(value)
51
+ return { type: 'text', text: 'success' }
52
+ }
53
+ },
54
+ insertRow: {
55
+ paramsSchema: z.record(z.any()).optional().describe(t('ai.grid.insertRow')),
54
56
  cb: (instance, value) => {
55
- instance.setAllSelection(value);
56
- return { type: "text", text: "success" };
57
- },
57
+ instance.insert(value)
58
+ return { type: 'text', text: 'success' }
59
+ }
58
60
  },
59
- },
60
- });
61
+ updateRow: {
62
+ paramsSchema: z.record(z.any()).optional().describe(t('ai.grid.updateRow')),
63
+ cb: (instance, value) => {
64
+ if (value && typeof value.tiny_mcp_index === 'number') {
65
+ const tableData = instance.getTableData().tableData
66
+ const targetRow = tableData[value.tiny_mcp_index]
67
+ if (targetRow) {
68
+ Object.assign(targetRow, value)
69
+ return { type: 'text', text: 'success' }
70
+ }
71
+ }
72
+ return { type: 'text', text: 'failed' }
73
+ }
74
+ },
75
+ removeRow: {
76
+ paramsSchema: z.number().optional().describe(t('ai.grid.removeRow')),
77
+ cb: (instance, value) => {
78
+ const tableData = instance.getTableData().tableData
79
+ const targetRow = tableData[value]
80
+ if (targetRow) {
81
+ instance.remove(targetRow)
82
+ return { type: 'text', text: 'success' }
83
+ }
84
+ return { type: 'text', text: 'failed' }
85
+ }
86
+ }
87
+ }
88
+ })
package/src/lang/en.ts CHANGED
@@ -9,11 +9,25 @@ export default {
9
9
  setSelection:
10
10
  'Select the specified row,need to get the table data first,then select the data according to the index of the data in the table data,requirement:scroll to the selected row before selecting',
11
11
  setAllSelection:
12
- 'Set the table all selection status,true:all selection,false:cancel all selection,requirement:scroll to the selected row before selecting'
12
+ 'Set the table all selection status,true:all selection,false:cancel all selection,requirement:scroll to the selected row before selecting',
13
+ insertRow:
14
+ 'Insert or add a row of data,need to get the table data first,then add the corresponding data according to the format of the table data',
15
+ updateRow:
16
+ 'Update the specified row data in the table,need to get the table data first,then update the corresponding data according to the index of the data in the table data,requirement:the index of the data in the table data is passed in as the "tiny_mcp_index" field',
17
+ removeRow:
18
+ 'Remove the specified row in the table,need to get the table data first,then remove the corresponding data according to the index of the data in the table data'
13
19
  },
14
20
  baseSelect: {
15
- description: 'Base select component related tool set, including opening the drop-down panel',
16
- openMenu: 'Open the drop-down panel'
21
+ description:
22
+ 'Base select component related tool set, including opening the drop-down panel,set selected value or clear selected value and get selected options',
23
+ openMenu: 'Open the drop-down panel',
24
+ selectByLabel: 'update select value by label',
25
+ clearValue: 'clear select value,remove value',
26
+ getOptions: 'get all options of the select component'
27
+ },
28
+ button: {
29
+ description: 'Button component related tool set',
30
+ triggerClick: 'trigger button click,click self'
17
31
  }
18
32
  }
19
33
  }
package/src/lang/zh-CN.ts CHANGED
@@ -2,15 +2,26 @@ export default {
2
2
  ai: {
3
3
  grid: {
4
4
  description: '表格组件相关工具集合,包含滚动到指定行、表格全选等功能',
5
- scrollToRow: '滚动到指定行,要先获取表格数据,然后根据表格数据中的索引确定滚动行',
5
+ scrollToRow: '滚动到指定行,要先获取表格数据,然后根据表格数据中的数组下标索引确定滚动行',
6
6
  getTableData: '获取表格数据',
7
7
  setSelection:
8
- '选中表格一条数据,需要先获取表格数据,然后根据表格数据中的索引选中数据,要求:选中之前先滚动到选中行',
9
- setAllSelection: '用来设置表格全选状态,true:全选,false:取消全选'
8
+ '选中或者选择表格一条数据,需要先获取表格数据,然后根据表格数据中的数组下标索引选中或者选择数据,要求:选中之前先滚动到选中行',
9
+ setAllSelection: '用来设置表格全选状态,true:全选,false:取消全选',
10
+ insertRow: '插入或者新增一行数据,需要先获取表格数据,根据表格数据的格式新增对应的数据',
11
+ updateRow:
12
+ '更新修改表格中指定行数据,需要先获取表格数据,根据表格数据中的数组下标索引更新对应的数据,要求:将更新数据的数组下标以"tiny_mcp_index"字段传入',
13
+ removeRow: '删除表格中指定行,需要先获取表格数据,根据表格数据中的数组下标索引删除对应的数据'
10
14
  },
11
15
  baseSelect: {
12
- description: '下拉组件相关工具集合,包含获取下拉数据、选中下拉数据等功能',
13
- openMenu: '打开下拉面板'
16
+ description: '下拉组件相关工具集合,包含获取下拉数据、选中下拉数据,清除选中值等功能',
17
+ openMenu: '打开下拉面板',
18
+ selectByLabel: '根据标签选中下拉数据',
19
+ clearValue: '清除下拉值',
20
+ getOptions: '查询下拉选择的所有选项值'
21
+ },
22
+ button: {
23
+ description: '按钮组件相关工具集合',
24
+ triggerClick: '按钮点击,点击按钮'
14
25
  }
15
26
  }
16
27
  }
package/vite.config.ts CHANGED
@@ -1,29 +1,29 @@
1
- import { defineConfig } from "vite";
2
- import dts from "vite-plugin-dts";
1
+ import { defineConfig } from 'vite'
2
+ import dts from 'vite-plugin-dts'
3
3
 
4
4
  // https://vite.dev/config/
5
5
  export default defineConfig(() => {
6
6
  return {
7
7
  plugins: [
8
8
  // 生成类型声明文件
9
- dts(),
9
+ dts()
10
10
  ],
11
11
  // 库模式配置
12
12
  build: {
13
13
  lib: {
14
- entry: "./index.ts",
14
+ entry: './index.ts'
15
15
  },
16
16
  rollupOptions: {
17
- external: ["zod"],
18
- input: ["index.ts"],
17
+ external: ['zod'],
18
+ input: ['index.ts'],
19
19
  output: [
20
20
  {
21
- format: "es",
22
- entryFileNames: "[name].js",
23
- preserveModules: true,
24
- },
25
- ],
26
- },
27
- },
28
- };
29
- });
21
+ format: 'es',
22
+ entryFileNames: '[name].js',
23
+ preserveModules: true
24
+ }
25
+ ]
26
+ }
27
+ }
28
+ }
29
+ })