@nocobase/plugin-workflow-json-variable-mapping 2.2.0-alpha.2 → 2.2.0-alpha.3
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.
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2=self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2||[]).push([["297"],{2056:function(e,r,t){t.d(r,{JSONVariableMappingFieldset:function(){return A}});var n=t(9155),a=t.n(n),o=t(7375),l=t(2059),c=t(3485),i=t(197),s=t(9488),u=t(4557),m=t.n(u),y=t(7694),p="___arr$___";function f(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}function d(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function h(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return f(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&null!==e&&!Array.isArray(e)}function k(e,r,t,n){return{key:e(),path:r,name:t,paths:n}}function v(e,r,t,n,a){var o=n.parseArray,l=n.keys,c=n.key;if(o){var i=r?"".concat(r,".").concat(c):c;c!==p&&t.push(k(a,i,c,h(l).concat([c]))),O(e,i,t,d(b({},n),{parseArray:o,keys:h(l).concat([c])}),a)}else{var s="".concat(r?r+(c===p?"":"."):"").concat(c?c===p?"[]":c+"[]":"");c!==p&&t.push(k(a,"".concat(r?r+(c===p?"":"."):"").concat(c||""),c,h(l).concat([c]))),e.forEach(function(e){var r=h(l);c&&r.push(c),c!==p&&r.push(p),Array.isArray(e)?v(e,s,t,d(b({},n),{key:p,keys:r}),a):g(e)&&O(e,s,t,d(b({},n),{keys:h(r)}),a)})}return t}function O(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{parseArray:!1,keys:[]},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:y.randomId,o=n.parseArray,l=n.keys;return Object.keys(e).forEach(function(n){var c=e[n],i=r?"".concat(r,".").concat(n):n;Array.isArray(c)?v(c,r,t,{parseArray:o,keys:l,key:n},a):g(c)?(t.push(k(a,i,n,h(l).concat([n]))),O(c,i,t,{parseArray:o,keys:h(l).concat([n])},a)):t.push(k(a,i,n,h(l).concat([n])))}),t}function A(){var e,r=l.Form.useFormInstance(),t=(0,s.kj)(),u=null!=(e=l.Form.useWatch(["config","variables"],r))?e:[],f=(0,n.useCallback)(function(){var e=r.getFieldValue(["config","example"]),t=!!r.getFieldValue(["config","parseArray"]);r.setFieldValue(["config","variables"],function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.randomId,n=[];return Array.isArray(e)?n=v(e,"",[],{parseArray:r,keys:[],key:p},t):g(e)&&(n=O(e,"",[],{parseArray:r,keys:[]},t)),m()(n,"path")}(e,t))},[r]),b=(0,n.useCallback)(function(){r.setFieldValue(["config","variables"],[])},[r]);return a().createElement(a().Fragment,null,a().createElement(l.Form.Item,{name:["config","dataSource"],label:t("JSON data source"),rules:[{required:!0}]},a().createElement(i.
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2=self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2||[]).push([["297"],{2056:function(e,r,t){t.d(r,{JSONVariableMappingFieldset:function(){return A}});var n=t(9155),a=t.n(n),o=t(7375),l=t(2059),c=t(3485),i=t(197),s=t(9488),u=t(4557),m=t.n(u),y=t(7694),p="___arr$___";function f(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}function d(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):(function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function h(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return f(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&null!==e&&!Array.isArray(e)}function k(e,r,t,n){return{key:e(),path:r,name:t,paths:n}}function v(e,r,t,n,a){var o=n.parseArray,l=n.keys,c=n.key;if(o){var i=r?"".concat(r,".").concat(c):c;c!==p&&t.push(k(a,i,c,h(l).concat([c]))),O(e,i,t,d(b({},n),{parseArray:o,keys:h(l).concat([c])}),a)}else{var s="".concat(r?r+(c===p?"":"."):"").concat(c?c===p?"[]":c+"[]":"");c!==p&&t.push(k(a,"".concat(r?r+(c===p?"":"."):"").concat(c||""),c,h(l).concat([c]))),e.forEach(function(e){var r=h(l);c&&r.push(c),c!==p&&r.push(p),Array.isArray(e)?v(e,s,t,d(b({},n),{key:p,keys:r}),a):g(e)&&O(e,s,t,d(b({},n),{keys:h(r)}),a)})}return t}function O(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{parseArray:!1,keys:[]},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:y.randomId,o=n.parseArray,l=n.keys;return Object.keys(e).forEach(function(n){var c=e[n],i=r?"".concat(r,".").concat(n):n;Array.isArray(c)?v(c,r,t,{parseArray:o,keys:l,key:n},a):g(c)?(t.push(k(a,i,n,h(l).concat([n]))),O(c,i,t,{parseArray:o,keys:h(l).concat([n])},a)):t.push(k(a,i,n,h(l).concat([n])))}),t}function A(){var e,r=l.Form.useFormInstance(),t=(0,s.kj)(),u=null!=(e=l.Form.useWatch(["config","variables"],r))?e:[],f=(0,n.useCallback)(function(){var e=r.getFieldValue(["config","example"]),t=!!r.getFieldValue(["config","parseArray"]);r.setFieldValue(["config","variables"],function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.randomId,n=[];return Array.isArray(e)?n=v(e,"",[],{parseArray:r,keys:[],key:p},t):g(e)&&(n=O(e,"",[],{parseArray:r,keys:[]},t)),m()(n,"path")}(e,t))},[r]),b=(0,n.useCallback)(function(){r.setFieldValue(["config","variables"],[])},[r]);return a().createElement(a().Fragment,null,a().createElement(l.Form.Item,{name:["config","dataSource"],label:t("JSON data source"),rules:[{required:!0}]},a().createElement(i.WorkflowVariableSelect,null)),a().createElement(l.Form.Item,{name:["config","example"],label:t("Input example")},a().createElement(c.JsonTextArea,{placeholder:t('Please input JSON example like { "key1": "item1", "key2": "item2" }'),autoSize:{minRows:5,maxRows:10}})),a().createElement(l.Form.Item,{name:["config","parseArray"],valuePropName:"checked",extra:t('If the JSON object contains array items, parse them. eg: { "arrayKey": [ "item1", "item2" ] will be parsed as "arrayKey", "arrayKey.0", "arrayKey.1", if set to false, only "arrayKey" will be parsed.')},a().createElement(l.Checkbox,null,t("Include array index in path"))),a().createElement(l.Form.Item,{extra:t("Please update other node references to the key after clicking the parse button.")},a().createElement(l.Space,null,a().createElement(l.Button,{size:"small",onClick:f},t("Parse")),a().createElement(l.Popconfirm,{title:t("Delete items"),description:t("Are you sure to clear below items?"),onConfirm:b},a().createElement(l.Button,{size:"small",disabled:0===u.length},t("Clear below items"))))),a().createElement(l.Form.List,{name:["config","variables"]},function(e,r){var n=r.remove;return a().createElement(a().Fragment,null,e.map(function(e){return a().createElement(l.Space,{key:e.key,align:"baseline"},a().createElement(l.Form.Item,{name:[e.name,"path"]},a().createElement(l.Input,{disabled:!0,placeholder:t("Key path")})),a().createElement(l.Form.Item,{name:[e.name,"alias"]},a().createElement(l.Input,{placeholder:t("Alias")})),a().createElement(l.Form.Item,null,a().createElement(l.Button,{"aria-label":t("Delete"),icon:a().createElement(o.DeleteOutlined,null),size:"small",type:"text",onClick:function(){return n(e.name)}})))}))}))}}}]);
|
package/dist/client-v2/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("@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-json-variable-mapping/client-v2",["@nocobase/client-v2","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-json-variable-mapping/client-v2"]=t(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-json-variable-mapping/client-v2"]=t(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){return function(){"use strict";var a,u,c,l={9488:function(e,t,n){n.d(t,{MZ:function(){return a},kj:function(){return u}});var r=n(7694);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-json-variable-mapping";function a(e,t){return(0,r.tExpr)(e,o({ns:[i,"client"],nsMode:"fallback"},t))}function u(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}},7375:function(e){e.exports=o},3485:function(t){t.exports=e},7694:function(e){e.exports=i},197:function(e){e.exports=r},2059:function(e){e.exports=n},9155:function(e){e.exports=t}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={id:e,loaded:!1,exports:{}};return l[e](n,n.exports,p),n.loaded=!0,n.exports}p.m=l,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({297:"fc8a3a308a9abae9",982:"6f1d883d5f07dfd9"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},p.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-workflow-json-variable-mapping/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-json-variable-mapping/client-v2:"+n),o.src=e),s[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=s[e];if(delete s[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)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},p.g.importScripts&&(b=p.g.location+"");var s,b,v=p.g.document;if(!b&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(b=v.currentScript.src),!b)){var d=v.getElementsByTagName("script");if(d.length)for(var y=d.length-1;y>-1&&(!b||!/^http(s?):/.test(b));)b=d[y--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");p.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a={889:0},p.f.j=function(e,t){var n=p.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=p.p+p.u(e),i=Error();p.l(o,function(t){if(p.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)}},u=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)p.o(i,n)&&(p.m[n]=i[n]);u&&u(p)}for(e&&e(t);c<o.length;c++)r=o[c],p.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(c=self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2=self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2||[]).forEach(u.bind(null,0)),c.push=u.bind(null,c.push.bind(c));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-json-variable-mapping/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-json-variable-mapping/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||"/",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-json-variable-mapping/dist/client-v2/"}p.p=e}(),!function(){p.r(g),p.d(g,{default:function(){return w}});var e=p(3485),t=p(9155),n=p.n(t),r=p(7375),o=p(197),i=p(9488);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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=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,c;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,c=arguments,t=u(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,l()?Reflect.construct(t,c||[],u(this).constructor):t.apply(this,c)),"title",(0,i.MZ)("JSON variable mapping")),a(e,"type","json-variable-mapping"),a(e,"group","control"),a(e,"description",(0,i.MZ)("Used for mapping any JSON data to structured variables for usage in subsequent nodes.")),a(e,"icon",n().createElement(r.SwapRightOutlined,null)),a(e,"FieldsetLoader",function(){return Promise.all([p.e("982"),p.e("297")]).then(p.bind(p,2056)).then(function(e){return{default:e.JSONVariableMappingFieldset}})}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&c(o,e),t=[{key:"createDefaultConfig",value:function(){return{parseArray:!1,variables:[]}}},{key:"useVariables",value:function(e,t){var n,r=e.key,o=e.title,i=e.config;return{value:r,label:o,children:(null!=(n=null==i?void 0:i.variables)?n:[]).map(function(e){return{isLeaf:!0,label:e.alias?e.alias:e.path,value:e.key,key:e.key}})}}}],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 s(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).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&&d(o,n.prototype),o}).apply(null,arguments)}function v(e){return(v=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 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,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(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=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(e,t||[],v(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&d(n,e),t=[{key:"load",value: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:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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}}}}(this,function(e){return this.app.pm.get("workflow").registerInstruction("json-variable-mapping",f),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"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}(y(e.Plugin))}(),g}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(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-json-variable-mapping/client-v2",["@nocobase/client-v2","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-json-variable-mapping/client-v2"]=t(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-json-variable-mapping/client-v2"]=t(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){return function(){"use strict";var a,u,c,l={9488:function(e,t,n){n.d(t,{MZ:function(){return a},kj:function(){return u}});var r=n(7694);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-json-variable-mapping";function a(e,t){return(0,r.tExpr)(e,o({ns:[i,"client"],nsMode:"fallback"},t))}function u(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}},7375:function(e){e.exports=o},3485:function(t){t.exports=e},7694:function(e){e.exports=i},197:function(e){e.exports=r},2059:function(e){e.exports=n},9155:function(e){e.exports=t}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={id:e,loaded:!1,exports:{}};return l[e](n,n.exports,p),n.loaded=!0,n.exports}p.m=l,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({297:"f32802c4e9b3d0d2",982:"6f1d883d5f07dfd9"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},p.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-workflow-json-variable-mapping/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-json-variable-mapping/client-v2:"+n),o.src=e),s[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=s[e];if(delete s[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)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},p.g.importScripts&&(b=p.g.location+"");var s,b,v=p.g.document;if(!b&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(b=v.currentScript.src),!b)){var d=v.getElementsByTagName("script");if(d.length)for(var y=d.length-1;y>-1&&(!b||!/^http(s?):/.test(b));)b=d[y--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");p.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a={889:0},p.f.j=function(e,t){var n=p.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=p.p+p.u(e),i=Error();p.l(o,function(t){if(p.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)}},u=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)p.o(i,n)&&(p.m[n]=i[n]);u&&u(p)}for(e&&e(t);c<o.length;c++)r=o[c],p.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(c=self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2=self.webpackChunk_nocobase_plugin_workflow_json_variable_mapping_client_v2||[]).forEach(u.bind(null,0)),c.push=u.bind(null,c.push.bind(c));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-json-variable-mapping/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-json-variable-mapping/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||"/",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-json-variable-mapping/dist/client-v2/"}p.p=e}(),!function(){p.r(g),p.d(g,{default:function(){return w}});var e=p(3485),t=p(9155),n=p.n(t),r=p(7375),o=p(197),i=p(9488);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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=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,c;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,c=arguments,t=u(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,l()?Reflect.construct(t,c||[],u(this).constructor):t.apply(this,c)),"title",(0,i.MZ)("JSON variable mapping")),a(e,"type","json-variable-mapping"),a(e,"group","control"),a(e,"description",(0,i.MZ)("Used for mapping any JSON data to structured variables for usage in subsequent nodes.")),a(e,"icon",n().createElement(r.SwapRightOutlined,null)),a(e,"FieldsetLoader",function(){return Promise.all([p.e("982"),p.e("297")]).then(p.bind(p,2056)).then(function(e){return{default:e.JSONVariableMappingFieldset}})}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&c(o,e),t=[{key:"createDefaultConfig",value:function(){return{parseArray:!1,variables:[]}}},{key:"useVariables",value:function(e,t){var n,r=e.key,o=e.title,i=e.config;return{value:r,label:o,children:(null!=(n=null==i?void 0:i.variables)?n:[]).map(function(e){return{isLeaf:!0,label:e.alias?e.alias:e.path,value:e.key,key:e.key}})}}}],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 s(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).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&&d(o,n.prototype),o}).apply(null,arguments)}function v(e){return(v=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 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,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(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=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(e,t||[],v(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&d(n,e),t=[{key:"load",value: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:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=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}}}}(this,function(e){return this.app.pm.get("workflow").registerInstruction("json-variable-mapping",f),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"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}(y(e.Plugin))}(),g}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -11,14 +11,14 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"antd": "5.24.2",
|
|
13
13
|
"@ant-design/icons": "5.6.1",
|
|
14
|
-
"@nocobase/plugin-workflow": "2.2.0-alpha.
|
|
14
|
+
"@nocobase/plugin-workflow": "2.2.0-alpha.3",
|
|
15
15
|
"lodash": "4.18.1",
|
|
16
16
|
"@formily/shared": "2.3.7",
|
|
17
17
|
"@formily/core": "2.3.7",
|
|
18
18
|
"@formily/react": "2.3.7",
|
|
19
|
-
"@nocobase/client": "2.2.0-alpha.
|
|
20
|
-
"@nocobase/flow-engine": "2.2.0-alpha.
|
|
21
|
-
"@nocobase/client-v2": "2.2.0-alpha.
|
|
19
|
+
"@nocobase/client": "2.2.0-alpha.3",
|
|
20
|
+
"@nocobase/flow-engine": "2.2.0-alpha.3",
|
|
21
|
+
"@nocobase/client-v2": "2.2.0-alpha.3",
|
|
22
22
|
"react-i18next": "11.18.6",
|
|
23
|
-
"@nocobase/server": "2.2.0-alpha.
|
|
23
|
+
"@nocobase/server": "2.2.0-alpha.3"
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-workflow-json-variable-mapping",
|
|
3
|
-
"version": "2.2.0-alpha.
|
|
3
|
+
"version": "2.2.0-alpha.3",
|
|
4
4
|
"displayName": "Workflow: JSON variable mapping",
|
|
5
5
|
"displayName.zh-CN": "工作流:JSON 变量映射",
|
|
6
6
|
"description": "Used for mapping any JSON data to structured variables for usage in subsequent nodes.",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"Workflow"
|
|
19
19
|
],
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "e3ec19361fd7981af9fe2a7f24ad335025cbefcd"
|
|
22
22
|
}
|