@nocobase/plugin-workflow-variable 2.2.0-beta.9 → 3.0.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/Instruction.d.ts +2 -63
- package/dist/client/index.d.ts +8 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/VariableInstruction.d.ts +33 -0
- package/dist/client-v2/index.d.ts +11 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +11 -0
- package/dist/client-v2/plugin.d.ts +12 -0
- package/dist/externalVersion.js +6 -3
- 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');
|
|
@@ -6,67 +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
|
-
|
|
10
|
-
|
|
11
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
12
|
-
* Authors: NocoBase Team.
|
|
13
|
-
*
|
|
14
|
-
* This program is offered under a commercial license.
|
|
15
|
-
* For more information, see <https://www.nocobase.com/agreement>
|
|
16
|
-
*/
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { Instruction, WorkflowVariableInput } from '@nocobase/plugin-workflow/client';
|
|
19
|
-
import { useCollectionDataSource } from '@nocobase/client';
|
|
20
|
-
declare function VariableTargetSelect({ value, onChange }: {
|
|
21
|
-
value: any;
|
|
22
|
-
onChange: any;
|
|
23
|
-
}): React.JSX.Element;
|
|
24
|
-
export default class extends Instruction {
|
|
25
|
-
title: string;
|
|
26
|
-
type: string;
|
|
27
|
-
group: string;
|
|
28
|
-
description: string;
|
|
29
|
-
icon: React.JSX.Element;
|
|
30
|
-
fieldset: {
|
|
31
|
-
target: {
|
|
32
|
-
type: string;
|
|
33
|
-
title: string;
|
|
34
|
-
'x-decorator': string;
|
|
35
|
-
'x-component': string;
|
|
36
|
-
};
|
|
37
|
-
value: {
|
|
38
|
-
type: string;
|
|
39
|
-
title: string;
|
|
40
|
-
'x-decorator': string;
|
|
41
|
-
'x-component': string;
|
|
42
|
-
'x-component-props': {
|
|
43
|
-
useTypedConstant: boolean;
|
|
44
|
-
changeOnSelect: boolean;
|
|
45
|
-
};
|
|
46
|
-
default: string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
scope: {
|
|
50
|
-
useCollectionDataSource: typeof useCollectionDataSource;
|
|
51
|
-
};
|
|
52
|
-
components: {
|
|
53
|
-
WorkflowVariableInput: typeof WorkflowVariableInput;
|
|
54
|
-
VariableTargetSelect: typeof VariableTargetSelect;
|
|
55
|
-
};
|
|
56
|
-
useVariables({ key, title, config }: {
|
|
57
|
-
key: any;
|
|
58
|
-
title: any;
|
|
59
|
-
config: any;
|
|
60
|
-
}, { types, fieldNames }: {
|
|
61
|
-
types: any;
|
|
62
|
-
fieldNames?: {
|
|
63
|
-
readonly label: "label";
|
|
64
|
-
readonly value: "value";
|
|
65
|
-
readonly children: "children";
|
|
66
|
-
};
|
|
67
|
-
}): {
|
|
68
|
-
value: any;
|
|
69
|
-
label: any;
|
|
70
|
-
};
|
|
9
|
+
import VariableInstructionV2 from '../client-v2/VariableInstruction';
|
|
10
|
+
export default class VariableInstruction extends VariableInstructionV2 {
|
|
71
11
|
}
|
|
72
|
-
export {};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,3 +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
|
+
*/
|
|
1
9
|
/**
|
|
2
10
|
* This file is part of the NocoBase (R) project.
|
|
3
11
|
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
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("@nocobase/plugin-workflow/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-variable",["react","antd","@nocobase/client","@nocobase/plugin-workflow/client"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-variable"]=t(require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client")):e["@nocobase/plugin-workflow-variable"]=t(e.react,e.antd,e["@nocobase/client"],e["@nocobase/plugin-workflow/client"])}(self,function(e,t,r,n){return function(){"use strict";var o={342:function(e){e.exports=r},990:function(e){e.exports=n},59:function(e){e.exports=t},155:function(t){t.exports=e}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(c=a.g.location+"");var c,l=a.g.document;if(!c&&l&&(l.currentScript&&"SCRIPT"===l.currentScript.tagName.toUpperCase()&&(c=l.currentScript.src),!c)){var u=l.getElementsByTagName("script");if(u.length)for(var f=u.length-1;f>-1&&(!c||!/^http(s?):/.test(c));)c=u[f--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");a.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var s={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var r=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");r.indexOf("/static/plugins/@nocobase/plugin-workflow-variable/dist/client/")>=0&&(e=r.replace(/\/[^\/]+$/,"/"))}if(!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-workflow-variable/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 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-variable/dist/client/"}a.p=e}(),!function(){a.r(s),a.d(s,{default:function(){return x},PluginWorkflowCustomVariableClient:function(){return k}});var e=a(342),t=a(155),r=a.n(t),n=a(59),o=a(990),i="@nocobase/plugin-workflow-variable";function c(t){var r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.i18n.t(t,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o),n=n={ns:i},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){return(u=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 b(){var e,t,r=(e=["\n color: ",";\n\n &:before {\n content: '#';\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return b=function(){return r},r}var y=(0,e.createStyles)(function(e){var t=e.css,r=e.token;return{nodeIdClass:t(b(),r.colorTextDescription)}});function v(i){var a=i.value,l=i.onChange,u=null==a,f=(0,o.useNodeContext)(),s=(0,o.useAvailableUpstreams)(f,function(e){return"variable"===e.type&&!e.config.target});y().styles;var p=(0,t.useCallback)(function(e){if(e.target.value)return l(null);s.length&&l(s[0].key)},[l,s]),b=(0,t.useCallback)(function(e,t){return t.label.toLowerCase().indexOf(e.toLowerCase())>=0||"#".concat(t.data.id).indexOf(e)>=0},[]);return r().createElement("fieldset",null,r().createElement(n.Radio.Group,{value:u,onChange:p},r().createElement(e.Space,{direction:"vertical"},r().createElement(n.Radio,{value:!0},c("Declare a new variable")),r().createElement(e.Space,null,r().createElement(n.Radio,{value:!1,disabled:!s.length},c("Assign value to an existing variable")),!u&&r().createElement(n.Select,{options:s.map(function(e){return{label:e.title,value:e.key,data:e}}),value:a,onChange:l,allowClear:!0,showSearch:!0,filterOption:b})))))}var d=function(t){var n;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function a(){var t,n,c;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");return n=a,c=arguments,n=u(n),l(t=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"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(n,c||[],u(this).constructor):n.apply(this,c)),"title",'{{t("Variable", { ns: "'.concat(i,'" })}}')),l(t,"type","variable"),l(t,"group","control"),l(t,"description",'{{t("Assign value to a variable, for later use.", { ns: "'.concat(i,'" })}}')),l(t,"icon",r().createElement("span",{className:"anticon",style:{display:"inline-block",width:"1em",textAlign:"center",fontStyle:"italic",fontFamily:"New York, Times New Roman, Times, serif"}},"x")),l(t,"fieldset",{target:{type:"string",title:'{{t("Mode", { ns: "'.concat(i,'" })}}'),"x-decorator":"FormItem","x-component":"VariableTargetSelect"},value:{type:"string",title:'{{t("Value", { ns: "'.concat(i,'" })}}'),"x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{useTypedConstant:!0,changeOnSelect:!0},default:""}}),l(t,"scope",{useCollectionDataSource:e.useCollectionDataSource}),l(t,"components",{WorkflowVariableInput:o.WorkflowVariableInput,VariableTargetSelect:v}),t}return a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&f(a,t),n=[{key:"useVariables",value:function(e,t){var r,n=e.key,i=e.title,a=e.config,c=(t.types,t.fieldNames),u=void 0===c?o.defaultFieldNames:c;return(null==a?void 0:a.target)?null:(l(r={},u.value,n),l(r,u.label,i),r)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(a.prototype,n),a}(o.Instruction);function w(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function g(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){w(i,n,o,a,c,"next",e)}function c(e){w(i,n,o,a,c,"throw",e)}a(void 0)})}}function h(e,t,r){return(h=_()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&O(o,r.prototype),o}).apply(null,arguments)}function m(e){return(m=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 j(e){var t="function"==typeof Map?new Map:void 0;return(j=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,r)}function r(){return h(e,arguments,m(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),O(r,e)})(e)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}function S(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:l(0)}),c(a,"throw",{value:l(1)}),c(a,"return",{value:l(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function l(c){return function(l){var u=[c,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var k=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(e,t){var n,o;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return n=r,o=[e,t],n=m(n),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,_()?Reflect.construct(n,o||[],m(this).constructor):n.apply(this,o))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&O(r,e),t=[{key:"beforeLoad",value:function(){return g(function(){return S(this,function(e){return[2]})})()}},{key:"load",value:function(){return g(function(){return S(this,function(e){return this.app.pm.get("workflow").registerInstruction("variable",d),[2]})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(j(e.Plugin)),x=k}(),s}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-variable",["react","antd","@nocobase/plugin-workflow/client-v2","@nocobase/client","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-variable"]=t(require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-variable"]=t(e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@nocobase/client"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var a={375:function(e){e.exports=o},342:function(e){e.exports=r},694:function(e){e.exports=i},197:function(e){e.exports=n},59:function(e){e.exports=t},155:function(t){t.exports=e}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return a[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&&(c=l.g.location+"");var c,f=l.g.document;if(!c&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(c=f.currentScript.src),!c)){var s=f.getElementsByTagName("script");if(s.length)for(var p=s.length-1;p>-1&&(!c||!/^http(s?):/.test(c));)c=s[p--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");l.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};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-variable/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-variable/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 a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-variable/dist/client/"}l.p=e}(),!function(){l.r(b),l.d(b,{default:function(){return F},PluginWorkflowCustomVariableClient:function(){return q}});var e=l(342),t=l(155),n=l.n(t),r=l(375),o=l(59),i=l(197),a=l(694);function u(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 c="workflow-variable";function f(){var e=(0,a.useFlowEngine)();return function(t,n){return e.context.t(t,u({ns:[c,"client"],nsMode:"fallback"},n))}}function s(e,t){return(0,a.tExpr)(e,u({ns:[c,"client"],nsMode:"fallback"},t))}function p(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function g(e){var r=e.value,a=e.onChange,u=e.disabled,l=f(),c=null==r,s=(0,i.useNodeContext)(),p=(0,i.useAvailableUpstreams)(s,function(e){var t;return"variable"===e.type&&!(null==(t=e.config)?void 0:t.target)}),b=(0,t.useMemo)(function(){return p.map(function(e){var t;return{label:null!=(t=e.title)?t:"#".concat(e.id),value:e.key,node:e}})},[p]),v=(0,t.useCallback)(function(e){if(e.target.value){null==a||a(null);return}p.length&&(null==a||a(p[0].key))},[a,p]),y=(0,t.useCallback)(function(e,t){var n,r=null!=(n=null==t?void 0:t.label)?n:"",o=null==t?void 0:t.node.id;return r.toLowerCase().includes(e.toLowerCase())||null!=o&&"#".concat(o).includes(e)},[]);return n().createElement("fieldset",{disabled:u},n().createElement(o.Radio.Group,{value:c,onChange:v},n().createElement(o.Space,{direction:"vertical"},n().createElement(o.Radio,{value:!0},l("Declare a new variable")),n().createElement(o.Space,null,n().createElement(o.Radio,{value:!1,disabled:u||!p.length},l("Assign value to an existing variable")),!c&&n().createElement(o.Select,{options:b,value:null!=r?r:void 0,onChange:function(e){return null==a?void 0:a(e)},allowClear:!0,showSearch:!0,filterOption:y,disabled:u||!p.length})))))}function w(){var e=f();return n().createElement(n().Fragment,null,n().createElement(o.Form.Item,{name:["config","target"],label:e("Mode"),initialValue:null},n().createElement(g,null)),n().createElement(o.Form.Item,{name:["config","value"],label:e("Value"),initialValue:""},n().createElement(i.WorkflowTypedVariableInput,null)))}function m(e){return(m=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 _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}var j=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=m(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,_()?Reflect.construct(e,n||[],m(this).constructor):e.apply(this,n))}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&O(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 o(){var e,t,i;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,i=arguments,t=y(t),v(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(t,i||[],y(this).constructor):t.apply(this,i)),"title",s("Variable")),v(e,"type","variable"),v(e,"group","control"),v(e,"description",s("Assign value to a variable, for later use.")),v(e,"icon",n().createElement(r.FunctionOutlined,null)),v(e,"FieldsetLoader",function(){var e;return(e=function(){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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}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}}}}(this,function(e){return[2,{default:w}]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,u,"next",e)}function u(e){p(i,r,o,a,u,"throw",e)}a(void 0)})})()}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&d(o,e),t=[{key:"useVariables",value:function(e){var t,n=e.key,r=e.title,o=e.config,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=a.fieldNames,l=void 0===u?i.defaultFieldNames:u;return(null==o?void 0:o.target)?null:(v(t={},l.value,n),v(t,l.label,r),t)}}],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}(i.Instruction));function k(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){k(i,r,o,a,u,"next",e)}function u(e){k(i,r,o,a,u,"throw",e)}a(void 0)})}}function P(e,t,n){return(P=T()?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 S(e){return(S=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 C(e){var t="function"==typeof Map?new Map:void 0;return(C=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 P(e,arguments,S(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E(n,e)})(e)}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}function R(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}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}}}}var q=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(e,t){var r,o;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return r=n,o=[e,t],r=S(r),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,T()?Reflect.construct(r,o||[],S(this).constructor):r.apply(this,o))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&E(n,e),t=[{key:"beforeLoad",value:function(){return x(function(){return R(this,function(e){return[2]})})()}},{key:"load",value:function(){return x(function(){var e,t;return R(this,function(n){return null==(t=this.app.pm.get("workflow"))||null==(e=t.registerInstruction)||e.call(t,"variable",j),[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)}}(n.prototype,t),n}(C(e.Plugin)),F=q}(),b}()});
|
|
@@ -0,0 +1,33 @@
|
|
|
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, type UseVariableOptions, type VariableOption } from '@nocobase/plugin-workflow/client-v2';
|
|
11
|
+
type WorkflowVariableNode = {
|
|
12
|
+
id?: string | number;
|
|
13
|
+
key: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
config?: {
|
|
17
|
+
target?: string | null;
|
|
18
|
+
};
|
|
19
|
+
upstream?: WorkflowVariableNode | null;
|
|
20
|
+
};
|
|
21
|
+
export declare function VariableFieldset(): React.JSX.Element;
|
|
22
|
+
export default class VariableInstruction extends Instruction {
|
|
23
|
+
title: string;
|
|
24
|
+
type: string;
|
|
25
|
+
group: string;
|
|
26
|
+
description: string;
|
|
27
|
+
icon: React.JSX.Element;
|
|
28
|
+
FieldsetLoader: () => Promise<{
|
|
29
|
+
default: typeof VariableFieldset;
|
|
30
|
+
}>;
|
|
31
|
+
useVariables({ key, title, config }: WorkflowVariableNode, { fieldNames }?: UseVariableOptions): VariableOption | null;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -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 { default } from './plugin';
|
|
10
|
+
export * from './plugin';
|
|
11
|
+
export { default as VariableInstruction } from './VariableInstruction';
|
|
@@ -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("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@nocobase/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-variable/client-v2",["react","antd","@nocobase/plugin-workflow/client-v2","@nocobase/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-variable/client-v2"]=t(require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@nocobase/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-variable/client-v2"]=t(e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@nocobase/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var a={375:function(e){e.exports=o},485:function(e){e.exports=r},694:function(e){e.exports=i},197:function(e){e.exports=n},59:function(e){e.exports=t},155:function(t){t.exports=e}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,u),n.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(c=u.g.location+"");var c,f=u.g.document;if(!c&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(c=f.currentScript.src),!c)){var s=f.getElementsByTagName("script");if(s.length)for(var p=s.length-1;p>-1&&(!c||!/^http(s?):/.test(c));)c=s[p--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");u.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};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-variable/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-variable/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 a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-variable/dist/client-v2/"}u.p=e}(),!function(){u.r(b),u.d(b,{VariableInstruction:function(){return m},default:function(){return E}});var e=u(485),t=u(155),n=u.n(t),r=u(375),o=u(59),i=u(197),a=u(694);function l(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 c="workflow-variable";function f(){var e=(0,a.useFlowEngine)();return function(t,n){return e.context.t(t,l({ns:[c,"client"],nsMode:"fallback"},n))}}function s(e,t){return(0,a.tExpr)(e,l({ns:[c,"client"],nsMode:"fallback"},t))}function p(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){return(d=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 h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function g(e){var r=e.value,a=e.onChange,l=e.disabled,u=f(),c=null==r,s=(0,i.useNodeContext)(),p=(0,i.useAvailableUpstreams)(s,function(e){var t;return"variable"===e.type&&!(null==(t=e.config)?void 0:t.target)}),b=(0,t.useMemo)(function(){return p.map(function(e){var t;return{label:null!=(t=e.title)?t:"#".concat(e.id),value:e.key,node:e}})},[p]),v=(0,t.useCallback)(function(e){if(e.target.value){null==a||a(null);return}p.length&&(null==a||a(p[0].key))},[a,p]),d=(0,t.useCallback)(function(e,t){var n,r=null!=(n=null==t?void 0:t.label)?n:"",o=null==t?void 0:t.node.id;return r.toLowerCase().includes(e.toLowerCase())||null!=o&&"#".concat(o).includes(e)},[]);return n().createElement("fieldset",{disabled:l},n().createElement(o.Radio.Group,{value:c,onChange:v},n().createElement(o.Space,{direction:"vertical"},n().createElement(o.Radio,{value:!0},u("Declare a new variable")),n().createElement(o.Space,null,n().createElement(o.Radio,{value:!1,disabled:l||!p.length},u("Assign value to an existing variable")),!c&&n().createElement(o.Select,{options:b,value:null!=r?r:void 0,onChange:function(e){return null==a?void 0:a(e)},allowClear:!0,showSearch:!0,filterOption:d,disabled:l||!p.length})))))}function w(){var e=f();return n().createElement(n().Fragment,null,n().createElement(o.Form.Item,{name:["config","target"],label:e("Mode"),initialValue:null},n().createElement(g,null)),n().createElement(o.Form.Item,{name:["config","value"],label:e("Value"),initialValue:""},n().createElement(i.WorkflowTypedVariableInput,null)))}var m=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,i;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,i=arguments,t=d(t),v(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(t,i||[],d(this).constructor):t.apply(this,i)),"title",s("Variable")),v(e,"type","variable"),v(e,"group","control"),v(e,"description",s("Assign value to a variable, for later use.")),v(e,"icon",n().createElement(r.FunctionOutlined,null)),v(e,"FieldsetLoader",function(){var e;return(e=function(){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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:u(0)}),l(a,"throw",{value:u(1)}),l(a,"return",{value:u(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}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}}}}(this,function(e){return[2,{default:w}]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,l,"next",e)}function l(e){p(i,r,o,a,l,"throw",e)}a(void 0)})})()}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&y(o,e),t=[{key:"useVariables",value:function(e){var t,n=e.key,r=e.title,o=e.config,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=a.fieldNames,u=void 0===l?i.defaultFieldNames:l;return(null==o?void 0:o.target)?null:(v(t={},u.value,n),v(t,u.label,r),t)}}],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}(i.Instruction);function O(e,t,n,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function _(e,t,n){return(_=S()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=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 _(e,arguments,j(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)})(e)}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}var E=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=j(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,S()?Reflect.construct(e,t||[],j(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:u(0)}),l(a,"throw",{value:u(1)}),l(a,"return",{value:u(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}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}}}}(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,"variable",m),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){O(i,r,o,a,l,"next",e)}function l(e){O(i,r,o,a,l,"throw",e)}a(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}(x(e.Plugin))}(),b}()});
|
|
@@ -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-variable";
|
|
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,12 @@
|
|
|
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 default class PluginWorkflowVariableClientV2 extends Plugin<unknown, Application> {
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
}
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
+
"@nocobase/client": "3.0.0-alpha.1",
|
|
11
12
|
"react": "18.2.0",
|
|
13
|
+
"@ant-design/icons": "5.6.1",
|
|
12
14
|
"antd": "5.24.2",
|
|
13
|
-
"@nocobase/plugin-workflow": "
|
|
14
|
-
"@nocobase/
|
|
15
|
-
"@nocobase/
|
|
15
|
+
"@nocobase/plugin-workflow": "3.0.0-alpha.1",
|
|
16
|
+
"@nocobase/flow-engine": "3.0.0-alpha.1",
|
|
17
|
+
"@nocobase/client-v2": "3.0.0-alpha.1",
|
|
18
|
+
"@nocobase/server": "3.0.0-alpha.1"
|
|
16
19
|
};
|
|
@@ -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-30T03:57:15.810Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-workflow-variable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"displayName": "Workflow: Custom variable",
|
|
5
5
|
"displayName.zh-CN": "工作流:自定义变量节点",
|
|
6
6
|
"description": "Used for creating custom variables or assigning value to it in workflows, to save temporary data in the process.",
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@nocobase/client": "2.x",
|
|
26
|
+
"@nocobase/client-v2": "2.x",
|
|
26
27
|
"@nocobase/plugin-workflow": ">=0.18.0-alpha.2",
|
|
27
28
|
"@nocobase/server": "2.x",
|
|
28
29
|
"@nocobase/test": "2.x",
|
|
29
30
|
"@nocobase/utils": "2.x"
|
|
30
31
|
},
|
|
31
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "22d8be8ece179cfa5c8a4ebb2c896c92bd418e03",
|
|
32
33
|
"license": "Apache-2.0"
|
|
33
34
|
}
|