@nocobase/plugin-workflow-parallel 1.4.0-alpha.1 → 1.4.0-alpha.11
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 +26 -5
- package/dist/client/ParallelInstruction.d.ts +1 -0
- package/dist/client/index.js +1 -21
- package/dist/externalVersion.js +6 -6
- package/dist/locale/zh-CN.json +1 -1
- package/package.json +2 -2
- package/README.zh-CN.md +0 -9
package/README.md
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NocoBase
|
|
2
2
|
|
|
3
|
-
|
|
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
|
package/dist/client/index.js
CHANGED
|
@@ -7,24 +7,4 @@
|
|
|
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`
|
|
11
|
-
padding-top: 2em;
|
|
12
|
-
|
|
13
|
-
> button {
|
|
14
|
-
.anticon {
|
|
15
|
-
transform: rotate(45deg);
|
|
16
|
-
}
|
|
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`
|
|
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`
|
|
21
|
-
position: relative;
|
|
22
|
-
top: 1em;
|
|
23
|
-
transform-origin: center;
|
|
24
|
-
transform: rotate(45deg);
|
|
25
|
-
|
|
26
|
-
.anticon {
|
|
27
|
-
transform-origin: center;
|
|
28
|
-
transform: rotate(-45deg);
|
|
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"}})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/plugin-workflow"),require("@ant-design/icons"),require("@nocobase/client"),require("react"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-parallel",["react-i18next","@nocobase/plugin-workflow","@ant-design/icons","@nocobase/client","react","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-parallel"]=t(require("react-i18next"),require("@nocobase/plugin-workflow"),require("@ant-design/icons"),require("@nocobase/client"),require("react"),require("antd")):e["@nocobase/plugin-workflow-parallel"]=t(e["react-i18next"],e["@nocobase/plugin-workflow"],e["@ant-design/icons"],e["@nocobase/client"],e.react,e.antd)}(self,function(e,t,n,r,o,c){return function(){"use strict";var a={482:function(e){e.exports=n},772:function(e){e.exports=r},305:function(e){e.exports=t},721:function(e){e.exports=c},156:function(e){e.exports=o},238:function(t){t.exports=e}},u={};function i(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return a[e](n,n.exports,i),n.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};i.r(l),i.d(l,{default:function(){return F}});var f=i("772"),s=i("305"),p=i.n(s),d=i("156"),b=i.n(d),y=i("721"),h=i("482"),v=i("238"),m="workflow-parallel";function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}function P(){var e=k(["\n padding-top: 2em;\n\n > button {\n .anticon {\n transform: rotate(45deg);\n }\n }\n "]);return P=function(){return e},e}function _(){var e=k(["\n visibility: ",";\n "]);return _=function(){return e},e}function E(){var e=k(["\n position: relative;\n top: 1em;\n transform-origin: center;\n transform: rotate(45deg);\n\n .anticon {\n transform-origin: center;\n transform: rotate(-45deg);\n }\n "]);return E=function(){return e},e}var A=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=O(n),x(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,S()?Reflect.construct(n,r||[],O(t).constructor):n.apply(t,r)),"title",'{{t("Parallel branch", { ns: "'.concat(m,'" })}}')),x(e,"type","parallel"),x(e,"group","control"),x(e,"description",'{{t("Run multiple branch processes in parallel.", { ns: "'.concat(m,'" })}}')),x(e,"fieldset",{mode:{type:"string",title:'{{t("Mode", { ns: "'.concat(m,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{value:"all",label:"{{t('All succeeded', { ns: \"".concat(m,'" })}}'),tooltip:"{{t('Continue after all branches succeeded', { ns: \"".concat(m,'" })}}')},{value:"any",label:"{{t('Any succeeded', { ns: \"".concat(m,'" })}}'),tooltip:"{{t('Continue after any branch succeeded', { ns: \"".concat(m,'" })}}')},{value:"race",label:"{{t('Any succeeded or failed', { ns: \"".concat(m,'" })}}'),tooltip:"{{t('Continue after any branch succeeded, or exit after any branch failed.', { ns: \"".concat(m,'" })}}')}]},default:"all"}}),x(e,"branching",!0),x(e,"components",{RadioWithTooltip:s.RadioWithTooltip}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(o,e),t=o,n=[{key:"Component",value:function(e){var t,n,r=e.data,o=(0,s.useStyles)().styles,c=r.id;r.config.mode;var a=(0,s.useFlowContext)(),u=a.workflow,i=a.nodes.reduce(function(e,t){return t.upstreamId===c&&null!=t.branchIndex?e.concat(t):e},[]).sort(function(e,t){return e.branchIndex-t.branchIndex});var l=(t=(0,d.useState)(Math.max(2,i.length)),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var c=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(c.push(n.value),!t||c.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(u)throw r}}return c}}(t,2)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=l[0],w=l[1],x=(0,s.useGetAriaLabelOfAddButton)(r).getAriaLabel,O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,function(e){return(0,v.useTranslation)(m,e)}(t).t)(e)}("Add branch"),j=Array(Math.max(0,p-i.length)).fill(null),k=i[i.length-1];return b().createElement(s.NodeDefaultView,{data:r},b().createElement("div",{className:o.nodeSubtreeClass},b().createElement("div",{className:o.branchBlockClass},i.map(function(e){return b().createElement(s.Branch,{key:e.id,from:r,entry:e,branchIndex:e.branchIndex})}),j.map(function(e,t){return b().createElement(s.Branch,{key:"temp_".concat(i.length+t),from:r,branchIndex:(k?k.branchIndex:0)+t+1,controller:i.length+t>1?b().createElement("div",{className:(0,f.css)(P())},b().createElement(y.Button,{shape:"circle",icon:b().createElement(h.PlusOutlined,null),onClick:function(){return w(p-1)},disabled:u.executed,size:"small"})):null})})),b().createElement(y.Tooltip,{title:O,className:(0,f.css)(_(),u.executed?"hidden":"visible")},b().createElement(y.Button,{"aria-label":x("add-branch"),icon:b().createElement(h.PlusOutlined,null),className:(0,f.css)(E()),size:"small",onClick:function(){return w(p+1)},disabled:u.executed}))))}}],w(t.prototype,n),o}(s.Instruction);function I(e,t,n,r,o,c,a){try{var u=e[c](a),i=u.value}catch(e){n(e);return}u.done?t(i):Promise.resolve(i).then(r,o)}function T(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var c=e.apply(t,n);function a(e){I(c,r,o,a,u,"next",e)}function u(e){I(c,r,o,a,u,"throw",e)}a(void 0)})}}function q(e,t,n){return(q=N()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&B(o,n.prototype),o}).apply(null,arguments)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(e){var t="function"==typeof Map?new Map:void 0;return(M=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return q(e,arguments,R(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),B(r,e)})(e)}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function z(e,t){var n,r,o,c,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return c={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function u(c){return function(u){return function(c){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var F=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=R(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,N()?Reflect.construct(t,n||[],R(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(o,e),t=o,n=[{key:"afterAdd",value:function(){return T(function(){return z(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return T(function(){return z(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return T(function(){return z(this,function(t){return e.app.pm.get(p()).registerInstruction("parallel",A),[2]})})()}}],C(t.prototype,n),o}(M(f.Plugin));return l}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -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.
|
|
15
|
-
"@nocobase/plugin-workflow": "1.4.0-alpha.
|
|
14
|
+
"@nocobase/client": "1.4.0-alpha.11",
|
|
15
|
+
"@nocobase/plugin-workflow": "1.4.0-alpha.11",
|
|
16
16
|
"react-i18next": "11.18.6",
|
|
17
|
-
"@nocobase/server": "1.4.0-alpha.
|
|
18
|
-
"@nocobase/plugin-workflow-test": "1.4.0-alpha.
|
|
19
|
-
"@nocobase/test": "1.4.0-alpha.
|
|
20
|
-
"@nocobase/utils": "1.4.0-alpha.
|
|
17
|
+
"@nocobase/server": "1.4.0-alpha.11",
|
|
18
|
+
"@nocobase/plugin-workflow-test": "1.4.0-alpha.11",
|
|
19
|
+
"@nocobase/test": "1.4.0-alpha.11",
|
|
20
|
+
"@nocobase/utils": "1.4.0-alpha.11"
|
|
21
21
|
};
|
package/dist/locale/zh-CN.json
CHANGED
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.
|
|
7
|
+
"version": "1.4.0-alpha.11",
|
|
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": "
|
|
25
|
+
"gitHead": "621ac1788ae0622813b98c2f82f5f524067a792c",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Workflow"
|
|
28
28
|
]
|