@coding-flow/flow-design 0.0.55 → 0.0.57

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.
@@ -4,8 +4,7 @@ const initialData = {
4
4
  id: 'start',
5
5
  type: 'START',
6
6
  data: {
7
- title: '开始节点',
8
- viewTitle: '开始节点'
7
+ title: '开始节点'
9
8
  }
10
9
  },
11
10
  {
@@ -15,23 +15,6 @@ const View = ()=>{
15
15
  },
16
16
  layout: "vertical",
17
17
  children: [
18
- /*#__PURE__*/ jsx(Form.Item, {
19
- label: /*#__PURE__*/ jsx(FieldTip, {
20
- label: "视图标题",
21
- description: "节点视图的展示标题,用于审批页面或自定义视图展示。"
22
- }),
23
- name: [
24
- "viewTitle"
25
- ],
26
- children: /*#__PURE__*/ jsx(Field, {
27
- name: "viewTitle",
28
- render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(Input, {
29
- value: value,
30
- onChange: onChange,
31
- placeholder: "请输入视图标题"
32
- })
33
- })
34
- }),
35
18
  /*#__PURE__*/ jsx(Form.Item, {
36
19
  label: /*#__PURE__*/ jsx(FieldTip, {
37
20
  label: "视图名称",
@@ -67,6 +50,23 @@ const View = ()=>{
67
50
  })
68
51
  })
69
52
  }),
53
+ /*#__PURE__*/ jsx(Form.Item, {
54
+ label: /*#__PURE__*/ jsx(FieldTip, {
55
+ label: "视图标题",
56
+ description: "节点视图的展示标题,用于审批页面或自定义视图展示。"
57
+ }),
58
+ name: [
59
+ "viewTitle"
60
+ ],
61
+ children: /*#__PURE__*/ jsx(Field, {
62
+ name: "viewTitle",
63
+ render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(Input, {
64
+ value: value,
65
+ onChange: onChange,
66
+ placeholder: "请输入视图标题"
67
+ })
68
+ })
69
+ }),
70
70
  /*#__PURE__*/ jsx(Field, {
71
71
  name: "code",
72
72
  render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(Fragment, {
@@ -4,6 +4,7 @@ import { useService } from "@flowgram.ai/fixed-layout-editor";
4
4
  import { FlowDownloadFormat, FlowDownloadService } from "@flowgram.ai/export-plugin";
5
5
  import { Button, Dropdown, Tooltip, message } from "antd";
6
6
  import { DownloadOutlined } from "@ant-design/icons";
7
+ import { FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
7
8
  const DownloadTool = ()=>{
8
9
  const [downloading, setDownloading] = useState(false);
9
10
  const [visible, setVisible] = useState(false);
@@ -28,7 +29,9 @@ const DownloadTool = ()=>{
28
29
  await downloadService.download({
29
30
  format
30
31
  });
31
- message.success(`Download ${format} successfully`);
32
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_DOWNLOAD_SUCCESS, {
33
+ format
34
+ }));
32
35
  };
33
36
  useEffect(()=>{
34
37
  const subscription = downloadService.onDownloadingChange((v)=>{
@@ -3,6 +3,7 @@ import react from "react";
3
3
  import { Badge, Input, Popconfirm, Space, Typography, message } from "antd";
4
4
  import dayjs from "dayjs";
5
5
  import { useDesignContext } from "../../../design-panel/hooks/use-design-context.js";
6
+ import { FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
6
7
  const { Text } = Typography;
7
8
  const VersionItem = (props)=>{
8
9
  const { version } = props;
@@ -31,7 +32,7 @@ const VersionItem = (props)=>{
31
32
  onClick: ()=>{
32
33
  props.onUpdateVersionName(version.id, title).then(()=>{
33
34
  setEditeVisible(false);
34
- message.success('保存成功');
35
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_VIEW_CODE_SAVE_SUCCESS));
35
36
  });
36
37
  },
37
38
  children: "确定"
@@ -90,7 +91,7 @@ const VersionItem = (props)=>{
90
91
  title: "确认要删除到该版本吗?",
91
92
  onConfirm: async ()=>{
92
93
  props.onVersionRemove(version.id).then(()=>{
93
- message.success("版本已删除");
94
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_VERSION_DELETED));
94
95
  });
95
96
  },
96
97
  children: /*#__PURE__*/ jsx("a", {
@@ -3,6 +3,7 @@ import { Form, Modal, message } from "antd";
3
3
  import "react";
4
4
  import { Upload } from "./upload.js";
5
5
  import { importWorkflow } from "../../api/workflow.js";
6
+ import { FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
6
7
  const DesignImport = (props)=>{
7
8
  const [form] = Form.useForm();
8
9
  return /*#__PURE__*/ jsx(Modal, {
@@ -19,7 +20,7 @@ const DesignImport = (props)=>{
19
20
  onFinish: (values)=>{
20
21
  importWorkflow(values).then((res)=>{
21
22
  if (res.success) {
22
- message.success("流程已导入成功");
23
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_IMPORT_SUCCESS));
23
24
  props.onClose();
24
25
  }
25
26
  });
@@ -4,7 +4,7 @@ import { Button, Form, Input, Popover, Space, Tabs, message } from "antd";
4
4
  import { LayoutHeaderHeight } from "../types.js";
5
5
  import { useDesignContext } from "../hooks/use-design-context.js";
6
6
  import { CloseOutlined, DownloadOutlined, SaveOutlined } from "@ant-design/icons";
7
- import { EventBus } from "@coding-flow/flow-core";
7
+ import { EventBus, FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
8
8
  import { exportWorkflow } from "../../../api/workflow.js";
9
9
  const Left = ()=>/*#__PURE__*/ jsx("div", {
10
10
  style: {
@@ -33,7 +33,7 @@ const SaveAsButton = ()=>{
33
33
  onFinish: (values)=>{
34
34
  context.save(values.name).then(()=>{
35
35
  setVisible(false);
36
- message.success('版本已保存');
36
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_VERSION_SAVED));
37
37
  EventBus.getInstance().emit('VersionChangeEvent');
38
38
  });
39
39
  },
@@ -97,7 +97,7 @@ const Right = ()=>{
97
97
  loading: state.view.loading,
98
98
  onClick: ()=>{
99
99
  context.save().then(()=>{
100
- message.success("流程已经保存.");
100
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_SAVE));
101
101
  });
102
102
  },
103
103
  children: "保存"
@@ -16,7 +16,7 @@ class NodeConvertorManager {
16
16
  script: node.script,
17
17
  code: node.code,
18
18
  view: node.view,
19
- viewTitle: node.viewTitle || node.name,
19
+ viewTitle: node.viewTitle,
20
20
  display: node.display,
21
21
  ...this.toStrategyRender(node)
22
22
  },
@@ -36,7 +36,7 @@ class NodeConvertorManager {
36
36
  order: data?.order ? data?.order + '' : '0',
37
37
  view: data?.view,
38
38
  code: data?.code,
39
- viewTitle: data?.viewTitle || data?.title,
39
+ viewTitle: data?.viewTitle,
40
40
  actions: data?.actions || [],
41
41
  strategies: this.toStrategyData(data),
42
42
  script: data?.script,
@@ -3,6 +3,7 @@ import react from "react";
3
3
  import { message } from "antd";
4
4
  import { ScriptCodeEditor } from "@coding-script/script-engine";
5
5
  import { getMetadata } from "../../api/script.js";
6
+ import { FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
6
7
  const GroovyCodeEditor = (props)=>{
7
8
  const title = props.title || '脚本编辑器';
8
9
  const [metadata, setMetadata] = react.useState();
@@ -10,7 +11,7 @@ const GroovyCodeEditor = (props)=>{
10
11
  if (props.scriptKey) getMetadata(props.scriptKey).then((res)=>{
11
12
  setMetadata(res.data);
12
13
  }).catch((err)=>{
13
- message.error('获取脚本元数据失败');
14
+ message.error(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_GROOVY_META_FAILED));
14
15
  });
15
16
  }, [
16
17
  props.scriptKey
@@ -3,6 +3,7 @@ import "react";
3
3
  import { GroovyCodeEditor } from "../../components/groovy-code/index.js";
4
4
  import { compile } from "../../api/script.js";
5
5
  import { message } from "antd";
6
+ import { FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
6
7
  const AdvancedScriptEditor = (props)=>{
7
8
  const { script, onChange, readonly } = props;
8
9
  const handleChange = (value)=>{
@@ -20,10 +21,12 @@ const AdvancedScriptEditor = (props)=>{
20
21
  compile({
21
22
  script: code
22
23
  }).then((res)=>{
23
- if (res.success) message.success('脚本编译成功');
24
- else message.error('脚本编译失败: ' + res.message);
24
+ if (res.success) message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_SCRIPT_COMPILE_SUCCESS));
25
+ else message.error(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_SCRIPT_COMPILE_FAILED, {
26
+ message: res.message
27
+ }));
25
28
  }).catch((err)=>{
26
- message.error('脚本编译请求失败');
29
+ message.error(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_SCRIPT_COMPILE_ERROR));
27
30
  });
28
31
  },
29
32
  toolbar: [
@@ -3,6 +3,7 @@ import { getScript, save } from "../../api/node-view.js";
3
3
  import { JavaScriptCodeEditor } from "../../components/js-code/index.js";
4
4
  import { Button, Drawer, message } from "antd";
5
5
  import react from "react";
6
+ import { FlowMessageKey, FlowMessageRegistry } from "@coding-flow/flow-core";
6
7
  const JavaScriptCodeContent = ({ code })=>{
7
8
  const [script, setScript] = react.useState('');
8
9
  react.useEffect(()=>{
@@ -20,7 +21,7 @@ const JavaScriptCodeContent = ({ code })=>{
20
21
  code,
21
22
  script: script
22
23
  }).then((res)=>{
23
- message.success('保存成功');
24
+ message.success(FlowMessageRegistry.getInstance().get(FlowMessageKey.DESIGN_VIEW_CODE_SAVE_SUCCESS));
24
25
  });
25
26
  };
26
27
  return /*#__PURE__*/ jsx(Fragment, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-flow/flow-design",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "description": "flow-engine design components ",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -49,16 +49,16 @@
49
49
  "nanoid": "^5.1.6",
50
50
  "react-redux": "^9.2.0",
51
51
  "styled-components": "^5.3.11",
52
- "@coding-flow/flow-pc-ui": "0.0.55",
53
- "@coding-flow/flow-types": "0.0.55",
54
- "@coding-flow/flow-icons": "0.0.55",
55
- "@coding-flow/flow-core": "0.0.55"
52
+ "@coding-flow/flow-core": "0.0.57",
53
+ "@coding-flow/flow-types": "0.0.57",
54
+ "@coding-flow/flow-pc-ui": "0.0.57",
55
+ "@coding-flow/flow-icons": "0.0.57"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/lodash-es": "^4.17.12",
59
59
  "@types/styled-components": "^5.1.36",
60
- "@coding-flow/flow-core": "0.0.55",
61
- "@coding-flow/flow-types": "0.0.55"
60
+ "@coding-flow/flow-core": "0.0.57",
61
+ "@coding-flow/flow-types": "0.0.57"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "rslib build",