@coding-flow/flow-design 0.0.55 → 0.0.56
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/components/design-editor/tools/download.js +4 -1
- package/dist/components/design-editor/version/components/version-item.js +3 -2
- package/dist/components/design-import/index.js +2 -1
- package/dist/components/design-panel/layout/header.js +3 -3
- package/dist/components/groovy-code/index.js +2 -1
- package/dist/script-components/components/advanced-script-editor.js +6 -3
- package/dist/script-components/components/view-code-drawer.js +2 -1
- package/package.json +7 -7
|
@@ -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(
|
|
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: "保存"
|
|
@@ -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(
|
|
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.
|
|
3
|
+
"version": "0.0.56",
|
|
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-
|
|
53
|
-
"@coding-flow/flow-
|
|
54
|
-
"@coding-flow/flow-
|
|
55
|
-
"@coding-flow/flow-
|
|
52
|
+
"@coding-flow/flow-core": "0.0.56",
|
|
53
|
+
"@coding-flow/flow-icons": "0.0.56",
|
|
54
|
+
"@coding-flow/flow-pc-ui": "0.0.56",
|
|
55
|
+
"@coding-flow/flow-types": "0.0.56"
|
|
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.
|
|
61
|
-
"@coding-flow/flow-types": "0.0.
|
|
60
|
+
"@coding-flow/flow-core": "0.0.56",
|
|
61
|
+
"@coding-flow/flow-types": "0.0.56"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "rslib build",
|