@nocobase/plugin-workflow-parallel 2.2.0-beta.9 → 2.3.0-alpha.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/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/21.92db6f66a2eaafbd.js +10 -0
- package/dist/client/ParallelInstruction.d.ts +2 -34
- package/dist/client/index.js +1 -1
- package/dist/client-v2/21.ce4a333fb5a75746.js +10 -0
- package/dist/client-v2/index.d.ts +10 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +11 -0
- package/dist/client-v2/nodes/components/parallel.d.ts +20 -0
- package/dist/client-v2/nodes/parallel.d.ts +28 -0
- package/dist/client-v2/plugin.d.ts +13 -0
- package/dist/externalVersion.js +11 -8
- package/dist/node_modules/joi/package.json +1 -1
- package/package.json +3 -2
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_parallel=self.webpackChunk_nocobase_plugin_workflow_parallel||[]).push([["21"],{12:function(e,n,t){t.d(n,{ParallelCanvasComponent:function(){return p},ParallelFieldset:function(){return h}});var r=t(155),l=t.n(r),a=t(477),o=t(375),i=t(59),c=t(197),u=t(488);function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function f(){var e=d(["\n position: relative;\n margin: ","px 0 0;\n "]);return f=function(){return e},e}function m(){var e=d(["\n padding-top: ","px;\n\n > button {\n line-height: 1;\n }\n\n .anticon {\n transform: rotate(45deg);\n }\n "]);return m=function(){return e},e}function b(){var e=d(["\n position: relative;\n top: ","px;\n line-height: 1;\n transform-origin: center;\n transform: rotate(45deg);\n visibility: ",";\n\n .anticon {\n transform-origin: center;\n transform: rotate(-45deg);\n }\n "]);return b=function(){return e},e}function h(){var e,n=(0,u.kj)(),t=[{value:"all",label:(e=(0,u.kj)())("All succeeded"),tooltip:e("Continue after all branches succeeded")},{value:"any",label:e("Any succeeded"),tooltip:e("Continue after any branch succeeded")},{value:"race",label:e("Any succeeded or failed"),tooltip:e("Continue after any branch succeeded, or exit after any branch failed.")},{value:"allSettled",label:e("Run all branches (ignore failures)"),tooltip:e("Always continue after all branches end, regardless of success or failure.")}];return l().createElement(i.Form.Item,{name:["config","mode"],label:n("Mode"),initialValue:"all"},l().createElement(c.RadioWithTooltip,{direction:"vertical",options:t}))}function p(e){var n,t,d,h=e.data,p=(0,u.kj)(),v=i.theme.useToken().token,y=(0,c.useStyles)().styles,g=null!=(t=(0,c.useFlowContext)())?t:{},k=g.nodes,x=g.workflow,E=BigInt((null==x||null==(d=x.versionStats)?void 0:d.executed)||0)>0n,w=(void 0===k?[]:k).filter(function(e){return e.upstreamId===h.id&&null!=e.branchIndex}).sort(function(e,n){return Number(e.branchIndex)-Number(n.branchIndex)}),C=function(e){if(Array.isArray(e))return e}(n=(0,r.useState)(Math.max(2,w.length)))||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(l.push(n.value),2!==l.length);a=!0);}catch(e){o=!0,t=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw t}}return l}}(n)||function(e){if(e){if("string"==typeof e)return s(e,2);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 s(e,2)}}(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.")}(),I=C[0],A=C[1],j=Array.from({length:Math.max(0,I-w.length)}),S=w[w.length-1],N=(0,a.css)(f(),v.margin),_=(0,a.css)(m(),v.paddingLG),B=(0,a.css)(b(),v.padding,E?"hidden":"visible");return l().createElement(c.NodeDefaultView,{data:h},l().createElement("div",{className:y.nodeSubtreeClass},l().createElement("div",{className:y.branchBlockClass},w.map(function(e,n){return l().createElement(c.Branch,{key:e.id,from:h,entry:e,branchIndex:e.branchIndex,controller:l().createElement(i.Tag,{className:N},n+1)})}),j.map(function(e,n){var t;return l().createElement(c.Branch,{key:"temp_".concat(w.length+n),from:h,branchIndex:Number(null!=(t=null==S?void 0:S.branchIndex)?t:0)+n+1,controller:w.length+n>1?l().createElement("div",{className:_},l().createElement(i.Button,{"aria-label":["remove-button",null==h?void 0:h.type,null==h?void 0:h.title,w.length+n+1].filter(Boolean).join("-"),shape:"circle",icon:l().createElement(o.PlusOutlined,null),onClick:function(){return A(I-1)},disabled:E,size:"small"})):null})})),l().createElement(i.Tooltip,{title:p("Add branch")},l().createElement(i.Button,{"aria-label":["add-button",null==h?void 0:h.type,null==h?void 0:h.title,"add-branch"].filter(Boolean).join("-"),icon:l().createElement(o.PlusOutlined,null),className:B,size:"small",onClick:function(){return A(I+1)},disabled:E}))))}}}]);
|
|
@@ -6,38 +6,6 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
declare function NodeComponent({ data }: {
|
|
12
|
-
data: any;
|
|
13
|
-
}): React.JSX.Element;
|
|
14
|
-
export default class extends Instruction {
|
|
15
|
-
title: string;
|
|
16
|
-
type: string;
|
|
17
|
-
group: string;
|
|
18
|
-
description: string;
|
|
19
|
-
icon: React.JSX.Element;
|
|
20
|
-
fieldset: {
|
|
21
|
-
mode: {
|
|
22
|
-
type: string;
|
|
23
|
-
title: string;
|
|
24
|
-
'x-decorator': string;
|
|
25
|
-
'x-component': string;
|
|
26
|
-
'x-component-props': {
|
|
27
|
-
direction: string;
|
|
28
|
-
options: {
|
|
29
|
-
value: string;
|
|
30
|
-
label: string;
|
|
31
|
-
tooltip: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
34
|
-
default: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
branching: boolean;
|
|
38
|
-
components: {
|
|
39
|
-
RadioWithTooltip: typeof RadioWithTooltip;
|
|
40
|
-
};
|
|
41
|
-
Component: typeof NodeComponent;
|
|
9
|
+
import ParallelInstructionV2 from '../client-v2/nodes/parallel';
|
|
10
|
+
export default class ParallelInstruction extends ParallelInstructionV2 {
|
|
42
11
|
}
|
|
43
|
-
export {};
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/client"),require("react-i18next"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-parallel",["react","antd","@nocobase/client","react-i18next","@ant-design/icons","@nocobase/plugin-workflow/client"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-parallel"]=t(require("react"),require("antd"),require("@nocobase/client"),require("react-i18next"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client")):e["@nocobase/plugin-workflow-parallel"]=t(e.react,e.antd,e["@nocobase/client"],e["react-i18next"],e["@ant-design/icons"],e["@nocobase/plugin-workflow/client"])}(self,function(e,t,n,r,o,a){return function(){"use strict";var c={375:function(e){e.exports=o},342:function(e){e.exports=n},990:function(e){e.exports=a},59:function(e){e.exports=t},155:function(t){t.exports=e},953:function(e){e.exports=r}},i={};function l(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return c[e](n,n.exports,l),n.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(u=l.g.location+"");var u,s=l.g.document;if(!u&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(u=s.currentScript.src),!u)){var f=s.getElementsByTagName("script");if(f.length)for(var p=f.length-1;p>-1&&(!u||!/^http(s?):/.test(u));)u=f[p--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");l.p=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var d={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-parallel/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-parallel/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",a="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var c=window.location.pathname||"/",i=c.indexOf(a);e=i>=0?c.slice(0,i+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-parallel/dist/client/"}l.p=e}(),!function(){l.r(d),l.d(d,{default:function(){return I}});var e=l(342),t=l(990),n=l.n(t),r=l(155),o=l.n(r),a=l(59),c=l(375),i=l(953),u="workflow-parallel";function s(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 f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return(p=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 y(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function m(){var e=y(["\n position: relative;\n margin: 1rem 0 0 0;\n "]);return m=function(){return e},e}function v(){var e=y(["\n padding-top: 2em;\n\n > button {\n line-height: 1;\n\n .anticon {\n transform: rotate(45deg);\n }\n }\n "]);return v=function(){return e},e}function g(){var e=y(["\n visibility: ",";\n "]);return g=function(){return e},e}function w(){var e=y(["\n position: relative;\n top: 1em;\n line-height: 1;\n transform-origin: center;\n transform: rotate(45deg);\n\n .anticon {\n transform-origin: center;\n transform: rotate(-45deg);\n }\n "]);return w=function(){return e},e}function x(n){var l,f=n.data,p=(0,t.useStyles)().styles,d=f.id;f.config.mode;var b=(0,t.useFlowContext)().nodes,y=(0,t.useWorkflowExecuted)(),h=b.reduce(function(e,t){return t.upstreamId===d&&null!=t.branchIndex?e.concat(t):e},[]).sort(function(e,t){return e.branchIndex-t.branchIndex}),x=function(e){if(Array.isArray(e))return e}(l=(0,r.useState)(Math.max(2,h.length)))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){c=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(c)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return s(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),O=x[0],_=x[1],j=(0,t.useGetAriaLabelOfAddButton)(f).getAriaLabel,S=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,(t=n,(0,i.useTranslation)(u,t)).t)(e)}("Add branch"),k=Array(Math.max(0,O-h.length)).fill(null),E=h[h.length-1];return o().createElement(t.NodeDefaultView,{data:f},o().createElement("div",{className:p.nodeSubtreeClass},o().createElement("div",{className:p.branchBlockClass},h.map(function(n,r){return o().createElement(t.Branch,{key:n.id,from:f,entry:n,branchIndex:n.branchIndex,controller:o().createElement(a.Tag,{className:(0,e.css)(m())},r+1)})}),k.map(function(n,r){return o().createElement(t.Branch,{key:"temp_".concat(h.length+r),from:f,branchIndex:(E?E.branchIndex:0)+r+1,controller:h.length+r>1?o().createElement("div",{className:(0,e.css)(v())},o().createElement(a.Button,{shape:"circle",icon:o().createElement(c.PlusOutlined,null),onClick:function(){return _(O-1)},disabled:y>0,size:"small"})):null})})),o().createElement(a.Tooltip,{title:S,className:(0,e.css)(g(),y>0?"hidden":"visible")},o().createElement(a.Button,{"aria-label":j("add-branch"),icon:o().createElement(c.PlusOutlined,null),className:(0,e.css)(w()),size:"small",onClick:function(){return _(O+1)},disabled:y>0}))))}var O=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,r,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,a=arguments,r=p(r),f(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(r,a||[],p(this).constructor):r.apply(this,a)),"title",'{{t("Parallel branch", { ns: "'.concat(u,'" })}}')),f(e,"type","parallel"),f(e,"group","control"),f(e,"description",'{{t("Run multiple branch processes in parallel.", { ns: "'.concat(u,'" })}}')),f(e,"icon",o().createElement(c.ApartmentOutlined,{style:{}})),f(e,"fieldset",{mode:{type:"string",title:'{{t("Mode", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{direction:"vertical",options:[{value:"all",label:"{{t('All succeeded', { ns: \"".concat(u,'" })}}'),tooltip:"{{t('Continue after all branches succeeded', { ns: \"".concat(u,'" })}}')},{value:"any",label:"{{t('Any succeeded', { ns: \"".concat(u,'" })}}'),tooltip:"{{t('Continue after any branch succeeded', { ns: \"".concat(u,'" })}}')},{value:"race",label:"{{t('Any succeeded or failed', { ns: \"".concat(u,'" })}}'),tooltip:"{{t('Continue after any branch succeeded, or exit after any branch failed.', { ns: \"".concat(u,'" })}}')},{value:"allSettled",label:"{{t('Run all branches (ignore failures)', { ns: \"".concat(u,'" })}}'),tooltip:"{{t('Always continue after all branches end, regardless of success or failure.', { ns: \"".concat(u,'" })}}')}]},default:"all"}}),f(e,"branching",!0),f(e,"components",{RadioWithTooltip:t.RadioWithTooltip}),f(e,"Component",x),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&b(n,e),n}(t.Instruction);function _(e,t,n,r,o,a,c){try{var i=e[a](c),l=i.value}catch(e){n(e);return}i.done?t(l):Promise.resolve(l).then(r,o)}function j(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function c(e){_(a,r,o,c,i,"next",e)}function i(e){_(a,r,o,c,i,"throw",e)}c(void 0)})}}function S(e,t,n){return(S=A()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&E(o,n.prototype),o}).apply(null,arguments)}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(e){var t="function"==typeof Map?new Map:void 0;return(P=function(e){if(null===e||-1===Function.toString.call(e).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,n)}function n(){return S(e,arguments,k(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E(n,e)})(e)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function T(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(c,"next",{value:l(0)}),i(c,"throw",{value:l(1)}),i(c,"return",{value:l(2)}),"function"==typeof Symbol&&i(c,Symbol.iterator,{value:function(){return this}}),c;function l(i){return function(l){var u=[i,l];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var I=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=k(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,A()?Reflect.construct(e,t||[],k(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&E(r,e),t=[{key:"afterAdd",value:function(){return j(function(){return T(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return j(function(){return T(this,function(e){return[2]})})()}},{key:"load",value:function(){return j(function(){return T(this,function(e){return this.app.pm.get(n()).registerInstruction("parallel",O),[2]})}).call(this)}}],function(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)}}(r.prototype,t),r}(P(e.Plugin))}(),d}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/css"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-parallel",["@emotion/css","react","antd","@nocobase/client","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/plugin-workflow/client","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-parallel"]=t(require("@emotion/css"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-parallel"]=t(e["@emotion/css"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/plugin-workflow/client-v2"],e["@ant-design/icons"],e["@nocobase/plugin-workflow/client"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,u,c){return function(){"use strict";var a,l,f,p={488:function(e,t,n){n.d(t,{MZ:function(){return c},kj:function(){return u}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var i="workflow-parallel";function u(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}function c(e,t){return(0,r.tExpr)(e,o({ns:[i,"client"],nsMode:"fallback"},t))}},375:function(e){e.exports=i},477:function(t){t.exports=e},342:function(e){e.exports=r},694:function(e){e.exports=c},990:function(e){e.exports=u},197:function(e){e.exports=o},59:function(e){e.exports=n},155:function(e){e.exports=t}},s={};function b(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return p[e](n,n.exports,b),n.exports}b.m=p,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+".92db6f66a2eaafbd.js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},y={},b.l=function(e,t,n,r){if(y[e])return void y[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-workflow-parallel:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-parallel:"+n),o.src=e),y[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=y[e];if(delete y[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(d=b.g.location+"");var y,d,h=b.g.document;if(!d&&h&&(h.currentScript&&"SCRIPT"===h.currentScript.tagName.toUpperCase()&&(d=h.currentScript.src),!d)){var v=h.getElementsByTagName("script");if(v.length)for(var w=v.length-1;w>-1&&(!d||!/^http(s?):/.test(d));)d=v[w--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");b.p=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a={889:0},b.f.j=function(e,t){var n=b.o(a,e)?a[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(a,e)&&(0!==(n=a[e])&&(a[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==a[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);u&&u(b)}for(e&&e(t);c<o.length;c++)r=o[c],b.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(f=self.webpackChunk_nocobase_plugin_workflow_parallel=self.webpackChunk_nocobase_plugin_workflow_parallel||[]).forEach(l.bind(null,0)),f.push=l.bind(null,f.push.bind(f));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-parallel/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-parallel/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var u=window.location.pathname||"/",c=u.indexOf(i);e=c>=0?u.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-parallel/dist/client/"}b.p=e}(),!function(){b.r(g),b.d(g,{default:function(){return x}});var e=b(342),t=b(990),n=b.n(t),r=b(155),o=b.n(r),i=b(375),u=b(197),c=b(488);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var h=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return e=t,n=arguments,e=s(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,d()?Reflect.construct(e,n||[],s(this).constructor):e.apply(this,n))}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e),t}(function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=l(t),a(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,p()?Reflect.construct(t,r||[],l(this).constructor):t.apply(this,r)),"type","parallel"),a(e,"title",(0,c.MZ)("Parallel branch")),a(e,"group","control"),a(e,"description",(0,c.MZ)("Run multiple branch processes in parallel.")),a(e,"icon",o().createElement(i.ApartmentOutlined,null)),a(e,"branching",!0),a(e,"FieldsetLoader",function(){return b.e("21").then(b.bind(b,12)).then(function(e){return{default:e.ParallelFieldset}})}),a(e,"ComponentLoader",function(){return b.e("21").then(b.bind(b,12)).then(function(e){return{default:e.ParallelCanvasComponent}})}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"createDefaultConfig",value:function(){return{mode:"all"}}}],function(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)}}(n.prototype,t),n}(u.Instruction));function v(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){v(i,r,o,u,c,"next",e)}function c(e){v(i,r,o,u,c,"throw",e)}u(void 0)})}}function m(e,t,n){return(m=j()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&O(o,n.prototype),o}).apply(null,arguments)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e){var t="function"==typeof Map?new Map:void 0;return(k=function(e){if(null===e||-1===Function.toString.call(e).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,n)}function n(){return m(e,arguments,_(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,e)})(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function P(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var x=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=_(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,j()?Reflect.construct(e,t||[],_(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&O(r,e),t=[{key:"afterAdd",value:function(){return w(function(){return P(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return w(function(){return P(this,function(e){return[2]})})()}},{key:"load",value:function(){return w(function(){return P(this,function(e){return this.app.pm.get(n()).registerInstruction("parallel",h),[2]})}).call(this)}}],function(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)}}(r.prototype,t),r}(k(e.Plugin))}(),g}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_parallel_client_v2=self.webpackChunk_nocobase_plugin_workflow_parallel_client_v2||[]).push([["21"],{12:function(e,n,t){t.d(n,{ParallelCanvasComponent:function(){return p},ParallelFieldset:function(){return h}});var r=t(155),l=t.n(r),a=t(477),o=t(375),i=t(59),c=t(197),u=t(488);function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function f(){var e=d(["\n position: relative;\n margin: ","px 0 0;\n "]);return f=function(){return e},e}function m(){var e=d(["\n padding-top: ","px;\n\n > button {\n line-height: 1;\n }\n\n .anticon {\n transform: rotate(45deg);\n }\n "]);return m=function(){return e},e}function b(){var e=d(["\n position: relative;\n top: ","px;\n line-height: 1;\n transform-origin: center;\n transform: rotate(45deg);\n visibility: ",";\n\n .anticon {\n transform-origin: center;\n transform: rotate(-45deg);\n }\n "]);return b=function(){return e},e}function h(){var e,n=(0,u.kj)(),t=[{value:"all",label:(e=(0,u.kj)())("All succeeded"),tooltip:e("Continue after all branches succeeded")},{value:"any",label:e("Any succeeded"),tooltip:e("Continue after any branch succeeded")},{value:"race",label:e("Any succeeded or failed"),tooltip:e("Continue after any branch succeeded, or exit after any branch failed.")},{value:"allSettled",label:e("Run all branches (ignore failures)"),tooltip:e("Always continue after all branches end, regardless of success or failure.")}];return l().createElement(i.Form.Item,{name:["config","mode"],label:n("Mode"),initialValue:"all"},l().createElement(c.RadioWithTooltip,{direction:"vertical",options:t}))}function p(e){var n,t,d,h=e.data,p=(0,u.kj)(),v=i.theme.useToken().token,y=(0,c.useStyles)().styles,g=null!=(t=(0,c.useFlowContext)())?t:{},k=g.nodes,x=g.workflow,E=BigInt((null==x||null==(d=x.versionStats)?void 0:d.executed)||0)>0n,w=(void 0===k?[]:k).filter(function(e){return e.upstreamId===h.id&&null!=e.branchIndex}).sort(function(e,n){return Number(e.branchIndex)-Number(n.branchIndex)}),C=function(e){if(Array.isArray(e))return e}(n=(0,r.useState)(Math.max(2,w.length)))||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var l=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(l.push(n.value),2!==l.length);a=!0);}catch(e){o=!0,t=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw t}}return l}}(n)||function(e){if(e){if("string"==typeof e)return s(e,2);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 s(e,2)}}(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.")}(),I=C[0],_=C[1],A=Array.from({length:Math.max(0,I-w.length)}),j=w[w.length-1],S=(0,a.css)(f(),v.margin),N=(0,a.css)(m(),v.paddingLG),B=(0,a.css)(b(),v.padding,E?"hidden":"visible");return l().createElement(c.NodeDefaultView,{data:h},l().createElement("div",{className:y.nodeSubtreeClass},l().createElement("div",{className:y.branchBlockClass},w.map(function(e,n){return l().createElement(c.Branch,{key:e.id,from:h,entry:e,branchIndex:e.branchIndex,controller:l().createElement(i.Tag,{className:S},n+1)})}),A.map(function(e,n){var t;return l().createElement(c.Branch,{key:"temp_".concat(w.length+n),from:h,branchIndex:Number(null!=(t=null==j?void 0:j.branchIndex)?t:0)+n+1,controller:w.length+n>1?l().createElement("div",{className:N},l().createElement(i.Button,{"aria-label":["remove-button",null==h?void 0:h.type,null==h?void 0:h.title,w.length+n+1].filter(Boolean).join("-"),shape:"circle",icon:l().createElement(o.PlusOutlined,null),onClick:function(){return _(I-1)},disabled:E,size:"small"})):null})})),l().createElement(i.Tooltip,{title:p("Add branch")},l().createElement(i.Button,{"aria-label":["add-button",null==h?void 0:h.type,null==h?void 0:h.title,"add-branch"].filter(Boolean).join("-"),icon:l().createElement(o.PlusOutlined,null),className:B,size:"small",onClick:function(){return _(I+1)},disabled:E}))))}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default, PluginWorkflowParallelClientV2 } from './plugin';
|
|
10
|
+
export { default as ParallelInstruction } from './nodes/parallel';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-parallel/client-v2",["@emotion/css","@nocobase/client-v2","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-parallel/client-v2"]=t(require("@emotion/css"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-parallel/client-v2"]=t(e["@emotion/css"],e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,c){return function(){"use strict";var l,u,a,f={488:function(e,t,n){n.d(t,{MZ:function(){return l},kj:function(){return c}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var i="workflow-parallel";function c(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}function l(e,t){return(0,r.tExpr)(e,o({ns:[i,"client"],nsMode:"fallback"},t))}},375:function(e){e.exports=i},477:function(t){t.exports=e},485:function(e){e.exports=t},694:function(e){e.exports=c},197:function(e){e.exports=o},59:function(e){e.exports=r},155:function(e){e.exports=n}},p={};function s(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return f[e](n,n.exports,s),n.exports}s.m=f,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+".ce4a333fb5a75746.js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},b={},s.l=function(e,t,n,r){if(b[e])return void b[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var u=c[l];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-workflow-parallel/client-v2:"+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-parallel/client-v2:"+n),o.src=e),b[e]=[t];var a=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=b[e];if(delete b[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(a.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=a.bind(null,o.onerror),o.onload=a.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(d=s.g.location+"");var b,d,v=s.g.document;if(!d&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(d=v.currentScript.src),!d)){var y=v.getElementsByTagName("script");if(y.length)for(var h=y.length-1;h>-1&&(!d||!/^http(s?):/.test(d));)d=y[h--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");s.p=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),l={889:0},s.f.j=function(e,t){var n=s.o(l,e)?l[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=l[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),i=Error();s.l(o,function(t){if(s.o(l,e)&&(0!==(n=l[e])&&(l[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},u=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==l[e]})){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);c&&c(s)}for(e&&e(t);u<o.length;u++)r=o[u],s.o(l,r)&&l[r]&&l[r][0](),l[r]=0},(a=self.webpackChunk_nocobase_plugin_workflow_parallel_client_v2=self.webpackChunk_nocobase_plugin_workflow_parallel_client_v2||[]).forEach(u.bind(null,0)),a.push=u.bind(null,a.push.bind(a));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-parallel/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-parallel/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var c=window.location.pathname||"/",l=c.indexOf(i);e=l>=0?c.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-parallel/dist/client-v2/"}s.p=e}(),!function(){s.r(g),s.d(g,{ParallelInstruction:function(){return f},PluginWorkflowParallelClientV2:function(){return w},default:function(){return m}});var e=s(485),t=s(155),n=s.n(t),r=s(375),o=s(197),i=s(488);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var f=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t,u;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,u=arguments,t=l(t),c(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(t,u||[],l(this).constructor):t.apply(this,u)),"type","parallel"),c(e,"title",(0,i.MZ)("Parallel branch")),c(e,"group","control"),c(e,"description",(0,i.MZ)("Run multiple branch processes in parallel.")),c(e,"icon",n().createElement(r.ApartmentOutlined,null)),c(e,"branching",!0),c(e,"FieldsetLoader",function(){return s.e("21").then(s.bind(s,12)).then(function(e){return{default:e.ParallelFieldset}})}),c(e,"ComponentLoader",function(){return s.e("21").then(s.bind(s,12)).then(function(e){return{default:e.ParallelCanvasComponent}})}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&u(o,e),t=[{key:"createDefaultConfig",value:function(){return{mode:"all"}}}],function(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)}}(o.prototype,t),o}(o.Instruction);function p(e,t,n,r,o,i,c){try{var l=e[i](c),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function b(e,t,n){return(b=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&v(o,n.prototype),o}).apply(null,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||-1===Function.toString.call(e).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,n)}function n(){return b(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)})(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}var w=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=d(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(e,t||[],d(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&v(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(c,"next",{value:u(0)}),l(c,"throw",{value:u(1)}),l(c,"return",{value:u(2)}),"function"==typeof Symbol&&l(c,Symbol.iterator,{value:function(){return this}}),c;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(n){return null==(t=this.app.pm.get("workflow")||this.app.pm.get("@nocobase/plugin-workflow"))||null==(e=t.registerInstruction)||e.call(t,"parallel",f),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){p(i,r,o,c,l,"next",e)}function l(e){p(i,r,o,c,l,"throw",e)}c(void 0)})}).call(this)}}],function(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)}}(n.prototype,t),n}(y(e.Plugin)),m=w}(),g}()});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NAMESPACE = "workflow-parallel";
|
|
10
|
+
export declare function useT(): (key: string, options?: Record<string, unknown>) => string;
|
|
11
|
+
export declare function tExpr(key: string, options?: Record<string, unknown>): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import type { CanvasNode } from '@nocobase/plugin-workflow/client-v2';
|
|
11
|
+
type ParallelNode = CanvasNode & {
|
|
12
|
+
config?: {
|
|
13
|
+
mode?: 'all' | 'any' | 'race' | 'allSettled';
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function ParallelFieldset(): React.JSX.Element;
|
|
17
|
+
export declare function ParallelCanvasComponent({ data }: {
|
|
18
|
+
data: ParallelNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Instruction } from '@nocobase/plugin-workflow/client-v2';
|
|
11
|
+
export declare const PARALLEL_INSTRUCTION_TYPE = "parallel";
|
|
12
|
+
export default class ParallelInstruction extends Instruction {
|
|
13
|
+
type: string;
|
|
14
|
+
title: string;
|
|
15
|
+
group: string;
|
|
16
|
+
description: string;
|
|
17
|
+
icon: React.JSX.Element;
|
|
18
|
+
branching: boolean;
|
|
19
|
+
createDefaultConfig(): {
|
|
20
|
+
mode: string;
|
|
21
|
+
};
|
|
22
|
+
FieldsetLoader: () => Promise<{
|
|
23
|
+
default: typeof import("./components/parallel").ParallelFieldset;
|
|
24
|
+
}>;
|
|
25
|
+
ComponentLoader: () => Promise<{
|
|
26
|
+
default: typeof import("./components/parallel").ParallelCanvasComponent;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Application, Plugin } from '@nocobase/client-v2';
|
|
10
|
+
export declare class PluginWorkflowParallelClientV2 extends Plugin<unknown, Application> {
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export default PluginWorkflowParallelClientV2;
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
+
"@nocobase/client": "2.3.0-alpha.1",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.3.0-alpha.1",
|
|
13
|
+
"@nocobase/flow-engine": "2.3.0-alpha.1",
|
|
14
|
+
"@nocobase/client-v2": "2.3.0-alpha.1",
|
|
15
|
+
"react-i18next": "11.18.6",
|
|
16
|
+
"@nocobase/server": "2.3.0-alpha.1",
|
|
17
|
+
"@nocobase/plugin-workflow-test": "2.3.0-alpha.1",
|
|
18
|
+
"@nocobase/test": "2.3.0-alpha.1",
|
|
19
|
+
"@nocobase/utils": "2.3.0-alpha.1",
|
|
11
20
|
"react": "18.2.0",
|
|
12
|
-
"antd": "5.24.2",
|
|
13
21
|
"@ant-design/icons": "5.6.1",
|
|
14
|
-
"@
|
|
15
|
-
"
|
|
16
|
-
"react-i18next": "11.18.6",
|
|
17
|
-
"@nocobase/server": "2.2.0-beta.9",
|
|
18
|
-
"@nocobase/plugin-workflow-test": "2.2.0-beta.9",
|
|
19
|
-
"@nocobase/test": "2.2.0-beta.9",
|
|
20
|
-
"@nocobase/utils": "2.2.0-beta.9"
|
|
22
|
+
"@emotion/css": "11.13.0",
|
|
23
|
+
"antd": "5.24.2"
|
|
21
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-07-
|
|
1
|
+
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-07-16T12:58:47.537Z"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Could be used for parallel execution of branch processes in the workflow.",
|
|
7
7
|
"description.ru-RU": "Может использоваться для параллельного выполнения ветвящихся процессов в рабочем процессе.",
|
|
8
8
|
"description.zh-CN": "用于在工作流中需要并行执行的分支流程。",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.3.0-alpha.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow-parallel",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@nocobase/client": "2.x",
|
|
24
|
+
"@nocobase/client-v2": "2.x",
|
|
24
25
|
"@nocobase/database": "2.x",
|
|
25
26
|
"@nocobase/plugin-workflow": ">=0.17.0-alpha.3",
|
|
26
27
|
"@nocobase/server": "2.x",
|
|
27
28
|
"@nocobase/test": "2.x"
|
|
28
29
|
},
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "2377df8ceb12549149017f7f14a61207bf6e49a2",
|
|
30
31
|
"keywords": [
|
|
31
32
|
"Workflow"
|
|
32
33
|
]
|