@nocobase/plugin-workflow-parallel 1.4.0-alpha.6 → 1.4.0-alpha.8

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/README.md CHANGED
@@ -1,9 +1,30 @@
1
- # workflow
1
+ # NocoBase
2
2
 
3
- English | [中文](./README.zh-CN.md)
3
+ <video width="100%" controls>
4
+ <source src="https://static-docs.nocobase.com/NocoBase0510.mp4" type="video/mp4">
5
+ </video>
4
6
 
5
- ## 安装激活
6
7
 
7
- 内置插件无需手动安装激活。
8
+ ## What is NocoBase
8
9
 
9
- ## 使用方法
10
+ NocoBase is a scalability-first, open-source no-code development platform.
11
+ Instead of investing years of time and millions of dollars in research and development, deploy NocoBase in a few minutes and you'll have a private, controllable, and extremely scalable no-code development platform!
12
+
13
+ Homepage:
14
+ https://www.nocobase.com/
15
+
16
+ Online Demo:
17
+ https://demo.nocobase.com/new
18
+
19
+ Documents:
20
+ https://docs.nocobase.com/
21
+
22
+ Commericial license & plugins:
23
+ https://www.nocobase.com/en/commercial
24
+
25
+ License agreement:
26
+ https://www.nocobase.com/en/agreement
27
+
28
+
29
+ ## Contact Us:
30
+ hello@nocobase.com
@@ -29,6 +29,7 @@ export default class extends Instruction {
29
29
  default: string;
30
30
  };
31
31
  };
32
+ branching: boolean;
32
33
  components: {
33
34
  RadioWithTooltip: typeof RadioWithTooltip;
34
35
  };
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- (function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/plugin-workflow/client","react/jsx-runtime","react","antd","@ant-design/icons","react-i18next"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@nocobase/plugin-workflow-parallel"]={},e["@nocobase/client"],e["@nocobase/plugin-workflow"],e.jsxRuntime,e.react,e.antd,e["@ant-design/icons"],e["react-i18next"]))})(this,function(e,t,n,r,f,d,b,u){"use strict";var M=Object.defineProperty;var S=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var l=(e,t,n)=>(S(e,typeof t!="symbol"?t+"":t,n),n);var x=(e,t,n)=>new Promise((r,f)=>{var d=a=>{try{u(n.next(a))}catch(p){f(p)}},b=a=>{try{u(n.throw(a))}catch(p){f(p)}},u=a=>a.done?r(a.value):Promise.resolve(a.value).then(d,b);u((n=n.apply(e,t)).next())});const a="workflow-parallel";function p(h,m={}){const{t:c}=v(m);return c(h)}function v(h){return u.useTranslation(a,h)}class $ extends n.Instruction{constructor(){super(...arguments);l(this,"title",`{{t("Parallel branch", { ns: "${a}" })}}`);l(this,"type","parallel");l(this,"group","control");l(this,"description",`{{t("Run multiple branch processes in parallel.", { ns: "${a}" })}}`);l(this,"fieldset",{mode:{type:"string",title:`{{t("Mode", { ns: "${a}" })}}`,"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{value:"all",label:`{{t('All succeeded', { ns: "${a}" })}}`,tooltip:`{{t('Continue after all branches succeeded', { ns: "${a}" })}}`},{value:"any",label:`{{t('Any succeeded', { ns: "${a}" })}}`,tooltip:`{{t('Continue after any branch succeeded', { ns: "${a}" })}}`},{value:"race",label:`{{t('Any succeeded or failed', { ns: "${a}" })}}`,tooltip:`{{t('Continue after any branch succeeded, or exit after any branch failed.', { ns: "${a}" })}}`}]},default:"all"}});l(this,"components",{RadioWithTooltip:n.RadioWithTooltip})}Component({data:c}){const{styles:A}=n.useStyles(),{id:B,config:{mode:L}}=c,{workflow:y,nodes:T}=n.useFlowContext(),i=T.reduce((s,o)=>o.upstreamId===B&&o.branchIndex!=null?s.concat(o):s,[]).sort((s,o)=>s.branchIndex-o.branchIndex),[g,C]=f.useState(Math.max(2,i.length)),{getAriaLabel:q}=n.useGetAriaLabelOfAddButton(c),N=p("Add branch"),j=Array(Math.max(0,g-i.length)).fill(null),I=i[i.length-1];return r.jsx(n.NodeDefaultView,{data:c,children:r.jsxs("div",{className:A.nodeSubtreeClass,children:[r.jsxs("div",{className:A.branchBlockClass,children:[i.map(s=>r.jsx(n.Branch,{from:c,entry:s,branchIndex:s.branchIndex},s.id)),j.map((s,o)=>r.jsx(n.Branch,{from:c,branchIndex:(I?I.branchIndex:0)+o+1,controller:i.length+o>1?r.jsx("div",{className:t.css`
10
+ (function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@nocobase/plugin-workflow/client","react/jsx-runtime","react","antd","@ant-design/icons","react-i18next"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@nocobase/plugin-workflow-parallel"]={},e["@nocobase/client"],e["@nocobase/plugin-workflow"],e.jsxRuntime,e.react,e.antd,e["@ant-design/icons"],e["react-i18next"]))})(this,function(e,t,n,s,f,d,b,u){"use strict";var M=Object.defineProperty;var S=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var c=(e,t,n)=>(S(e,typeof t!="symbol"?t+"":t,n),n);var m=(e,t,n)=>new Promise((s,f)=>{var d=a=>{try{u(n.next(a))}catch(p){f(p)}},b=a=>{try{u(n.throw(a))}catch(p){f(p)}},u=a=>a.done?s(a.value):Promise.resolve(a.value).then(d,b);u((n=n.apply(e,t)).next())});const a="workflow-parallel";function p(h,x={}){const{t:l}=v(x);return l(h)}function v(h){return u.useTranslation(a,h)}class $ extends n.Instruction{constructor(){super(...arguments);c(this,"title",`{{t("Parallel branch", { ns: "${a}" })}}`);c(this,"type","parallel");c(this,"group","control");c(this,"description",`{{t("Run multiple branch processes in parallel.", { ns: "${a}" })}}`);c(this,"fieldset",{mode:{type:"string",title:`{{t("Mode", { ns: "${a}" })}}`,"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{value:"all",label:`{{t('All succeeded', { ns: "${a}" })}}`,tooltip:`{{t('Continue after all branches succeeded', { ns: "${a}" })}}`},{value:"any",label:`{{t('Any succeeded', { ns: "${a}" })}}`,tooltip:`{{t('Continue after any branch succeeded', { ns: "${a}" })}}`},{value:"race",label:`{{t('Any succeeded or failed', { ns: "${a}" })}}`,tooltip:`{{t('Continue after any branch succeeded, or exit after any branch failed.', { ns: "${a}" })}}`}]},default:"all"}});c(this,"branching",!0);c(this,"components",{RadioWithTooltip:n.RadioWithTooltip})}Component({data:l}){const{styles:A}=n.useStyles(),{id:B,config:{mode:L}}=l,{workflow:y,nodes:T}=n.useFlowContext(),i=T.reduce((r,o)=>o.upstreamId===B&&o.branchIndex!=null?r.concat(o):r,[]).sort((r,o)=>r.branchIndex-o.branchIndex),[g,C]=f.useState(Math.max(2,i.length)),{getAriaLabel:q}=n.useGetAriaLabelOfAddButton(l),N=p("Add branch"),j=Array(Math.max(0,g-i.length)).fill(null),I=i[i.length-1];return s.jsx(n.NodeDefaultView,{data:l,children:s.jsxs("div",{className:A.nodeSubtreeClass,children:[s.jsxs("div",{className:A.branchBlockClass,children:[i.map(r=>s.jsx(n.Branch,{from:l,entry:r,branchIndex:r.branchIndex},r.id)),j.map((r,o)=>s.jsx(n.Branch,{from:l,branchIndex:(I?I.branchIndex:0)+o+1,controller:i.length+o>1?s.jsx("div",{className:t.css`
11
11
  padding-top: 2em;
12
12
 
13
13
  > button {
@@ -15,9 +15,9 @@
15
15
  transform: rotate(45deg);
16
16
  }
17
17
  }
18
- `,children:r.jsx(d.Button,{shape:"circle",icon:r.jsx(b.PlusOutlined,{}),onClick:()=>C(g-1),disabled:y.executed})}):null},`temp_${i.length+o}`))]}),r.jsx(d.Tooltip,{title:N,className:t.css`
18
+ `,children:s.jsx(d.Button,{shape:"circle",icon:s.jsx(b.PlusOutlined,{}),onClick:()=>C(g-1),disabled:y.executed,size:"small"})}):null},`temp_${i.length+o}`))]}),s.jsx(d.Tooltip,{title:N,className:t.css`
19
19
  visibility: ${y.executed?"hidden":"visible"};
20
- `,children:r.jsx(d.Button,{"aria-label":q("add-branch"),icon:r.jsx(b.PlusOutlined,{}),className:t.css`
20
+ `,children:s.jsx(d.Button,{"aria-label":q("add-branch"),icon:s.jsx(b.PlusOutlined,{}),className:t.css`
21
21
  position: relative;
22
22
  top: 1em;
23
23
  transform-origin: center;
@@ -27,4 +27,4 @@
27
27
  transform-origin: center;
28
28
  transform: rotate(-45deg);
29
29
  }
30
- `,onClick:()=>C(g+1),disabled:y.executed})})]})})}}class w extends t.Plugin{afterAdd(){return x(this,null,function*(){})}beforeLoad(){return x(this,null,function*(){})}load(){return x(this,null,function*(){this.app.pm.get(n).registerInstruction("parallel",$)})}}e.default=w,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
30
+ `,size:"small",onClick:()=>C(g+1),disabled:y.executed})})]})})}}class w extends t.Plugin{afterAdd(){return m(this,null,function*(){})}beforeLoad(){return m(this,null,function*(){})}load(){return m(this,null,function*(){this.app.pm.get(n).registerInstruction("parallel",$)})}}e.default=w,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -11,11 +11,11 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "antd": "5.12.8",
13
13
  "@ant-design/icons": "5.2.6",
14
- "@nocobase/client": "1.4.0-alpha.6",
15
- "@nocobase/plugin-workflow": "1.4.0-alpha.6",
14
+ "@nocobase/client": "1.4.0-alpha.8",
15
+ "@nocobase/plugin-workflow": "1.4.0-alpha.8",
16
16
  "react-i18next": "11.18.6",
17
- "@nocobase/server": "1.4.0-alpha.6",
18
- "@nocobase/plugin-workflow-test": "1.4.0-alpha.6",
19
- "@nocobase/test": "1.4.0-alpha.6",
20
- "@nocobase/utils": "1.4.0-alpha.6"
17
+ "@nocobase/server": "1.4.0-alpha.8",
18
+ "@nocobase/plugin-workflow-test": "1.4.0-alpha.8",
19
+ "@nocobase/test": "1.4.0-alpha.8",
20
+ "@nocobase/utils": "1.4.0-alpha.8"
21
21
  };
@@ -1,5 +1,5 @@
1
1
  {
2
- "Parallel branch": "分支",
2
+ "Parallel branch": "并行分支",
3
3
  "Run multiple branch processes in parallel.": "并行运行多个分支流程。",
4
4
  "Add branch": "增加分支",
5
5
  "Mode": "执行模式",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "工作流:并行分支节点",
5
5
  "description": "Could be used for parallel execution of branch processes in the workflow.",
6
6
  "description.zh-CN": "用于在工作流中需要并行执行的分支流程。",
7
- "version": "1.4.0-alpha.6",
7
+ "version": "1.4.0-alpha.8",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow-parallel",
@@ -22,7 +22,7 @@
22
22
  "@nocobase/server": "1.x",
23
23
  "@nocobase/test": "1.x"
24
24
  },
25
- "gitHead": "7d8583704a1f7ae0caeab72a19fd0bce0a4cec0f",
25
+ "gitHead": "aa36bd20b2028c5e133a59e922c2f1ab22c86dde",
26
26
  "keywords": [
27
27
  "Workflow"
28
28
  ]
package/README.zh-CN.md DELETED
@@ -1,9 +0,0 @@
1
- # workflow
2
-
3
- [English](./README.md) | 中文
4
-
5
- ## 安装激活
6
-
7
- 内置插件无需手动安装激活。
8
-
9
- ## 使用方法