@nocobase/plugin-workflow-cc 2.2.0-alpha.7 → 2.2.0-beta.10

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.
Files changed (46) hide show
  1. package/dist/{client-v2 → client}/flow/RemoteFlowModelRenderer.d.ts +5 -5
  2. package/dist/client/index.js +1 -1
  3. package/dist/client/instruction/SchemaConfig.d.ts +17 -0
  4. package/dist/client/instruction/index.d.ts +128 -2
  5. package/dist/{client-v2 → client}/models/CCBlockGridModel.d.ts +1 -2
  6. package/dist/{client-v2/nodes/components/cc.d.ts → client/models/CCChildPageModel.d.ts} +4 -3
  7. package/dist/{client-v2/models/registerModelLoaders.d.ts → client/models/CCChildPageTabModel.d.ts} +5 -2
  8. package/dist/{client-v2 → client}/models/CCTaskCardDetailsAssociationFieldGroupModel.d.ts +2 -3
  9. package/dist/{client-v2 → client}/models/CCTaskCardDetailsItemModel.d.ts +10 -16
  10. package/dist/{client-v2 → client}/models/CCTaskCardDetailsModel.d.ts +9 -6
  11. package/dist/{client-v2 → client}/models/CCTaskCardGridModel.d.ts +4 -2
  12. package/dist/{client-v2 → client}/models/CCTriggerBlockGridModel.d.ts +1 -2
  13. package/dist/externalVersion.js +12 -12
  14. package/dist/locale/en-US.json +0 -6
  15. package/dist/locale/zh-CN.json +0 -4
  16. package/package.json +3 -8
  17. package/client-v2.d.ts +0 -2
  18. package/client-v2.js +0 -3
  19. package/dist/client/164.feee9c6f7d571d46.js +0 -10
  20. package/dist/client/208.4406c513173afef7.js +0 -10
  21. package/dist/client/352.4012efde85e3acaf.js +0 -10
  22. package/dist/client/437.78f2b52a4a3fac84.js +0 -10
  23. package/dist/client/458.da07eac3bc1412d1.js +0 -10
  24. package/dist/client/486.5966b38a176b8313.js +0 -10
  25. package/dist/client/746.9362358210d85302.js +0 -10
  26. package/dist/client/86.e6c4759f3e699b2d.js +0 -10
  27. package/dist/client-v2/164.e2c25964de2486b9.js +0 -10
  28. package/dist/client-v2/352.a8dbaca3691905cb.js +0 -10
  29. package/dist/client-v2/437.cbf01251aba7d74f.js +0 -10
  30. package/dist/client-v2/458.51f1362d12aefe62.js +0 -10
  31. package/dist/client-v2/486.d0a505ec5bea795c.js +0 -10
  32. package/dist/client-v2/679.bcd3a82a92a57455.js +0 -10
  33. package/dist/client-v2/746.b0fb6ac7c4f7e83b.js +0 -10
  34. package/dist/client-v2/86.f7881bb89e51a4b6.js +0 -10
  35. package/dist/client-v2/components/FlowModelConfigInput.d.ts +0 -20
  36. package/dist/client-v2/hooks/useTempAssociationSources.d.ts +0 -11
  37. package/dist/client-v2/index.d.ts +0 -10
  38. package/dist/client-v2/index.js +0 -10
  39. package/dist/client-v2/locale.d.ts +0 -12
  40. package/dist/client-v2/models/CCChildPageModel.d.ts +0 -23
  41. package/dist/client-v2/nodes/cc.d.ts +0 -21
  42. package/dist/client-v2/nodes/components/RecipientsInput.d.ts +0 -19
  43. package/dist/client-v2/plugin.d.ts +0 -16
  44. package/dist/client-v2/tasks.d.ts +0 -15
  45. package/dist/client-v2/utils/registerWorkflowCcCollections.d.ts +0 -10
  46. package/dist/client-v2/workflowPluginCompat.d.ts +0 -41
@@ -1,10 +0,0 @@
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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["458"],{401:function(e,t,n){n.r(t),n.d(t,{CCChildPageModel:function(){return _},CCChildPageTabModel:function(){return O}});var r=n(485),o=n(694),l=n(625),i=n(155),u=n.n(i),c=n(813);function a(e,t,n,r,o,l,i){try{var u=e[l](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function s(e,t,n){return t=v(t),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}(e,g()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function b(e,t,n){return(b="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function k(e){return{async:!0,parentId:e,subType:"object",subKey:"grid",use:"CCBlockGridModel"}}function C(e,t){var n,r;(null==(r=e.view)||null==(n=r.inputArgs)?void 0:n.workflowCcConfigDialog)&&t.context.defineProperty("disableBlockGridPadding",{get:function(){return!0},cache:!1})}function w(e,t){var n,r,o,l=e.model;return(null==(n=l.subModels)?void 0:n.grid)!==t&&(null==(o=l.setSubModel)||o.call(l,"grid",t)),(null==(r=t.parent)?void 0:r.uid)!==l.uid&&t.context.addDelegate(e),C(e,t),t}function m(e){var t,n,i,s=e.ctx,f=e.options,d=(0,o.useFlowEngine)(),p=(0,l.useRequest)(function(){var e;return(e=function(){var e,t,n,r,o,l,i;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var a=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(l=0)),l;)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 l.label++,{value:a[1],done:!1};case 5:l.label++,r=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(e,l)}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(u){switch(u.label){case 0:var a,p,b;if(Array.isArray(b=null==(a=o=null==(e=s.model.subModels)?void 0:e.grid)||null==(p=a.subModels)?void 0:p.items)&&b.length>0)return C(s,o),[2,o];return(0,c.W)(d),[4,null==(t=d.getModelClassAsync)?void 0:t.call(d,"CCBlockGridModel")];case 1:return u.sent(),[4,null==(n=d.loadModel)?void 0:n.call(d,{parentId:f.parentId,refresh:!0,subKey:f.subKey})];case 2:if(null==(l=u.sent())?void 0:l.uid)return[2,w(s,l)];if(null==o?void 0:o.uid)return C(s,o),[2,o];return[4,null==(r=d.loadOrCreateModel)?void 0:r.call(d,f,{skipSave:!0})];case 3:return[2,(null==(i=u.sent())?void 0:i.uid)?w(s,i):null]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function i(e){a(l,r,o,i,u,"next",e)}function u(e){a(l,r,o,i,u,"throw",e)}i(void 0)})})()},{refreshDeps:[s.model.uid,null==(n=s.model.subModels)||null==(t=n.grid)?void 0:t.uid,d]}),b=p.data,v=p.loading,y=(null==s?void 0:s.isMobileLayout)?8:null==s||null==(i=s.themeToken)?void 0:i.marginBlock;return!v&&(null==b?void 0:b.uid)?u().createElement(o.FlowModelRenderer,{model:b,fallback:u().createElement(r.SkeletonFallback,{style:{margin:y}})}):u().createElement(r.SkeletonFallback,{style:{margin:y}})}var _=function(e){function t(){return f(this,t),s(this,t,arguments)}return y(t,e),p(t,[{key:"onInit",value:function(e){b(v(t.prototype),"onInit",this).call(this,e),this.context.defineMethod("aclCheck",function(){return!0}),this.context.defineProperty("disableFieldClickToOpen",{get:function(){return!0}})}},{key:"setCollectionCtx",value:function(e){var t=this,n=e.dataSourceKey,r=e.collectionName;this.context.defineProperty("collection",{get:function(){return t.context.dataSourceManager.getCollection(n,r)},cache:!1})}},{key:"renderFirstTab",value:function(){var e=this.getFirstTab();return(null==e?void 0:e.uid)?u().createElement(m,{ctx:e.context,options:k(e.uid)}):null}}]),t}(r.ChildPageModel);_.define({hide:!0}),_.registerFlow({key:"CCChildPageSettings",steps:{init:{handler:function(e,t){e.model.setCollectionCtx(t)}}}});var O=function(e){function t(){return f(this,t),s(this,t,arguments)}return y(t,e),p(t,[{key:"renderChildren",value:function(){return u().createElement(m,{ctx:this.context,options:k(this.uid)})}}]),t}(r.ChildPageTabModel);t.default=_}}]);
@@ -1,10 +0,0 @@
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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["486"],{429:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsAssociationFieldGroupModel:function(){return y}});var o,r=n(485),i=n(694),l=n(488);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function c(e){return(c=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 f(e){return function(e){if(Array.isArray(e))return a(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 a(e,void 0);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 a(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 s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var d=["job","execution","user","node.*","job.*","workflow.*","execution.*"],p=["workflow.title","node.title"],b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.blacklist,o=t.whitelist,r=function(t){return!!t.includes(e)||t.some(function(t){if(t.endsWith("*")){var n=t.slice(0,-1);return e.startsWith(n)}return!1})};return!r(f(p).concat(f(void 0===o?[]:o)))&&!!r(f(d).concat(f(void 0===n?[]:n)))},y=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=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,s()?Reflect.construct(e,t||[],c(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&u(n,e),t=[{key:"defineChildren",value:function(e){var t=this.itemModelName;return function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n.getToOneAssociationFields().map(function(n){var r=o?"".concat(o,".").concat(n.name):n.name;return b(r)||!n.targetCollection?null:{key:"".concat(r,"-assocationField"),label:n.title,children:function(){return[{key:"".concat(r,"-children-collectionField"),label:"Display fields",type:"group",children:n.targetCollection.getFields().map(function(n){var o="".concat(r,".").concat(n.name),l=i.DisplayItemModel.getDefaultBindingByField(e,n,{fallbackToTargetTitleField:!0});return!l||n.target||b(o)?null:{key:"c-".concat(r,".").concat(n.name),label:n.title,useModel:t,toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===o},createModelOptions:{stepParams:{fieldSettings:{init:{dataSourceKey:e.collection.dataSourceKey,collectionName:e.collection.name,fieldPath:o,associationPathName:r}}},subModels:{field:{use:l.modelName}}}}}).filter(Boolean)}].filter(function(e){return e.children.length>0})}}}).filter(Boolean)}(e.collection)}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n,t),n}(r.DetailsAssociationFieldGroupModel);(o="itemModelName")in y?Object.defineProperty(y,o,{value:"CCTaskCardDetailsItemModel",enumerable:!0,configurable:!0,writable:!0}):y[o]="CCTaskCardDetailsItemModel",y.define({label:(0,l.MZ)("Other information",{ns:l.CU})}),t.default=y}}]);
@@ -1,10 +0,0 @@
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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["679"],{628:function(e,t,n){n.r(t),n.d(t,{CCTaskCardDetailsItemModel:function(){return S},getEligibleTempAssociationSources:function(){return C},updateWorkflowCcTaskAssociationFields:function(){return k}});var r=n(485),o=n(197),i=n(694),l=n(170),a=n(488);function u(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 c(e,t,n){return t=m(t),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}(e,v()?Reflect.construct(t,n||[],m(e).constructor):t.apply(e,n))}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function p(e,t,n){return(p="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}})(e,t,n||e)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var h=["node","job","workflow","execution","user"],w=function(e){function t(){return s(this,t),c(this,t,arguments)}return y(t,e),f(t,[{key:"targetCollection",get:function(){return this.options.target&&this.flowEngine.dataSourceManager.getCollection(this.options.dataSourceKey,this.options.target)}}]),t}(i.CollectionField),C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=new Map;return e.forEach(function(e){var r,i=(0,l.P)(e.nodeType,e.nodeKey);if(!(n.has(i)||(null==t?void 0:t.getField(i)))){var a=function(e){if(Array.isArray(e))return e}(r=(0,o.parseCollectionName)(e.collection))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw n}}return o}}(r)||g(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=a[0],c=a[1];c&&n.set(i,{dataSourceKey:u||"main",fieldName:i,nodeId:e.nodeId,nodeKey:e.nodeKey,nodeType:e.nodeType,target:c,title:e.nodeKey})}}),Array.from(n.values())},k=function(e){var t=e.flowEngine,n=e.nodes,r=e.tempAssociationSources,o=e.workflow;if(t){var i=t.dataSourceManager.getCollection("main","workflowCcTasks");if(i){var l=C(r||[],i);l.length&&l.map(function(e){var t,r,i,l,a=null==(l=[o].concat(function(e){if(Array.isArray(e))return u(e)}(i=n||[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||g(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).find(function(t){return(null==t?void 0:t.id)===e.nodeId}))?void 0:l.title;return t=function(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}({},e),r=r={title:a||e.nodeKey},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t}).forEach(function(e){i.addField(new w({type:"belongsTo",name:e.fieldName,dataSourceKey:e.dataSourceKey,target:e.target,interface:"m2o",isAssociation:!0,uiSchema:{title:e.title||e.target}}))})}}},S=function(e){function t(){return s(this,t),c(this,t,arguments)}return y(t,e),f(t,[{key:"onInit",value:function(e){var n=this;p(m(t.prototype),"onInit",this).call(this,e),this.context.defineProperty("collectionField",{get:function(){var e=n.getFieldSettingsInitParams(),t=n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath));return!t&&n.context.workflow?(k({flowEngine:n.flowEngine,workflow:n.context.workflow,nodes:n.context.nodes,tempAssociationSources:n.context.tempAssociationSources}),n.context.dataSourceManager.getCollectionField("".concat(e.dataSourceKey,".").concat(e.collectionName,".").concat(e.fieldPath))):t},cache:!1})}}],[{key:"defineChildren",value:function(e){var t=this,n=e.collection;return n.getFields().map(function(r){var o=t.getDefaultBindingByField(e,r,{fallbackToTargetTitleField:!0});if(!o||h.includes(r.name)||r.name.startsWith(l.G))return null;var i=e.prefixFieldPath?"".concat(e.prefixFieldPath,".").concat(r.name):r.name;return{key:i,label:r.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:function(e){var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===i},useModel:"CCTaskCardDetailsItemModel",createModelOptions:function(){var t,l,a;return{use:"CCTaskCardDetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:n.dataSourceKey,collectionName:null!=(t=null==(a=e.model.context.blockModel)||null==(l=a.collection)?void 0:l.name)?t:n.name,fieldPath:i}}},subModels:{field:{use:o.modelName,props:"function"==typeof o.defaultProps?o.defaultProps(e,r):o.defaultProps}}}}}}).filter(Boolean)}}]),t}(r.DetailsItemModel);S.define({label:(0,a.MZ)("CC information",{ns:a.CU}),sort:100}),t.default=S},482:function(e,t,n){n.d(t,{CCFieldset:function(){return Z}});var r=n(197),o=n(59),i=n(155),l=n.n(i),a=n(375),u=n(694),c=n(625),s=n(325),d=n(488),f=n(813),p=n(628),m=n(92);function y(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 b(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){b(i,r,o,l,a,"next",e)}function a(e){b(i,r,o,l,a,"throw",e)}l(void 0)})}}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 h(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){v(e,t,n[t])})}return e}function w(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||S(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function S(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}function M(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=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 O=["ccUid","taskCardUid"],E=["tempAssociationFields"],P=new Map,j=new WeakMap,T=new WeakMap,x=new WeakMap;function F(e){var t=j.get(e);return!!(t&&Array.from(t.values()).some(function(e){return e>0}))}function A(e){var t=e.form,n=e.message,r=e.nodeId,o=e.pending;if(null!=r){if(!T.has(t)){var i=t.validateFields.bind(t);T.set(t,t.validateFields),t.validateFields=function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];return g(function(){return M(this,function(e){return F(t)?[2,Promise.reject({values:t.getFieldsValue(!0),errorFields:[{name:["config"],errors:[n]}],outOfDate:!1})]:[2,i.apply(void 0,function(e){if(Array.isArray(e))return y(e)}(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||S(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())]})})()}}if(!x.has(t)){var l=t.submit.bind(t);x.set(t,t.submit),t.submit=function(){return F(t)?void t.validateFields().catch(function(){}):l()}}var a=j.get(t);a||(a=new Map,j.set(t,a));var u=a.get(r)||0,c=o?u+1:Math.max(0,u-1);c?a.set(r,c):a.delete(r)}}function I(){return{async:!0,subType:"object",use:"CCBlockGridModel"}}function _(){return{use:"CCChildPageTabModel",stepParams:{pageTabSettings:{tab:{title:'{{t("Details")}}'}}},subModels:{grid:I()}}}function D(e){var t,n=e.disabled,a=e.form,d=e.kind,y=e.node,b=e.nodes,v=e.onGeneratedUidChange,S=e.onModelReady,O=e.onNodeConfigPatch,E=e.uid,P=e.uidPrefix,j=e.upstreams,T=e.workflow,x=(0,u.useFlowEngine)(),F=o.theme.useToken().token,A=(0,c.useMemoizedFn)(function(e){var t,n,o,i;return"interface"===d?(o=(n=C(function(e){if(!e)return["main","users"];var t=(0,r.parseCollectionName)(e);return(null==t?void 0:t[0])&&(null==t?void 0:t[1])?t:["main",e]}(null==T||null==(t=T.config)?void 0:t.collection),2))[0],i=n[1],{async:!0,subType:"object",uid:e,use:"CCChildPageModel",props:{displayTitle:!1,enableTabs:!1,title:'{{t("User interface", { ns: "@nocobase/plugin-workflow-cc" })}}'},subModels:{tabs:[_()]},stepParams:{pageSettings:{general:{displayTitle:!1,enableTabs:!1,title:'{{t("User interface", { ns: "@nocobase/plugin-workflow-cc" })}}'}},CCChildPageSettings:{init:{collectionName:i,dataSourceKey:o}}}}):{async:!0,subType:"object",uid:e,use:"CCTaskCardDetailsModel",stepParams:{resourceSettings:{init:{dataSourceKey:"main",collectionName:"workflowCcTasks"}},detailsSettings:{layout:{layout:"horizontal"}}},subModels:{grid:{subType:"object",use:"CCTaskCardGridModel"}}}}),D=(0,s.V)(T,j||[]),U=(0,i.useMemo)(function(){return D.map(function(e){return"".concat(e.nodeType,":").concat(e.nodeKey)}).join("|")},[D]),B=(0,c.useMemoizedFn)(function(e){var t=y.config||{};if(!n&&t.tempAssociationFields!==e){y.config=w(h({},t),{tempAssociationFields:e});var r=t&&(void 0===t?"undefined":k(t))==="object"?a.getFieldValue(["config"]):void 0;a.setFieldsValue({config:w(h({},r&&(void 0===r?"undefined":k(r))==="object"?r:{}),{tempAssociationFields:e})}),O({tempAssociationFields:e}).catch(function(){})}}),K=(0,c.useRequest)(function(){return g(function(){var e;return M(this,function(t){var r,o;switch(t.label){case 0:return t.trys.push([0,,7,8]),(0,f.W)(x),(0,m.o)(x),[4,function(e){return g(function(e){var t,n,r,o,i,l,a,c,s,d,f;return M(this,function(p){var m,y;switch(p.label){case 0:return t=e.canRegenerateUid,n=e.createModelOptions,r=e.flowEngine,o=e.onGeneratedUidChange,i=e.uid,l=e.uidPrefix,s="string"==typeof(m=c=n(i)).use?m.use:null==(y=m.use)?void 0:y.name,[4,r.loadOrCreateModel(c)];case 1:if(!(null==(d=p.sent())?void 0:d.uid)||!s||(null==d?void 0:d.use)===s||!t)return[2,d];return null==(a=r.removeModelWithSubModels)||a.call(r,d.uid),f=(0,u.randomId)(l),[4,null==o?void 0:o(f)];case 2:if(!1===p.sent())return[2,null];return[4,r.loadOrCreateModel(n(f))];case 3:return[2,p.sent()]}})}).apply(this,arguments)}({canRegenerateUid:!!v,createModelOptions:A,flowEngine:x,onGeneratedUidChange:v,uid:E,uidPrefix:P})];case 1:if(!(e=t.sent()))return[2,null];if("interface"!==d)return[3,3];return[4,(r=e,g(function(){var e,t,n,o,i,l,a,u,c,s,d;return M(this,function(f){switch(f.label){case 0:var p,m,y,b;if(o=!1,(null==(i=null==(t=(n=r).subModels)||null==(e=t.tabs)?void 0:e[0])?void 0:i.uid)||!n.addSubModel||(i=n.addSubModel("tabs",_()),o=!0),!(null==i?void 0:i.uid)||Array.isArray(y=null==(p=a=null==(l=i.subModels)?void 0:l.grid)||null==(m=p.subModels)?void 0:m.items)&&y.length>0)return[3,5];return[4,(b=i.uid,g(function(){var e,t;return M(this,function(n){switch(n.label){case 0:return[4,null==(e=x.getModelClassAsync)?void 0:e.call(x,"CCBlockGridModel")];case 1:return n.sent(),[4,null==(t=x.loadModel)?void 0:t.call(x,{parentId:b,refresh:!0,subKey:"grid"})];case 2:return[2,n.sent()]}})})())];case 1:if(!(null==(u=f.sent())?void 0:u.uid))return[3,2];return null==(c=i.setSubModel)||c.call(i,"grid",u),[3,5];case 2:if(!(null==a?void 0:a.uid))return[3,4];return[4,null==(s=a.save)?void 0:s.call(a)];case 3:return f.sent(),[3,5];case 4:(null==a?void 0:a.uid)||!i.setSubModel?(null==a?void 0:a.uid)||!i.addSubModel||(i.addSubModel("grid",I()),o=!0):(i.setSubModel("grid",I()),o=!0),f.label=5;case 5:if(!o)return[3,7];return[4,null==(d=n.save)?void 0:d.call(n)];case 6:f.sent(),f.label=7;case 7:return[2]}})})())];case 2:return t.sent(),[3,6];case 3:return[4,(o=e,g(function(){var e,t,n;return M(this,function(r){switch(r.label){case 0:if((null==(e=(n=o).subModels)?void 0:e.grid)||!n.addSubModel)return[2];return n.addSubModel("grid",{subType:"object",use:"CCTaskCardGridModel"}),[4,null==(t=n.save)?void 0:t.call(n)];case 1:return r.sent(),[2]}})})())];case 4:return t.sent(),[4,g(function(){var e,t,n,r,o,i;return M(this,function(l){switch(l.label){case 0:return o=["CCTaskCardDetailsItemModel","CCTaskCardDetailsAssociationFieldGroupModel","TaskCardCommonItemModel"],((null==(i=null==(t=x.context)||null==(e=t.app)?void 0:e.pm)||null==(n=i.get)?void 0:n.call(i,"ui-templates"))||(null==i||null==(r=i.get)?void 0:r.call(i,"@nocobase/plugin-ui-templates")))&&o.push("SubModelTemplateImporterModel"),[4,Promise.all(o.map(function(e){var t;return null==(t=x.getModelClassAsync)?void 0:t.call(x,e)}))];case 1:return l.sent(),[2]}})})()];case 5:t.sent(),(0,p.updateWorkflowCcTaskAssociationFields)({flowEngine:x,workflow:T,nodes:j,tempAssociationSources:D}),t.label=6;case 6:return e.context.defineProperty("flowSettingsEnabled",{get:function(){return!n},cache:!1}),e.context.defineProperty("view",{value:{inputArgs:{flowContext:{workflow:T,nodes:(null==b?void 0:b.length)?b:[y]},availableUpstreams:j||[],node:y,nodeConfig:(null==y?void 0:y.config)||{},workflowCcConfigDialog:!0}}}),e.context.defineProperty("workflow",{get:function(){return T},cache:!1}),e.context.defineProperty("nodes",{get:function(){return b||[]},cache:!1}),e.context.defineProperty("tempAssociationSources",{get:function(){return D},cache:!1}),e.context.defineProperty("ccTaskTempAssociationSync",{get:function(){return B},cache:!1}),[2,e];case 7:return null==S||S(),[7];case 8:return[2]}})})()},{refreshDeps:[E,n,d,null==T||null==(t=T.config)?void 0:t.collection,null==y?void 0:y.key,null==b?void 0:b.length,U]}),G=K.data,R=K.loading;return((0,i.useEffect)(function(){"taskCard"===d&&(0,p.updateWorkflowCcTaskAssociationFields)({flowEngine:x,workflow:T,nodes:j,tempAssociationSources:D})},[x,d,D,U,j,T]),!R&&(null==G?void 0:G.uid))?l().createElement(u.FlowModelRenderer,{model:G,hideRemoveInSettings:!0,showFlowSettings:"taskCard"===d}):l().createElement(o.Spin,{style:{display:"block",margin:F.marginLG}})}var U=function(e){var t=e.configKey,n=e.disabled,s=e.kind,f=e.legacyConfigKey,p=e.onChange,m=e.value,y=(0,u.useFlowContext)(),b=(0,d.kj)(),w=o.theme.useToken().token,S=o.Form.useFormInstance(),j=(0,r.useCurrentWorkflowContext)(),T=(0,r.useNodeContext)(),x=(0,r.useFlowContext)(),F=(0,r.useAvailableUpstreams)(T),I=(0,i.useRef)(null==T?void 0:T.id),_=(0,i.useRef)(h({},(null==T?void 0:T.config)||{})),U=(0,i.useRef)(!1),B=C((0,i.useState)(!1),2),K=B[0],G=B[1],R=o.Form.useWatch(["config",f||"__workflowCcLegacyConfig__"],S),z=null!=R?R:f?S.getFieldValue(["config",f]):void 0,W="interface"===s?b("User interface"):b("Task card"),N="interface"===s?"cc_interface_":"cc_task_card_",H=b("Please wait for the workflow model configuration to finish opening.");I.current!==(null==T?void 0:T.id)&&(I.current=null==T?void 0:T.id,_.current=h({},(null==T?void 0:T.config)||{}));var V=(0,c.useMemoizedFn)(function(e){return g(function(){var t,r,o;return M(this,function(i){switch(i.label){case 0:if(null==T.id)return[2,!1];A({form:S,message:H,nodeId:t=T.id,pending:!0}),r=P.get(t),o=g(function(){var t,o;return M(this,function(i){switch(i.label){case 0:if(!r)return[3,2];return[4,r.catch(function(){return null})];case 1:return t=i.sent(),[3,3];case 2:t=null,i.label=3;case 3:return[4,function(e){return g(function(e){var t,n,r,o,i,l,a,u,c;return M(this,function(s){switch(s.label){case 0:if(t=e.baseConfig,n=e.ctx,r=e.disabled,o=e.node,i=e.patch,r||null==o.id||!(null==(u=null==(a=n.api)||null==(l=a.resource)?void 0:l.call(a,"flow_nodes"))?void 0:u.update))return[2,null];return c=h({},t,i),[4,u.update({filterByTk:o.id,values:{config:c}})];case 1:return s.sent(),[2,c]}})}).apply(this,arguments)}({baseConfig:function(e){var t=e.fallback,n=e.form,r=e.node,o=h({},t),i=!0,l=!1,a=void 0;try{for(var u,c=O[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var s,d=u.value,f=null==(s=r.config)?void 0:s[d];void 0!==f&&(o[d]=f)}}catch(e){l=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(l)throw a}}var p=n.getFieldValue(["config"]),m=!0,y=!1,b=void 0;try{for(var g,v=E[Symbol.iterator]();!(m=(g=v.next()).done);m=!0){var w=g.value;p&&(void 0===p?"undefined":k(p))==="object"&&w in p&&(o[w]=p[w])}}catch(e){y=!0,b=e}finally{try{m||null==v.return||v.return()}finally{if(y)throw b}}return o}({fallback:t||_.current,form:S,node:T}),ctx:y,disabled:n,node:T,patch:e})];case 4:if(!(o=i.sent()))return[2,!1];return _.current=o,!function(e){var t=e.form,n=e.node,r=e.patch,o=e.persistedConfig,i=t.getFieldValue(["config"]),l=h({},o,i&&(void 0===i?"undefined":k(i))==="object"?i:{},r),a=!0,u=!1,c=void 0;try{for(var s,d=O[Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var f=s.value,p=o[f];void 0!==p&&(l[f]=p)}}catch(e){u=!0,c=e}finally{try{a||null==d.return||d.return()}finally{if(u)throw c}}t.setFieldsValue({config:l}),n.config=h({},o,n.config||{},r);var m=!0,y=!1,b=void 0;try{for(var g,v=O[Symbol.iterator]();!(m=(g=v.next()).done);m=!0){var w=g.value,C=o[w];void 0!==C&&(n.config[w]=C)}}catch(e){y=!0,b=e}finally{try{m||null==v.return||v.return()}finally{if(y)throw b}}}({form:S,node:T,patch:e,persistedConfig:o}),[2,o]}})})(),P.set(t,o),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,o];case 2:return[2,Boolean.apply(void 0,[i.sent()])];case 3:return A({form:S,message:H,nodeId:t,pending:!1}),P.get(t)===o&&P.delete(t),[7];case 4:return[2]}})})()}),L=(0,c.useMemoizedFn)(function(e){return g(function(){return M(this,function(n){switch(n.label){case 0:return[4,V(v({},t,e))];case 1:if(!n.sent())return[2,!1];return null==p||p(e),[2,!0]}})})()}),q=(0,c.useMemoizedFn)(function(){return g(function(){var e,t,r,o,i;return M(this,function(a){switch(a.label){case 0:if(n||U.current)return[2];U.current=!0,G(!0),a.label=1;case 1:if(a.trys.push([1,6,7,8]),e=!m,t=m||(0,u.randomId)(N),r=null==T?void 0:T.id,m)return[3,5];A({form:S,message:H,nodeId:r,pending:!0}),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,L(t)];case 3:if(!a.sent())return[2];return[3,5];case 4:return A({form:S,message:H,nodeId:r,pending:!1}),[7];case 5:return e&&(i=!1,A({form:S,message:H,nodeId:r,pending:!0}),o=function(){i||(i=!0,A({form:S,message:H,nodeId:r,pending:!1}))}),y.viewer.dialog({width:800,closable:!0,onClose:o,title:W,styles:"taskCard"===s?{body:{padding:0,backgroundColor:"var(--nb-box-bg)"}}:{body:{padding:w.paddingLG,backgroundColor:"var(--nb-box-bg)"},content:{padding:0},header:{padding:"".concat(w.padding,"px ").concat(w.paddingLG,"px"),marginBottom:0}},content:function(){return l().createElement(D,{disabled:n,form:S,kind:s,node:T,nodes:null==x?void 0:x.nodes,onGeneratedUidChange:e?L:void 0,onNodeConfigPatch:V,onModelReady:o,uid:t,uidPrefix:N,upstreams:F,workflow:j})}}),[3,8];case 6:return a.sent(),[3,8];case 7:return U.current=!1,G(!1),[7];case 8:return[2]}})})()}),$=(0,c.useMemoizedFn)(function(){return g(function(){var e,t,n;return M(this,function(r){switch(r.label){case 0:if(!f||!z)return[2];return[4,y.api.request({method:"POST",url:"uiSchemas:remove/".concat(z)})];case 1:return r.sent(),S.setFieldValue(["config",f],null),null==x||null==(e=x.refresh)||e.call(x),null==(n=y.message)||null==(t=n.success)||t.call(n,b("Deleted successfully")),[2]}})})()}),X=(0,c.useMemoizedFn)(function(e){e.stopPropagation(),o.Modal.confirm({title:b("Delete v1 configuration"),onOk:$})}),Z=[{key:"v1",label:l().createElement(o.Space,null,l().createElement("span",null,b("v1 (Legacy)")),l().createElement(a.DeleteOutlined,{onClick:X}))},{key:"v2",label:b("v2"),disabled:n||K,onClick:q}],J="interface"===s?l().createElement(a.SettingOutlined,{"aria-hidden":!0}):l().createElement(a.CreditCardOutlined,{"aria-hidden":!0}),Q="interface"===s?"primary":"default";return"interface"===s&&z?l().createElement(o.Dropdown,{menu:{items:Z},trigger:["hover"]},l().createElement(o.Button,{disabled:n,icon:J,loading:K,type:Q},b("Go to configure")," ",l().createElement(a.DownOutlined,{"aria-hidden":!0}))):l().createElement(o.Button,{disabled:n||K,icon:J,loading:K,onClick:q,type:Q},b("Go to configure"))},B=n(341);function K(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 G(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||z(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(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 z(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}}function W(e){return"number"==typeof e?String(e):e}function N(e,t){return"number"==typeof t&&e===String(t)?t:e}function H(e){var t=e.disabled,n=e.onChange,r=e.value,u=void 0===r?[]:r,s=(0,d.kj)(),f=G((0,i.useState)(!1),2),p=f[0],m=f[1],y=(0,c.useMemoizedFn)(function(e){null==n||n(R(u).concat([e])),m(!1)}),b=l().createElement(o.Button,{block:!0,disabled:t,icon:l().createElement(a.PlusOutlined,null),type:"dashed"},s("Add"));return t?null:l().createElement(o.Popover,{content:l().createElement(o.Space,{direction:"vertical",size:"small"},l().createElement(o.Button,{type:"text",onClick:function(){return y("")}},s("Select users")),l().createElement(o.Button,{type:"text",onClick:function(){return y({filter:{}})}},s("Query users"))),onOpenChange:m,open:p,placement:"bottom"},b)}function V(e){var t=e.disabled,n=e.index,r=e.item,i=e.onMoveDown,u=e.onMoveUp,c=e.onRemove,s=e.onUpdate,f=e.total,p=o.theme.useToken().token,m=(0,d.kj)();return l().createElement(o.Flex,{gap:"small",align:"center"},l().createElement(o.Button,{"aria-label":m("Sort recipient"),disabled:!0,icon:l().createElement(a.HolderOutlined,null),size:"small",style:{color:p.colorTextTertiary,cursor:"grab",height:p.controlHeight,minWidth:p.fontSizeLG,paddingInline:0,width:p.fontSizeLG},type:"text"}),l().createElement("div",{style:{flex:1,minWidth:0}},l().createElement(B.UserSelect,{value:W(r),onChange:function(e){return s(N(e,r))}})),t?null:l().createElement(l().Fragment,null,l().createElement(o.Button,{"aria-label":m("Move recipient up"),disabled:0===n,icon:l().createElement(a.UpOutlined,null),onClick:u,style:{color:p.colorTextTertiary,height:p.controlHeight,minWidth:p.controlHeightSM,paddingInline:0,width:p.controlHeightSM},type:"text"}),l().createElement(o.Button,{"aria-label":m("Move recipient down"),disabled:n===f-1,icon:l().createElement(a.DownOutlined,null),onClick:i,style:{color:p.colorTextTertiary,height:p.controlHeight,minWidth:p.controlHeightSM,paddingInline:0,width:p.controlHeightSM},type:"text"}),l().createElement(o.Button,{"aria-label":m("Remove recipient"),icon:l().createElement(a.DeleteOutlined,null),onClick:c,style:{color:p.colorTextTertiary,height:p.controlHeight,minWidth:p.controlHeightSM,paddingInline:0,width:p.controlHeightSM},type:"text"})))}var L=function(e){var t=e.disabled,n=e.onChange,r=e.value,i=void 0===r?[]:r,a=o.theme.useToken().token,u=(0,c.useMemoizedFn)(function(e,t){null==n||n(i.map(function(n,r){return r===e?t:n}))}),s=(0,c.useMemoizedFn)(function(e){null==n||n(e.map(function(e,t){return N(e,i[t])}))}),d=(0,c.useMemoizedFn)(function(e){null==n||n(i.filter(function(t,n){return n!==e}))}),f=(0,c.useMemoizedFn)(function(e,t){var r=R(i),o=G(r.splice(e,1),1)[0];r.splice(t,0,o),null==n||n(r)});return l().createElement(o.Flex,{vertical:!0},i.length?l().createElement(o.Flex,{vertical:!0,gap:"small",style:{marginBottom:a.marginLG}},i.map(function(e,n){return l().createElement(V,{key:"".concat(n),disabled:t,index:n,item:e,onMoveDown:function(){return f(n,n+1)},onMoveUp:function(){return f(n,n-1)},onRemove:function(){return d(n)},onUpdate:function(e){return u(n,e)},total:i.length})})):null,l().createElement(H,{value:i.map(W),onChange:s,disabled:t}))};function q(e,t,n,r,o,i,l){try{var a=e[i](l),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function $(e){return"".concat(e,":")}function X(){return null}function Z(){var e=(0,d.kj)(),t=(0,r.useNodeContext)(),n={paddingBottom:o.theme.useToken().token.marginXXL};return l().createElement("div",{className:"nb-workflow-cc-node-fieldset",style:n},l().createElement(o.Form.Item,{name:["config","users"],label:$(e("Recipients")),required:!0,rules:[{validator:function(t,n){var r;return(r=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:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(l,"next",{value:u(0)}),a(l,"throw",{value:u(1)}),a(l,"return",{value:u(2)}),"function"==typeof Symbol&&a(l,Symbol.iterator,{value:function(){return this}}),l;function u(a){return function(u){var c=[a,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=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(t){if(Array.isArray(n)&&n.filter(Boolean).length>0)return[2];throw Error(e("The field value is required"))})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function l(e){q(i,n,o,l,a,"next",e)}function a(e){q(i,n,o,l,a,"throw",e)}l(void 0)})})()}}]},l().createElement(L,null)),l().createElement(o.Form.Item,{name:["config","ccUid"],label:$(e("User interface"))},l().createElement(U,{configKey:"ccUid",kind:"interface",legacyConfigKey:"ccDetail"})),l().createElement(o.Form.Item,{name:["config","taskCardUid"],label:$(e("Task card"))},l().createElement(U,{configKey:"taskCardUid",kind:"taskCard"})),l().createElement(o.Form.Item,{hidden:!0,name:["config","tempAssociationFields"],noStyle:!0},l().createElement(X,null)),l().createElement(o.Form.Item,{label:$(e("Task title")),extra:e("Title of each CC item in tasks center. Could use variables in string template. Default to node title.")},l().createElement(o.Form.Item,{name:["config","title"],initialValue:null==t?void 0:t.title,noStyle:!0},l().createElement(r.WorkflowVariableInput,null))))}},170:function(e,t,n){n.d(t,{G:function(){return r},P:function(){return o}});var r="ccTempAssoc_",o=function(e,t){return"".concat(r).concat(e,"_").concat(String(null!=t?t:"").replace(/[^a-zA-Z0-9_]/g,"_"))}}}]);
@@ -1,10 +0,0 @@
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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["746"],{561:function(e,t,r){r.r(t),r.d(t,{CCBlockGridModel:function(){return O}});var n=r(375),o=r(485),l=r(694),c=r(155),i=r.n(c),u=r(488),a=r(770);function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(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}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function b(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}function h(e){var t=!1,r=e.map(function(e){var r=function(e){if(!e||"function"==typeof e)return e;var t,r=null==(t=e.stepParams)?void 0:t.resourceSettings,n=null==r?void 0:r.init,o=function(e){var t,r,n,o=null==e?void 0:e.collectionName;if("string"!=typeof o||!o.includes(":"))return e;var l=(r=(t=o.split(":")).pop(),n=t[0]||"main",r?{collectionName:r,dataSourceKey:n}:null);return l?d(f({},e),{dataSourceKey:l.dataSourceKey,collectionName:l.collectionName}):e}(n);return o===n?e:d(f({},e),{stepParams:d(f({},e.stepParams),{resourceSettings:d(f({},r),{init:o})})})}(e.createModelOptions),n=Array.isArray(e.children)?h(e.children):e.children;return r===e.createModelOptions&&n===e.children?e:(t=!0,d(f({},e),{children:n,createModelOptions:r}))});return t?r:e}function v(e){return Array.isArray(e.children)&&e.children.length>0}function g(e){var t,r,o=e.model,s=(0,a.y)(),f=(null==(t=o.context.view)?void 0:t.inputArgs)||{},d=null==(r=f.flowContext)?void 0:r.workflow,p=f.availableUpstreams,y=(0,c.useMemo)(function(){var e,t,r=p||[],n=[],o=b(null==(t=s.getTrigger(null==d?void 0:d.type))||null==(e=t.getCreateModelMenuItem)?void 0:e.call(t,{config:(null==d?void 0:d.config)||{},nodeType:"cc",workflow:d})),l=h(o);o.length&&n.push({key:"triggers",label:'{{t("Trigger", { ns: "workflow" })}}',children:l});var c=h(r.flatMap(function(e){var t,r;return b(null==(r=s.getInstruction(e.type))||null==(t=r.getCreateModelMenuItem)?void 0:t.call(r,{node:e,workflow:d}))}));return c.length&&n.push({key:"nodes",label:'{{t("Node result", { ns: "workflow" })}}',children:c}),[{key:"dataBlocks",type:"group",label:(0,u.MZ)("Data blocks"),children:n},{key:"otherBlocks",type:"group",label:(0,u.MZ)("Other blocks"),children:[{key:"markdown",label:(0,u.MZ)("Markdown"),useModel:"MarkdownBlockModel",createModelOptions:{use:"MarkdownBlockModel"}},{key:"jsBlock",label:(0,u.MZ)("JS block"),useModel:"JSBlockModel",createModelOptions:{use:"JSBlockModel"}}]}].filter(v)},[p,d,s]);return i().createElement(l.AddSubModelButton,{model:o,subModelKey:"items",items:y},i().createElement(l.FlowSettingsButton,{icon:i().createElement(n.PlusOutlined,null)},o.context.t("Add block")))}var O=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=s(e),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,y()?Reflect.construct(e,t||[],s(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&p(r,e),t=[{key:"renderAddSubModelButton",value:function(){return this.context.flowSettingsEnabled?i().createElement(g,{model:this}):null}}],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}(o.BlockGridModel);O.define({hide:!0}),t.default=O}}]);
@@ -1,10 +0,0 @@
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_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).push([["86"],{29:function(e,t,o){o.r(t),o.d(t,{CCTriggerBlockGridModel:function(){return d}});var n=o(375),r=o(485),l=o(694),c=o(155),u=o.n(c),i=o(488);function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var d=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;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return e=o,t=arguments,e=a(e),function(e,t){var o;if(t&&("object"==((o=t)&&"u">typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&s(o,e),t=[{key:"renderAddSubModelButton",value:function(){if(!this.context.flowSettingsEnabled)return null;var e=[{key:"otherBlocks",type:"group",label:(0,i.MZ)("Other blocks"),children:[{key:"markdown",label:(0,i.MZ)("Markdown"),useModel:"MarkdownBlockModel",createModelOptions:{use:"MarkdownBlockModel"}},{key:"jsBlock",label:(0,i.MZ)("JS block"),useModel:"JSBlockModel",createModelOptions:{use:"JSBlockModel"}}]}];return u().createElement(l.AddSubModelButton,{model:this,subModelKey:"items",items:e},u().createElement(l.FlowSettingsButton,{icon:u().createElement(n.PlusOutlined,null)},this.context.t("Add block")))}}],function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(o.prototype,t),o}(r.BlockGridModel);d.define({hide:!0}),t.default=d}}]);
@@ -1,20 +0,0 @@
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
- export type FlowModelConfigKind = 'interface' | 'taskCard';
11
- export interface FlowModelConfigInputProps {
12
- configKey: string;
13
- disabled?: boolean;
14
- kind: FlowModelConfigKind;
15
- legacyConfigKey?: string;
16
- onChange?: (value: string) => void;
17
- value?: string;
18
- }
19
- export declare function FlowModelConfigInput({ configKey, disabled, kind, legacyConfigKey, onChange, value, }: FlowModelConfigInputProps): React.JSX.Element;
20
- export default FlowModelConfigInput;
@@ -1,11 +0,0 @@
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 type { TempAssociationSource } from '@nocobase/plugin-workflow/client-v2';
10
- import { type CanvasNodeLike, type WorkflowLike } from '../workflowPluginCompat';
11
- export declare function useTempAssociationSources(workflow?: WorkflowLike, upstreams?: CanvasNodeLike[]): TempAssociationSource[];
@@ -1,10 +0,0 @@
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 { PluginWorkflowCCClientV2 } from './plugin';
@@ -1,10 +0,0 @@
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("ahooks"),require("react-i18next"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),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-cc/client-v2",["ahooks","react-i18next","@nocobase/plugin-notification-manager/client-v2","@nocobase/client-v2","react-router-dom","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-cc/client-v2"]=t(require("ahooks"),require("react-i18next"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-cc/client-v2"]=t(e.ahooks,e["react-i18next"],e["@nocobase/plugin-notification-manager/client-v2"],e["@nocobase/client-v2"],e["react-router-dom"],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,a,l,c,u){return function(){"use strict";var s,f,d,p={325:function(e,t,n){n.d(t,{V:function(){return a}});var r=n(155),o=n(770);function i(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 a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,o.y)();return(0,r.useMemo)(function(){if(!e)return[];var r,o,a,l,c,u=null==(c=n.getTrigger(e.type))||null==(l=c.useTempAssociationSource)?void 0:l.call(c,e.config,e),s=u||"string"!=typeof(a=null==(r=e)||null==(o=r.config)?void 0:o.collection)||!a||(null==r?void 0:r.id)==null?null:{collection:a,nodeId:r.id,nodeKey:"workflow",nodeType:"workflow"},f=t.map(function(e){var t,r;return null==(r=n.getInstruction(e.type))||null==(t=r.useTempAssociationSource)?void 0:t.call(r,e)}).filter(Boolean);return u||s?[u||s].concat(function(e){if(Array.isArray(e))return i(e)}(f)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(f)||function(e){if(e){if("string"==typeof e)return i(e,void 0);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 i(e,void 0)}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):f},[t,e,n])}},488:function(e,t,n){n.d(t,{CU:function(){return i},MZ:function(){return a},kj:function(){return l}});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}n(953);var i="@nocobase/plugin-workflow-cc";function a(e,t){return(0,r.tExpr)(e,o({ns:i},t))}function l(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}},813:function(e,t,n){function r(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,c,"next",e)}function c(e){r(a,o,i,l,c,"throw",e)}l(void 0)})}}function i(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:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=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],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}n.d(t,{W:function(){return u}});var a=new WeakSet,l="__workflowCcModelLoadersRegistered__";function c(e){return o(function(){return i(this,function(t){return[2,e()]})})()}function u(e){a.has(e)||e[l]||"function"!=typeof e.registerModelLoaders||(e.registerModelLoaders({CCChildPageModel:{extends:"ChildPageModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("458").then(n.bind(n,401))];case 1:return[2,e.sent().CCChildPageModel]}})})()})}},CCChildPageTabModel:{extends:"ChildPageTabModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("458").then(n.bind(n,401))];case 1:return[2,e.sent().CCChildPageTabModel]}})})()})}},CCBlockGridModel:{extends:"BlockGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("746").then(n.bind(n,561))];case 1:return[2,e.sent().CCBlockGridModel]}})})()})}},CCTriggerBlockGridModel:{extends:"BlockGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("86").then(n.bind(n,29))];case 1:return[2,e.sent().CCTriggerBlockGridModel]}})})()})}},CCTaskCardDetailsModel:{extends:"DetailsBlockModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("164").then(n.bind(n,303))];case 1:return[2,e.sent().CCTaskCardDetailsModel]}})})()})}},CCTaskCardGridModel:{extends:"DetailsGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("352").then(n.bind(n,923))];case 1:return[2,e.sent().CCTaskCardGridModel]}})})()})}},CCTaskCardDetailsItemModel:{extends:"DetailsItemModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("437").then(n.bind(n,628))];case 1:return[2,e.sent().CCTaskCardDetailsItemModel]}})})()})}},CCTaskCardDetailsAssociationFieldGroupModel:{extends:"DetailsAssociationFieldGroupModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("486").then(n.bind(n,429))];case 1:return[2,e.sent().CCTaskCardDetailsAssociationFieldGroupModel]}})})()})}}}),a.add(e),e[l]=!0)}},92:function(e,t,n){n.d(t,{o:function(){return a}});var r=n(694),o=n(358),i=[{name:"workflowCcTasks",dataCategory:"business",filterTargetKey:"id",simplePaginate:!0,dumpRules:{group:"log"},migrationRules:["schema-only"],shared:!0,createdAt:!0,updatedAt:!0,fields:[{type:"snowflakeId",name:"id",primaryKey:!0,allowNull:!1},{type:"belongsTo",name:"job",target:"jobs",foreignKey:"jobId",primaryKey:!1},{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",primaryKey:!1},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Task title", { ns: "'.concat(o.CU,'" })}}'),"x-component":"Input"}},{type:"belongsTo",name:"execution",onDelete:"CASCADE"},{type:"belongsTo",name:"node",target:"flow_nodes",uiSchema:{type:"object",title:'{{t("CC node", { ns: "'.concat(o.CU,'" })}}')}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",onDelete:"CASCADE",interface:"m2o",uiSchema:{type:"object",title:'{{t("Workflow", { ns: "workflow" })}}',"x-component":"AssociationField","x-component-props":{fieldNames:{label:"title",value:"id"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "'.concat(o.CU,'" })}}'),"x-component":"Select",enum:[{label:'{{t("Unread", { ns: "'.concat(o.CU,'" })}}'),value:0,color:"gold"},{label:'{{t("Read", { ns: "'.concat(o.CU,'" })}}'),value:1,color:"green"}]},defaultValue:0},{type:"date",name:"readAt",interface:"datetime",uiSchema:{type:"string",title:'{{t("Read at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"createdAt",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Updated at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}}]},{name:"flow_nodes",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1},{type:"uid",name:"key"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{name:"workflow",type:"belongsTo",target:"workflows"},{name:"upstream",type:"belongsTo",target:"flow_nodes"},{name:"downstream",type:"belongsTo",target:"flow_nodes"},{type:"string",name:"type"},{type:"json",name:"config",defaultValue:{}}]},{name:"workflows",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1,interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},{name:"key",type:"uid"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Name")}}',"x-component":"Input",required:!0}},{type:"string",name:"type"},{type:"jsonb",name:"config",defaultValue:{}},{type:"boolean",name:"enabled",defaultValue:!1}]}];function a(e){var t,n,o=null==(n=e.dataSourceManager)||null==(t=n.getDataSource)?void 0:t.call(n,"main");o&&i.forEach(function(e){var t,n,i;null!=(t=o.getCollection)&&t.call(o,e.name)||o.addCollection(new r.Collection((n=function(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}({},e),i=i={hidden:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n)))})}},770:function(e,t,n){n.d(t,{y:function(){return c}});var r=n(694),o=n(197),i=n(155);function a(e,t){try{var n;return null==e||null==(n=e.get)?void 0:n.call(e,t)}catch(e){return}}function l(e){var t,n,r=null==e||null==(n=e.context)||null==(t=n.app)?void 0:t.pm,i=[a(r,"workflow"),a(r,"@nocobase/plugin-workflow"),a(r,o.PluginWorkflowClientV2)];return i.filter(function(e,t){return e&&i.indexOf(e)===t})}function c(){var e=(0,r.useFlowEngine)();return(0,i.useMemo)(function(){return{getInstruction:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=l(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getInstruction)?void 0:r.call(e,t))?n:null==(i=e.instructions)||null==(o=i.get)?void 0:o.call(i,t)}(c,t);if(u)return u}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}(e,t)},getTrigger:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=l(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getTriggerOptions)?void 0:r.call(e,t))?n:null==(i=e.triggers)||null==(o=i.get)?void 0:o.call(i,t)}(c,t);if(u)return u}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}(e,t)}}},[e])}},358:function(e,t,n){n.d(t,{CU:function(){return r},Rr:function(){return i},wl:function(){return o}});var r="@nocobase/plugin-workflow-cc",o="cc",i={UNREAD:0,READ:1}},375:function(e){e.exports=c},485:function(e){e.exports=r},694:function(e){e.exports=u},341:function(e){e.exports=n},197:function(e){e.exports=l},625:function(t){t.exports=e},59:function(e){e.exports=a},155:function(e){e.exports=i},953:function(e){e.exports=t},442:function(e){e.exports=o}},y={};function b(e){var t=y[e];if(void 0!==t)return t.exports;var n=y[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+"."+({164:"e2c25964de2486b9",352:"a8dbaca3691905cb",437:"cbf01251aba7d74f",458:"51f1362d12aefe62",486:"d0a505ec5bea795c",679:"bcd3a82a92a57455",746:"b0fb6ac7c4f7e83b",86:"f7881bb89e51a4b6"})[e]+".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)},g={},b.l=function(e,t,n,r){if(g[e])return void g[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-workflow-cc/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-cc/client-v2:"+n),o.src=e),g[e]=[t];var u=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=g[e];if(delete g[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.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&&(v=b.g.location+"");var g,v,w=b.g.document;if(!v&&w&&(w.currentScript&&"SCRIPT"===w.currentScript.tagName.toUpperCase()&&(v=w.currentScript.src),!v)){var m=w.getElementsByTagName("script");if(m.length)for(var h=m.length-1;h>-1&&(!v||!/^http(s?):/.test(v));)v=m[h--].src}if(!v)throw Error("Automatic publicPath is not supported in this browser");b.p=v.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},b.f.j=function(e,t){var n=b.o(s,e)?s[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=s[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(s,e)&&(0!==(n=s[e])&&(s[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)}},f=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==s[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);l<o.length;l++)r=o[l],b.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(d=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).forEach(f.bind(null,0)),d.push=f.bind(null,d.push.bind(d));var k={};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-cc/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-cc/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-cc/dist/client-v2/"}b.p=e}(),!function(){b.r(k),b.d(k,{PluginWorkflowCCClientV2:function(){return es},default:function(){return ef}});var e,t=b(485),n=b(197),r=b(358),o=b(813),i=b(375),a=b(155),l=b.n(a),c=b(488);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return(s=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 d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var p=function(e){return'{{t("'.concat(e,'", { ns: "').concat(c.CU,'" })}}')},y=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=s(t),u(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(t,r||[],s(this).constructor):t.apply(this,r)),"title",p("CC")),u(e,"type","cc"),u(e,"group","manual"),u(e,"description",p("Provide a CC (carbon copy) feature in workflows to send approvals, or any other type of information to specified users.")),u(e,"icon",l().createElement(i.EyeOutlined,null)),u(e,"FieldsetLoader",function(){return b.e("679").then(b.bind(b,482)).then(function(e){return{default:e.CCFieldset}})}),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{}}}],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}(n.Instruction),g=b(694),v=b(625),w=b(59),m=b(442);function h(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 C(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function x(e){var n,r=e.enableUIConfiguration,o=void 0!==r&&r,i=e.mapModel,c=void 0===i?function(e){return e}:i,u=e.onModelLoaded,s=e.reloadKey,f=e.uid,d=e.useCache,p=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(n)||function(e){if(e){if("string"==typeof e)return h(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 h(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.")}(),y=p[0],b=p[1],v=(0,g.useFlowEngine)(),w=(0,g.useFlowViewContext)(),m=(0,a.useRef)(u),k=(0,a.useRef)(c),x=(0,a.useRef)(null),S=(0,a.useRef)(o);return(0,a.useEffect)(function(){m.current=u},[u]),(0,a.useEffect)(function(){k.current=c},[c]),(0,a.useEffect)(function(){var e,t=!1;return(e=function(){var e,n;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:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=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],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:if(!f)return t||b(null),[2];return[4,v.loadModel({uid:f})];case 1:if(!(e=r.sent()))return t||b(null),[2];return e=k.current?k.current(e):e,w&&e.context.addDelegate(w),e.context.defineProperty("flowSettingsEnabled",{value:S.current}),x.current=e,t||(b(e),null==(n=m.current)||n.call(m,e)),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,l,"next",e)}function l(e){C(i,r,o,a,l,"throw",e)}a(void 0)})})(),function(){t=!0}},[v,s,f,w]),(0,a.useEffect)(function(){S.current=o,x.current&&x.current.context.defineProperty("flowSettingsEnabled",{value:o})},[o]),l().createElement(g.FlowModelRenderer,{fallback:l().createElement(t.SkeletonFallback,null),hideRemoveInSettings:!0,model:y,showFlowSettings:!1,useCache:void 0!==d&&d})}var S=b(325),O=b(92),j=b(770);function E(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 P(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return 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)})}}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(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){T(e,t,n[t])})}return e}function R(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||I(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function I(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}function F(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:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=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],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var U=["node.id","node.title","node.updatedAt","node.config","workflow.id","workflow.title","workflow.enabled","workflow.config","workflow.nodes","workflow.nodes.title","workflow.nodes.key","workflow.nodes.config","execution.id","execution.status"],L=["node","job","workflow","workflow.nodes","execution","execution.jobs"],B="workflowCcTasksFilter",G={$and:[{title:{$includes:""}},{"workflow.title":{$includes:""}}]},N=(T(e={},n.TASK_STATUS.PENDING,{filter:{status:r.Rr.UNREAD}}),T(e,n.TASK_STATUS.COMPLETED,{filter:{status:r.Rr.READ}}),e);function q(e){return!!e&&(void 0===e?"undefined":D(e))==="object"&&!Array.isArray(e)}function W(e,t){return t.split(".").reduce(function(e,t){return q(e)?e[t]:void 0},e)}function $(e,t){var n=W(e,t);if(null!=n)return String(n)}function K(e,t){var n=W(e,t);return q(n)?n:void 0}function V(e){return!q(e)||function e(t){return null==t||""===t||(Array.isArray(t)?t.every(e):(void 0===t?"undefined":D(t))==="object"&&Object.values(t).every(e))}(e)}function z(){if(!("u"<typeof window)){var e=new URLSearchParams(window.location.search).get(B);if(e)try{var t=JSON.parse(e);return q(t)&&!V(t)?t:void 0}catch(e){return}}}function H(e){return String(e).padStart(2,"0")}function X(e){var t="string"==typeof e||"number"==typeof e?String(e):void 0;if(!t)return"-";var n=new Date(t);return Number.isNaN(n.getTime())?t:"".concat(n.getFullYear(),"-").concat(H(n.getMonth()+1),"-").concat(H(n.getDate())," ").concat(H(n.getHours()),":").concat(H(n.getMinutes()),":").concat(H(n.getSeconds()))}function J(e){var t,n=K(e,"workflow"),r=K(e,"node"),o=Array.isArray(t=W(e,"workflow.nodes"))?t.filter(q):[],i=(0,a.useMemo)(function(){return function e(t,n){if(!t||!n.length)return[];var r,o=t.upstreamId,i=n.find(function(e){return e.id===o});return i?[i].concat(function(e){if(Array.isArray(e))return E(e)}(r=e(i,n))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||I(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):[]}(r,o)},[r,o]),l=(0,S.V)(n,i);return{availableUpstreams:i,node:r,nodes:o,tempAssociationSources:l,trigger:(0,j.y)().getTrigger(null==n?void 0:n.type),workflow:n}}function Y(e){var t=e.record,n=(0,c.kj)();return l().createElement(w.Tag,{color:t.status===r.Rr.READ?"green":"gold"},n(t.status===r.Rr.READ?"Read":"Unread"))}function Z(){var e,t,r,o=(0,n.useWorkflowTaskRecord)().record,i=(0,c.kj)(),a=w.theme.useToken().token,u=null!=(e=null!=(t=null!=(r=$(o,"title"))?r:$(o,"node.title"))?t:$(o,"workflow.title"))?e:i("CC"),s=$(o,"workflow.title");return l().createElement(w.Card,{hoverable:!0,size:"small",title:u,extra:s,style:{width:"100%"},styles:{body:{padding:a.paddingSM},extra:{color:a.colorTextDescription},header:{minHeight:a.controlHeightLG,paddingInline:a.paddingSM}}},l().createElement(w.Descriptions,{column:1,styles:{label:{width:"6em"}},items:[{key:"createdAt",label:i("Created at"),children:X(o.createdAt)},{key:"status",label:i("Status"),children:l().createElement(Y,{record:o})}]}))}function Q(){var e=(0,n.useWorkflowTaskRecord)(),t=e.record,o=e.refresh,i=e.openRecord,u=(0,g.useFlowContext)(),s=w.App.useApp().message,f=(0,c.kj)(),d=t.status,p=d===r.Rr.READ?"unread":"read",y=d===r.Rr.READ?f("Mark as unread"):f("Mark as read"),b=d===r.Rr.READ?"default":"primary",m=(0,a.useRef)(!1),h=_((0,a.useState)(!1),2),k=h[0],C=h[1],x=(0,v.useMemoizedFn)(function(){return A(function(){var e,n,a;return F(this,function(l){switch(l.label){case 0:if(m.current||null==(e=t.id))return[2];m.current=!0,C(!0),l.label=1;case 1:return l.trys.push([1,4,5,6]),[4,null==u||null==(n=(a=u.api.resource("workflowCcTasks"))[p])?void 0:n.call(a,{filterByTk:e})];case 2:return l.sent(),null==i||i(R(M({},t),{status:d===r.Rr.READ?r.Rr.UNREAD:r.Rr.READ})),[4,null==o?void 0:o()];case 3:return l.sent(),[3,6];case 4:return console.error("Failed to update workflow CC task status",l.sent()),s.error(f("Load failed")),[3,6];case 5:return m.current=!1,C(!1),[7];case 6:return[2]}})})()});return l().createElement(w.Button,{type:b,loading:k,disabled:k,onClick:x},y)}function ee(){var e,t,r,o=(0,n.useWorkflowTaskRecord)().record,i=(0,c.kj)();return l().createElement(w.Flex,{vertical:!0,gap:"middle"},l().createElement(w.Descriptions,{column:1,bordered:!0,items:[{key:"workflow",label:i("Workflow"),children:null!=(e=$(o,"workflow.title"))?e:"-"},{key:"node",label:i("CC node"),children:null!=(t=$(o,"node.title"))?t:"-"},{key:"status",label:i("Status"),children:l().createElement(Y,{record:o})},{key:"execution",label:i("Execution"),children:null!=(r=$(o,"execution.id"))?r:"-"},{key:"createdAt",label:i("Created at"),children:X(o.createdAt)},{key:"updatedAt",label:i("Updated at"),children:X(o.updatedAt)},{key:"readAt",label:i("Read at"),children:X(o.readAt)}]}),l().createElement(w.Flex,{justify:"end"},l().createElement(Q,null)))}function et(e){var t=w.theme.useToken().token;return(0,a.useMemo)(function(){return e?{style:{height:28,minWidth:44,paddingInline:t.paddingSM-t.lineWidth}}:{}},[e,t.lineWidth,t.paddingSM])}function en(e){var n,r,o,i,u,s,f=e.onlyIcon,d=(0,c.kj)(),p=(0,m.useNavigate)(),y=(0,m.useLocation)(),b=(n=(0,g.useFlowEngine)(),r=(0,v.useMemoizedFn)(function(){var e,t,r,o;return null==(o=n.dataSourceManager)||null==(r=o.getDataSource)||null==(t=r.call(o,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflowCcTasks")}),i=(o=_((0,a.useState)(function(){return r()}),2))[0],u=o[1],(0,a.useEffect)(function(){(0,O.o)(n),u(r())},[n,r]),i),h=d("Filter"),k=null!=(s=z())?s:G,C=et(f),x=(0,v.useMemoizedFn)(function(e){return A(function(){return F(this,function(t){var n,r,o;return p((r=new URLSearchParams(y.search),V(e)?r.delete(B):r.set(B,JSON.stringify(e)),o=r.toString(),"".concat(y.pathname).concat(o?"?".concat(o):"").concat(null!=(n=y.hash)?n:"")),{replace:!0}),[2]})})()}),S=l().createElement(t.CollectionFilter,{key:y.search||"empty-filter",collection:b,initialValue:k,onChange:x,t:d,filterableFieldNames:["title","workflow"],buttonText:f?"":void 0,showCount:!1,popoverMinWidth:f?288:void 0,popoverProps:f?{placement:"bottomRight",styles:{body:{maxWidth:"calc(100vw - 32px)",overflowX:"auto",width:312}}}:void 0,buttonProps:M({"aria-label":f?h:void 0},C)});return f?l().createElement(w.Tooltip,{title:h},S):S}var er={key:r.wl,title:'{{t("CC to me", { ns: "'.concat(c.CU,'" })}}'),collection:"workflowCcTasks",action:"listMine",useActionParams:function(e){var t,n,r,o=null!=(r=N[e])?r:{},i=(t=o.filter,n=z(),V(t)?null!=n?n:{}:V(n)?null!=t?t:{}:{$and:[t,n]});return R(M({},o),{filter:i,appends:U,except:["workflow.options","execution.context","execution.output"]})},Actions:function(e){var t,o=e.onlyIcon,u=e.reload,s=(0,g.useFlowContext)(),f=(0,n.getWorkflowTaskRegistry)(s),d=(0,n.useWorkflowTaskCounts)(s,f),p=d.counts,y=d.reload,b=w.App.useApp().message,m=(0,c.kj)(),h=et(o),k=_((0,a.useState)(!1),2),C=k[0],x=k[1],S=_((0,a.useState)(!1),2),O=S[0],j=S[1],E=(0,a.useRef)(!1),P=null==(t=p[r.wl])?void 0:t.pending,T=O||C||0===P;(0,a.useEffect)(function(){"number"==typeof P&&P>0&&x(!1)},[P]);var R=(0,v.useMemoizedFn)(function(){return A(function(){return F(this,function(e){switch(e.label){case 0:if(e.trys.push([0,5,,6]),!u)return[3,2];return[4,u()];case 1:return e.sent(),[3,4];case 2:return[4,y()];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:return console.error("Failed to refresh workflow CC tasks",e.sent()),b.error(m("Load failed")),[3,6];case 6:return[2]}})})()}),D=(0,v.useMemoizedFn)(function(){return A(function(){var e,t;return F(this,function(n){switch(n.label){case 0:if(E.current||T)return[2];E.current=!0,j(!0),n.label=1;case 1:return n.trys.push([1,7,8,9]),[4,null==s||null==(e=(t=s.api.resource("workflowCcTasks")).read)?void 0:e.call(t)];case 2:if(n.sent(),x(!0),!u)return[3,4];return[4,u()];case 3:return n.sent(),[3,6];case 4:return[4,y()];case 5:n.sent(),n.label=6;case 6:return[3,9];case 7:return console.error("Failed to mark workflow CC tasks as read",n.sent()),b.error(m("Load failed")),[3,9];case 8:return E.current=!1,j(!1),[7];case 9:return[2]}})})()}),I=l().createElement(w.Button,M({icon:l().createElement(i.ReloadOutlined,null),onClick:R,"aria-label":m("Refresh")},h),o?null:m("Refresh")),U=l().createElement(w.Button,M({icon:l().createElement(i.CheckOutlined,null),onClick:D,"aria-label":m("Mark all as read"),disabled:T,loading:O},h),o?null:m("Mark all as read"));return l().createElement(w.Space,{size:"small",wrap:!0},o?l().createElement(w.Tooltip,{title:m("Refresh")},I):I,l().createElement(en,{onlyIcon:o}),o?l().createElement(w.Tooltip,{title:m("Mark all as read")},U):U)},Item:function(){var e=(0,n.useWorkflowTaskRecord)().record,t=J(e),r=t.nodes,o=t.tempAssociationSources,i=t.workflow,c=$(e,"node.config.taskCardUid"),u=$(e,"node.updatedAt"),s=(0,a.useCallback)(function(t){t.getCurrentRecord=function(){return e},t.context.defineProperty("workflow",{get:function(){return i},cache:!1}),t.context.defineProperty("nodes",{get:function(){return r},cache:!1}),t.context.defineProperty("tempAssociationSources",{get:function(){return o},cache:!1})},[r,e,o,i]),f=(0,a.useCallback)(function(e){return e.clone()},[]);return c?l().createElement(x,{uid:c,onModelLoaded:s,mapModel:f,reloadKey:u}):l().createElement(Z,null)},Detail:function(){var e=(0,n.useWorkflowTaskRecord)().record,r=J(e),o=r.availableUpstreams,i=r.node,c=r.nodes,u=r.tempAssociationSources,s=r.trigger,f=r.workflow,d=$(e,"node.config.ccUid"),p=(0,a.useRef)(e);p.current=e;var y=(0,a.useCallback)(function(t){t.getCurrentRecord=function(){return p.current},t.context.defineProperty("flowSettingsEnabled",{value:!1}),t.context.defineProperty("disableBlockGridPadding",{value:!0}),t.context.defineProperty("record",{get:function(){return p.current},cache:!1}),t.context.defineProperty("workflowCcTaskRecord",{get:function(){return p.current},cache:!1}),t.context.defineProperty("view",{value:{inputArgs:{availableUpstreams:o,flowContext:{execution:K(e,"execution"),nodes:c,workflow:f},node:i,trigger:s}}}),t.context.defineProperty("workflow",{value:f}),t.context.defineProperty("nodes",{value:c}),t.context.defineProperty("tempAssociationSources",{value:u,cache:!1})},[o,i,c,e,u,s,f]);return d&&i&&f?K(e,"job")||Array.isArray(W(e,"execution.jobs"))?l().createElement(w.Flex,{"data-testid":"workflow-cc-detail-content",vertical:!0,gap:0,style:{gap:0}},l().createElement(x,{uid:d,onModelLoaded:y}),l().createElement(w.Flex,{justify:"end"},l().createElement(Q,null))):l().createElement(t.SkeletonFallback,null):l().createElement(ee,null)},DetailModal:function(e){var t=e.children,n=e.mobile,r=e.onClose,o=e.record,i=e.title,a=w.theme.useToken().token;return l().createElement(w.Modal,{open:!!o,title:i,footer:null,width:"80vw",onCancel:r,destroyOnClose:!0,styles:{body:{background:a.colorBgLayout,maxHeight:n?"calc(100dvh - ".concat(2*a.sizeXXL,"px)"):void 0,overflow:"auto",padding:"0 ".concat(a.paddingLG,"px ").concat(a.paddingLG,"px")},content:{background:a.colorBgLayout,overflow:"hidden",padding:0},header:{background:a.colorBgLayout,marginBottom:0,padding:"".concat(a.paddingContentVerticalLG,"px ").concat(a.paddingLG,"px ").concat(a.paddingContentVertical,"px")}}},t)},getPopupRecord:function(e,t){var n=t.params;return A(function(){var t,r;return F(this,function(o){return[2,null==(t=(r=e.resource("workflowCcTasks")).get)?void 0:t.call(r,R(M({},n),{appends:L}))]})})()}};function eo(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ei(e,t,n){return(ei=eu()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&el(o,n.prototype),o}).apply(null,arguments)}function ea(e){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function el(e,t){return(el=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(e){var t="function"==typeof Map?new Map:void 0;return(ec=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 ei(e,arguments,ea(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),el(n,e)})(e)}function eu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eu=function(){return!!e})()}var es=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=ea(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,eu()?Reflect.construct(e,t||[],ea(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&el(i,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),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=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],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return this.registerCollections(),this.registerModelLoaders(),this.registerWorkflowExtensions(),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){eo(i,r,o,a,l,"next",e)}function l(e){eo(i,r,o,a,l,"throw",e)}a(void 0)})}).call(this)}},{key:"registerCollections",value:function(){(0,O.o)(this.flowEngine)}},{key:"registerModelLoaders",value:function(){(0,o.W)(this.flowEngine)}},{key:"registerWorkflowExtensions",value:function(){var e,t,o,i=null!=(e=this.app.pm.get(n.PluginWorkflowClientV2))?e:this.app.pm.get("workflow");null==i||null==(t=i.registerInstruction)||t.call(i,"cc",y),null==i||null==(o=i.registerTaskType)||o.call(i,r.wl,er)}}],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)}}(i.prototype,t),i}(ec(t.Plugin)),ef=es}(),k}()});
@@ -1,12 +0,0 @@
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 = "@nocobase/plugin-workflow-cc";
10
- export declare function tExpr(key: string, options?: Record<string, unknown>): string;
11
- export declare function usePluginTranslation(): import("react-i18next").UseTranslationResponse<("@nocobase/plugin-workflow-cc" | "client")[], undefined>;
12
- export declare function useT(): (key: string, options?: Record<string, unknown>) => string;
@@ -1,23 +0,0 @@
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 { ChildPageModel, ChildPageTabModel } from '@nocobase/client-v2';
10
- import React from 'react';
11
- type CollectionContextParams = {
12
- collectionName: string;
13
- dataSourceKey: string;
14
- };
15
- export declare class CCChildPageModel extends ChildPageModel {
16
- onInit(options: Parameters<ChildPageModel['onInit']>[0]): void;
17
- setCollectionCtx({ dataSourceKey, collectionName }: CollectionContextParams): void;
18
- renderFirstTab(): React.JSX.Element;
19
- }
20
- export declare class CCChildPageTabModel extends ChildPageTabModel {
21
- renderChildren(): React.JSX.Element;
22
- }
23
- export default CCChildPageModel;
@@ -1,21 +0,0 @@
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 { Instruction } from '@nocobase/plugin-workflow/client-v2';
10
- import React from 'react';
11
- export default class CCInstruction extends Instruction {
12
- title: string;
13
- type: string;
14
- group: string;
15
- description: string;
16
- icon: React.JSX.Element;
17
- FieldsetLoader: () => Promise<{
18
- default: typeof import("./components/cc").CCFieldset;
19
- }>;
20
- createDefaultConfig(): {};
21
- }
@@ -1,19 +0,0 @@
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
- export type RecipientValue = number | string | {
11
- filter?: Record<string, unknown>;
12
- };
13
- export interface RecipientsInputProps {
14
- disabled?: boolean;
15
- onChange?: (value: RecipientValue[]) => void;
16
- value?: RecipientValue[];
17
- }
18
- export declare function RecipientsInput({ disabled, onChange, value }: RecipientsInputProps): React.JSX.Element;
19
- export default RecipientsInput;
@@ -1,16 +0,0 @@
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 { Plugin, type Application } from '@nocobase/client-v2';
10
- export declare class PluginWorkflowCCClientV2 extends Plugin<Record<string, never>, Application> {
11
- load(): Promise<void>;
12
- private registerCollections;
13
- private registerModelLoaders;
14
- private registerWorkflowExtensions;
15
- }
16
- export default PluginWorkflowCCClientV2;
@@ -1,15 +0,0 @@
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 { type TaskTypeOptions, type WorkflowTaskStatus } from '@nocobase/plugin-workflow/client-v2';
10
- export declare function useCcTaskActionParams(status: WorkflowTaskStatus): {
11
- filter: Record<string, unknown>;
12
- appends: string[];
13
- except: string[];
14
- };
15
- export declare const ccTaskType: TaskTypeOptions;
@@ -1,10 +0,0 @@
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 { type FlowEngine } from '@nocobase/flow-engine';
10
- export declare function registerWorkflowCcCollections(flowEngine: FlowEngine): void;
@@ -1,41 +0,0 @@
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 { type SubModelItem } from '@nocobase/flow-engine';
10
- import { type TempAssociationSource } from '@nocobase/plugin-workflow/client-v2';
11
- export type WorkflowLike = {
12
- config?: Record<string, unknown>;
13
- id?: number | string;
14
- type?: string;
15
- };
16
- export type CanvasNodeLike = {
17
- config?: Record<string, unknown>;
18
- id?: number | string;
19
- key?: string;
20
- type?: string;
21
- };
22
- type WorkflowTriggerLike = {
23
- getCreateModelMenuItem?: (args: {
24
- config: Record<string, unknown>;
25
- nodeType?: string;
26
- workflow?: WorkflowLike;
27
- }) => SubModelItem | SubModelItem[] | null;
28
- useTempAssociationSource?: (config?: Record<string, unknown>, workflow?: WorkflowLike) => TempAssociationSource | null;
29
- };
30
- type WorkflowInstructionLike = {
31
- getCreateModelMenuItem?: (args: {
32
- node: CanvasNodeLike;
33
- workflow?: WorkflowLike;
34
- }) => SubModelItem | SubModelItem[] | null;
35
- useTempAssociationSource?: (node: CanvasNodeLike) => TempAssociationSource | null;
36
- };
37
- export declare function useWorkflowPluginCompat(): {
38
- getInstruction: (type?: string) => WorkflowInstructionLike;
39
- getTrigger: (type?: string) => WorkflowTriggerLike;
40
- };
41
- export {};