@rytass/bpm-core-react 0.21.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/chunks/{FormBuilderView-WtC2iW5f.js → FormBuilderView-6KdApi-D.js} +8 -8
  3. package/dist/chunks/{FormBuilderView-WtC2iW5f.js.map → FormBuilderView-6KdApi-D.js.map} +1 -1
  4. package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs → FormBuilderView-CGKkuVFi.cjs} +3 -3
  5. package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs.map → FormBuilderView-CGKkuVFi.cjs.map} +1 -1
  6. package/dist/chunks/{approval-instance-list-page-Bth7Raya.js → approval-instance-list-page-BI5fIXc-.js} +26 -26
  7. package/dist/chunks/{approval-instance-list-page-Bth7Raya.js.map → approval-instance-list-page-BI5fIXc-.js.map} +1 -1
  8. package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs → approval-instance-list-page-Cv5I1YPX.cjs} +2 -2
  9. package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs.map → approval-instance-list-page-Cv5I1YPX.cjs.map} +1 -1
  10. package/dist/chunks/{compose-DZvIspW3.js → compose-DFuLPmOA.js} +4 -4
  11. package/dist/chunks/{compose-DZvIspW3.js.map → compose-DFuLPmOA.js.map} +1 -1
  12. package/dist/chunks/compose-DK3ocWwG.cjs +2 -0
  13. package/dist/chunks/compose-DK3ocWwG.cjs.map +1 -0
  14. package/dist/chunks/designer-CAUWEKJ4.cjs +69 -0
  15. package/dist/chunks/designer-CAUWEKJ4.cjs.map +1 -0
  16. package/dist/chunks/{designer-CWubIE69.js → designer-CCy5EbOe.js} +2189 -1608
  17. package/dist/chunks/designer-CCy5EbOe.js.map +1 -0
  18. package/dist/chunks/detail-C5KrUC7s.cjs +5 -0
  19. package/dist/chunks/detail-C5KrUC7s.cjs.map +1 -0
  20. package/dist/chunks/{detail-Bv90gvy0.js → detail-Dnc4PPWO.js} +768 -742
  21. package/dist/chunks/detail-Dnc4PPWO.js.map +1 -0
  22. package/dist/chunks/{instance-error-message-CAP1vJhX.js → instance-error-message-BEM4O_Kj.js} +6 -2
  23. package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +1 -0
  24. package/dist/chunks/instance-error-message-BpCLCOjp.cjs +2 -0
  25. package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +1 -0
  26. package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs +2 -0
  27. package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs.map +1 -0
  28. package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js +42 -0
  29. package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js.map +1 -0
  30. package/dist/chunks/{providers-BbCs23sk.js → providers-CQWekD7_.js} +197 -196
  31. package/dist/chunks/providers-CQWekD7_.js.map +1 -0
  32. package/dist/chunks/providers-VUOh6i0i.cjs +2 -0
  33. package/dist/chunks/providers-VUOh6i0i.cjs.map +1 -0
  34. package/dist/components/notification-drawer-options.d.cts +18 -0
  35. package/dist/components/notification-drawer-options.d.ts +18 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +1 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +23 -23
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/organization-time-zone-provider.d.cts +20 -0
  43. package/dist/lib/organization-time-zone-provider.d.ts +20 -0
  44. package/dist/lib/organization-time-zone.d.cts +8 -0
  45. package/dist/lib/organization-time-zone.d.ts +8 -0
  46. package/dist/lib/providers.d.cts +10 -1
  47. package/dist/lib/providers.d.ts +10 -1
  48. package/dist/next/BPMNextProviders.d.cts +8 -1
  49. package/dist/next/BPMNextProviders.d.ts +8 -1
  50. package/dist/next/index.cjs +1 -1
  51. package/dist/next/index.cjs.map +1 -1
  52. package/dist/next/index.js +12 -11
  53. package/dist/next/index.js.map +1 -1
  54. package/dist/pages/instances/detail/index.cjs +1 -1
  55. package/dist/pages/instances/detail/index.js +1 -1
  56. package/dist/pages/templates/compose/index.cjs +1 -1
  57. package/dist/pages/templates/compose/index.js +1 -1
  58. package/dist/pages/templates/designer/index.cjs +1 -1
  59. package/dist/pages/templates/designer/index.js +1 -1
  60. package/dist/views/cc/index.cjs +1 -1
  61. package/dist/views/cc/index.js +1 -1
  62. package/dist/views/forms/builder/index.cjs +1 -1
  63. package/dist/views/forms/builder/index.js +1 -1
  64. package/dist/views/instances/detail/index.cjs +1 -1
  65. package/dist/views/instances/detail/index.js +1 -1
  66. package/dist/views/instances/detail/sections/shared.d.cts +0 -1
  67. package/dist/views/instances/detail/sections/shared.d.ts +0 -1
  68. package/dist/views/instances/new/index.cjs +1 -1
  69. package/dist/views/instances/new/index.js +1 -1
  70. package/dist/views/search/index.cjs +1 -1
  71. package/dist/views/search/index.js +1 -1
  72. package/dist/views/sent/index.cjs +1 -1
  73. package/dist/views/sent/index.js +1 -1
  74. package/dist/views/templates/compose/index.cjs +1 -1
  75. package/dist/views/templates/compose/index.js +1 -1
  76. package/dist/views/templates/designer/approver-resolver-model.d.cts +105 -1
  77. package/dist/views/templates/designer/approver-resolver-model.d.ts +105 -1
  78. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +5 -0
  79. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +5 -0
  80. package/dist/views/templates/designer/index.cjs +1 -1
  81. package/dist/views/templates/designer/index.js +1 -1
  82. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +44 -1
  83. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +44 -1
  84. package/dist/views/templates/designer/notify-recipient-options.d.cts +81 -0
  85. package/dist/views/templates/designer/notify-recipient-options.d.ts +81 -0
  86. package/dist/views/templates/designer/position-level-options.d.cts +3 -1
  87. package/dist/views/templates/designer/position-level-options.d.ts +3 -1
  88. package/dist/views/templates/designer/position-scope.d.cts +51 -0
  89. package/dist/views/templates/designer/position-scope.d.ts +51 -0
  90. package/package.json +3 -3
  91. package/dist/chunks/compose-BKUTsB2W.cjs +0 -2
  92. package/dist/chunks/compose-BKUTsB2W.cjs.map +0 -1
  93. package/dist/chunks/designer-CWubIE69.js.map +0 -1
  94. package/dist/chunks/designer-C_m8DmMl.cjs +0 -69
  95. package/dist/chunks/designer-C_m8DmMl.cjs.map +0 -1
  96. package/dist/chunks/detail-Bv90gvy0.js.map +0 -1
  97. package/dist/chunks/detail-DNzqesdI.cjs +0 -5
  98. package/dist/chunks/detail-DNzqesdI.cjs.map +0 -1
  99. package/dist/chunks/instance-error-message-BW464LRQ.cjs +0 -2
  100. package/dist/chunks/instance-error-message-BW464LRQ.cjs.map +0 -1
  101. package/dist/chunks/instance-error-message-CAP1vJhX.js.map +0 -1
  102. package/dist/chunks/language-provider-Bdnx3Gxl.cjs +0 -2
  103. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +0 -1
  104. package/dist/chunks/language-provider-phkWOapf.js +0 -17
  105. package/dist/chunks/language-provider-phkWOapf.js.map +0 -1
  106. package/dist/chunks/providers-BbCs23sk.js.map +0 -1
  107. package/dist/chunks/providers-D_KAgOOu.cjs +0 -2
  108. package/dist/chunks/providers-D_KAgOOu.cjs.map +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/designer-C_m8DmMl.cjs");exports.TemplateDesignerView=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/designer-CAUWEKJ4.cjs");exports.TemplateDesignerView=e.t;
@@ -1 +1 @@
1
- export { t as TemplateDesignerView } from "../../../chunks/designer-CWubIE69.js";
1
+ export { t as TemplateDesignerView } from "../../../chunks/designer-CCy5EbOe.js";
@@ -1,4 +1,4 @@
1
- import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
1
+ import { ExcludeInitiatorWhenEmpty, WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
2
2
  export type NodeActorOption = Readonly<{
3
3
  id: string;
4
4
  name: string;
@@ -16,6 +16,16 @@ export type NodeActorStageChoice = Readonly<{
16
16
  export declare const NO_UPSTREAM_USER_TASK_HINT = "\u9019\u500B\u7BC0\u9EDE\u524D\u9762\u6C92\u6709\u53EF\u4EE5\u9078\u7684\u7C3D\u6838\u95DC\u5361\uFF0C\u8ACB\u5148\u5728\u5B83\u524D\u9762\u52A0\u5165\u7C3D\u6838\u7BC0\u9EDE\uFF08\u6C92\u6709\u9032\u5165\u689D\u4EF6\u3001\u6C92\u8A2D\u8DF3\u904E\u6B64\u95DC\uFF0C\u4E5F\u6C92\u8A2D\u903E\u6642\u81EA\u52D5\u6838\u51C6\uFF09";
17
17
  /** The 關卡 picker's hint while the selection has no problem to report. */
18
18
  export declare const NODE_ACTOR_STAGE_HINT = "\u7C3D\u6838\u4EBA\u53D6\u81EA\u4F60\u9078\u7684\u524D\u9762\u95DC\u5361\u5BE6\u969B\u7C3D\u6838\u7684\u4EBA\uFF1B\u53EF\u8907\u9078\uFF0C\u6574\u7D44\u8981\u6DB5\u84CB\u6BCF\u689D\u8DEF\u5F91\u3002\u8907\u9078\u591A\u500B\u95DC\u5361\u6642\uFF0C\u53D6\u6700\u8FD1\u5BE6\u969B\u8D70\u5230\u7684\u90A3\u4E00\u95DC\u7684\u7C3D\u6838\u4EBA\uFF0C\u4E0D\u662F\u5168\u90E8\u95DC\u5361\u7684\u7C3D\u6838\u4EBA\u3002";
19
+ /**
20
+ * The 關卡 picker's hint for a manager chain's 前面關卡的簽核者 start, while
21
+ * the selection has no problem to report.
22
+ */
23
+ export declare const ORG_MANAGER_CHAIN_STAGE_HINT = "\u8D77\u9EDE\u662F\u4F60\u9078\u7684\u524D\u9762\u95DC\u5361\u5BE6\u969B\u7C3D\u6838\u7684\u90A3\u4E00\u4F4D\uFF0C\u5F9E\u4ED6\u7684\u4E3B\u7BA1\u958B\u59CB\u5F80\u4E0A\u7C3D\uFF1B\u53EA\u80FD\u9078\u6BCF\u6B21\u53EA\u6703\u6709\u4E00\u4F4D\u7C3D\u6838\u4EBA\u7684\u95DC\u5361\u3002\u53EF\u8907\u9078\uFF0C\u6574\u7D44\u8981\u6DB5\u84CB\u6BCF\u689D\u8DEF\u5F91\uFF0C\u53D6\u6700\u8FD1\u5BE6\u969B\u8D70\u5230\u7684\u90A3\u4E00\u95DC\u7684\u7C3D\u6838\u8005\u3002";
24
+ /**
25
+ * The 關卡 picker's hint when every stage upstream of a manager chain may end
26
+ * with several signers, so none can be the start.
27
+ */
28
+ export declare const ORG_MANAGER_CHAIN_ONLY_MULTI_APPROVER_STAGES_HINT = "\u524D\u9762\u7684\u7C3D\u6838\u95DC\u5361\u90FD\u53EF\u80FD\u6709\u591A\u4F4D\u7C3D\u6838\u4EBA\uFF0C\u6240\u4EE5\u4E0D\u80FD\u7576\u4E3B\u7BA1\u93C8\u7684\u8D77\u9EDE\uFF1B\u8ACB\u6539\u7528\u53EA\u6709\u4E00\u4F4D\u7C3D\u6838\u4EBA\u7684\u95DC\u5361\uFF0C\u6216\u6539\u9078\u5176\u4ED6\u8D77\u9EDE\u3002";
19
29
  /**
20
30
  * The 關卡 picker of 依前面關卡的簽核者: the user tasks upstream of `nodeId`
21
31
  * that always end with a real signer (`readNodeActorSourceSkipReasons` is
@@ -29,6 +39,16 @@ export declare const NODE_ACTOR_STAGE_HINT = "\u7C3D\u6838\u4EBA\u53D6\u81EA\u4F
29
39
  * stored choice stays visible until the author fixes it.
30
40
  */
31
41
  export declare function readNodeActorStageChoice(definition: WorkflowDefinition, nodeId: string, selectedIds: readonly string[]): NodeActorStageChoice;
42
+ /**
43
+ * The 關卡 picker of a manager chain's 前面關卡的簽核者 start: the same stages
44
+ * as {@link readNodeActorStageChoice} offers, minus the ones that may end with
45
+ * several signers. The chain climbs from one person, so a stage that
46
+ * `canUserTaskHaveMultipleApprovers` is not offered (a 並行全部同意 stage still
47
+ * is for 依前面關卡的簽核者, which takes everyone). A stored stage of that kind
48
+ * stays in the list, marked, and the selection's problems include the
49
+ * single-signer rule the publish lint runs (`readSingleApproverSourceIssues`).
50
+ */
51
+ export declare function readOrgManagerChainStageChoice(definition: WorkflowDefinition, nodeId: string, selectedIds: readonly string[]): NodeActorStageChoice;
32
52
  /**
33
53
  * The graph problems of every 依前面關卡的簽核者 node, naming the node: the
34
54
  * checks the backend publish lint runs (`readNodeActorSourceIssues`), for the
@@ -36,3 +56,26 @@ export declare function readNodeActorStageChoice(definition: WorkflowDefinition,
36
56
  * `readApproverResolverIssue`, which owns that message.
37
57
  */
38
58
  export declare function readNodeActorGraphIssues(definition: WorkflowDefinition): readonly string[];
59
+ /** The hint under the 不可與前面關卡同一人 picker while it has no problem to report. */
60
+ export declare const EXCLUDE_NODE_ACTORS_STAGE_HINT = "\u6B64\u95DC\u7684\u7C3D\u6838\u4EBA\u4E0D\u6703\u662F\u4F60\u9078\u7684\u524D\u9762\u95DC\u5361\u5BE6\u969B\u7C3D\u6838\u7684\u4EBA\uFF08\u542B\u5176\u4EE3\u7406\u4EBA\uFF09\uFF0C\u4E5F\u4E0D\u80FD\u88AB\u8F49\u7C3D\u6216\u52A0\u7C3D\u5230\u6B64\u95DC\uFF1B\u53EF\u8907\u9078\uFF0C\u6BCF\u500B\u95DC\u5361\u90FD\u6703\u6392\u9664\u3002\u53EA\u80FD\u9078\u6BCF\u689D\u8DEF\u5F91\u90FD\u6703\u7D93\u904E\u3001\u800C\u4E14\u4E00\u5B9A\u6709\u4EBA\u5BE6\u969B\u7C3D\u6838\u7684\u95DC\u5361\uFF08\u6C92\u6709\u9032\u5165\u689D\u4EF6\u3001\u6C92\u8A2D\u8DF3\u904E\u6B64\u95DC\u3001\u6C92\u8A2D\u903E\u6642\u81EA\u52D5\u6838\u51C6\uFF09\uFF1B\u689D\u4EF6\u5F0F\u7684\u95DC\u5361\u3001\u5E73\u884C\u5206\u652F\u4E0A\u7684\u95DC\u5361\u90FD\u4E0D\u652F\u63F4\uFF0C\u689D\u4EF6\u5F0F\u7684\u8ACB\u6539\u7528\u5206\u6D41\u628A\u5169\u95DC\u653E\u5728\u540C\u4E00\u689D\u8DEF\u7DDA\u4E0A\uFF0C\u5E73\u884C\u5206\u652F\u4E0A\u7684\u8ACB\u6539\u6210\u5148\u5F8C\u4E32\u63A5\u3002";
61
+ /** Shown when no earlier stage can be picked. */
62
+ export declare const NO_EXCLUDABLE_STAGE_HINT = "\u9019\u500B\u7BC0\u9EDE\u524D\u9762\u6C92\u6709\u53EF\u4EE5\u9078\u7684\u7C3D\u6838\u95DC\u5361\uFF0C\u8ACB\u5148\u5728\u5B83\u524D\u9762\u52A0\u5165\u7C3D\u6838\u7BC0\u9EDE\uFF08\u6BCF\u689D\u8DEF\u5F91\u90FD\u6703\u7D93\u904E\u3001\u6C92\u6709\u9032\u5165\u689D\u4EF6\u3001\u6C92\u8A2D\u8DF3\u904E\u6B64\u95DC\uFF0C\u4E5F\u6C92\u8A2D\u903E\u6642\u81EA\u52D5\u6838\u51C6\uFF09";
63
+ /**
64
+ * The 不可與前面關卡同一人 picker: the user tasks that pass the publish
65
+ * check on their own (`readExcludeNodeActorsIssues` with just that stage
66
+ * listed: upstream of `nodeId`, on every path to it, not skippable, a real
67
+ * signer every time). Each listed stage has to pass alone, so unlike the
68
+ * `NODE_ACTOR` picker nothing is left to the selection as a whole. A stored
69
+ * stage that does not qualify (gone, no longer upstream, or skippable) stays in
70
+ * the list, marked, and the selection's `problems` say why, so the stored
71
+ * choice is never dropped silently.
72
+ */
73
+ export declare function readExcludeNodeActorStageChoice(definition: WorkflowDefinition, nodeId: string, selectedIds: readonly string[], whenEmpty: ExcludeInitiatorWhenEmpty): NodeActorStageChoice;
74
+ /**
75
+ * The graph problems of every node with 不可與前面關卡同一人, naming the node:
76
+ * the checks the backend publish lint runs (`readExcludeNodeActorsIssues`),
77
+ * for the designer to show before publish. The shape of the setting (no stage
78
+ * chosen, no 排除後沒有簽核人時) is left to `readExcludeNodeActorsShapeIssue`,
79
+ * which blocks saving.
80
+ */
81
+ export declare function readExcludeNodeActorsGraphIssues(definition: WorkflowDefinition): readonly string[];
@@ -1,4 +1,4 @@
1
- import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
1
+ import { ExcludeInitiatorWhenEmpty, WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
2
2
  export type NodeActorOption = Readonly<{
3
3
  id: string;
4
4
  name: string;
@@ -16,6 +16,16 @@ export type NodeActorStageChoice = Readonly<{
16
16
  export declare const NO_UPSTREAM_USER_TASK_HINT = "\u9019\u500B\u7BC0\u9EDE\u524D\u9762\u6C92\u6709\u53EF\u4EE5\u9078\u7684\u7C3D\u6838\u95DC\u5361\uFF0C\u8ACB\u5148\u5728\u5B83\u524D\u9762\u52A0\u5165\u7C3D\u6838\u7BC0\u9EDE\uFF08\u6C92\u6709\u9032\u5165\u689D\u4EF6\u3001\u6C92\u8A2D\u8DF3\u904E\u6B64\u95DC\uFF0C\u4E5F\u6C92\u8A2D\u903E\u6642\u81EA\u52D5\u6838\u51C6\uFF09";
17
17
  /** The 關卡 picker's hint while the selection has no problem to report. */
18
18
  export declare const NODE_ACTOR_STAGE_HINT = "\u7C3D\u6838\u4EBA\u53D6\u81EA\u4F60\u9078\u7684\u524D\u9762\u95DC\u5361\u5BE6\u969B\u7C3D\u6838\u7684\u4EBA\uFF1B\u53EF\u8907\u9078\uFF0C\u6574\u7D44\u8981\u6DB5\u84CB\u6BCF\u689D\u8DEF\u5F91\u3002\u8907\u9078\u591A\u500B\u95DC\u5361\u6642\uFF0C\u53D6\u6700\u8FD1\u5BE6\u969B\u8D70\u5230\u7684\u90A3\u4E00\u95DC\u7684\u7C3D\u6838\u4EBA\uFF0C\u4E0D\u662F\u5168\u90E8\u95DC\u5361\u7684\u7C3D\u6838\u4EBA\u3002";
19
+ /**
20
+ * The 關卡 picker's hint for a manager chain's 前面關卡的簽核者 start, while
21
+ * the selection has no problem to report.
22
+ */
23
+ export declare const ORG_MANAGER_CHAIN_STAGE_HINT = "\u8D77\u9EDE\u662F\u4F60\u9078\u7684\u524D\u9762\u95DC\u5361\u5BE6\u969B\u7C3D\u6838\u7684\u90A3\u4E00\u4F4D\uFF0C\u5F9E\u4ED6\u7684\u4E3B\u7BA1\u958B\u59CB\u5F80\u4E0A\u7C3D\uFF1B\u53EA\u80FD\u9078\u6BCF\u6B21\u53EA\u6703\u6709\u4E00\u4F4D\u7C3D\u6838\u4EBA\u7684\u95DC\u5361\u3002\u53EF\u8907\u9078\uFF0C\u6574\u7D44\u8981\u6DB5\u84CB\u6BCF\u689D\u8DEF\u5F91\uFF0C\u53D6\u6700\u8FD1\u5BE6\u969B\u8D70\u5230\u7684\u90A3\u4E00\u95DC\u7684\u7C3D\u6838\u8005\u3002";
24
+ /**
25
+ * The 關卡 picker's hint when every stage upstream of a manager chain may end
26
+ * with several signers, so none can be the start.
27
+ */
28
+ export declare const ORG_MANAGER_CHAIN_ONLY_MULTI_APPROVER_STAGES_HINT = "\u524D\u9762\u7684\u7C3D\u6838\u95DC\u5361\u90FD\u53EF\u80FD\u6709\u591A\u4F4D\u7C3D\u6838\u4EBA\uFF0C\u6240\u4EE5\u4E0D\u80FD\u7576\u4E3B\u7BA1\u93C8\u7684\u8D77\u9EDE\uFF1B\u8ACB\u6539\u7528\u53EA\u6709\u4E00\u4F4D\u7C3D\u6838\u4EBA\u7684\u95DC\u5361\uFF0C\u6216\u6539\u9078\u5176\u4ED6\u8D77\u9EDE\u3002";
19
29
  /**
20
30
  * The 關卡 picker of 依前面關卡的簽核者: the user tasks upstream of `nodeId`
21
31
  * that always end with a real signer (`readNodeActorSourceSkipReasons` is
@@ -29,6 +39,16 @@ export declare const NODE_ACTOR_STAGE_HINT = "\u7C3D\u6838\u4EBA\u53D6\u81EA\u4F
29
39
  * stored choice stays visible until the author fixes it.
30
40
  */
31
41
  export declare function readNodeActorStageChoice(definition: WorkflowDefinition, nodeId: string, selectedIds: readonly string[]): NodeActorStageChoice;
42
+ /**
43
+ * The 關卡 picker of a manager chain's 前面關卡的簽核者 start: the same stages
44
+ * as {@link readNodeActorStageChoice} offers, minus the ones that may end with
45
+ * several signers. The chain climbs from one person, so a stage that
46
+ * `canUserTaskHaveMultipleApprovers` is not offered (a 並行全部同意 stage still
47
+ * is for 依前面關卡的簽核者, which takes everyone). A stored stage of that kind
48
+ * stays in the list, marked, and the selection's problems include the
49
+ * single-signer rule the publish lint runs (`readSingleApproverSourceIssues`).
50
+ */
51
+ export declare function readOrgManagerChainStageChoice(definition: WorkflowDefinition, nodeId: string, selectedIds: readonly string[]): NodeActorStageChoice;
32
52
  /**
33
53
  * The graph problems of every 依前面關卡的簽核者 node, naming the node: the
34
54
  * checks the backend publish lint runs (`readNodeActorSourceIssues`), for the
@@ -36,3 +56,26 @@ export declare function readNodeActorStageChoice(definition: WorkflowDefinition,
36
56
  * `readApproverResolverIssue`, which owns that message.
37
57
  */
38
58
  export declare function readNodeActorGraphIssues(definition: WorkflowDefinition): readonly string[];
59
+ /** The hint under the 不可與前面關卡同一人 picker while it has no problem to report. */
60
+ export declare const EXCLUDE_NODE_ACTORS_STAGE_HINT = "\u6B64\u95DC\u7684\u7C3D\u6838\u4EBA\u4E0D\u6703\u662F\u4F60\u9078\u7684\u524D\u9762\u95DC\u5361\u5BE6\u969B\u7C3D\u6838\u7684\u4EBA\uFF08\u542B\u5176\u4EE3\u7406\u4EBA\uFF09\uFF0C\u4E5F\u4E0D\u80FD\u88AB\u8F49\u7C3D\u6216\u52A0\u7C3D\u5230\u6B64\u95DC\uFF1B\u53EF\u8907\u9078\uFF0C\u6BCF\u500B\u95DC\u5361\u90FD\u6703\u6392\u9664\u3002\u53EA\u80FD\u9078\u6BCF\u689D\u8DEF\u5F91\u90FD\u6703\u7D93\u904E\u3001\u800C\u4E14\u4E00\u5B9A\u6709\u4EBA\u5BE6\u969B\u7C3D\u6838\u7684\u95DC\u5361\uFF08\u6C92\u6709\u9032\u5165\u689D\u4EF6\u3001\u6C92\u8A2D\u8DF3\u904E\u6B64\u95DC\u3001\u6C92\u8A2D\u903E\u6642\u81EA\u52D5\u6838\u51C6\uFF09\uFF1B\u689D\u4EF6\u5F0F\u7684\u95DC\u5361\u3001\u5E73\u884C\u5206\u652F\u4E0A\u7684\u95DC\u5361\u90FD\u4E0D\u652F\u63F4\uFF0C\u689D\u4EF6\u5F0F\u7684\u8ACB\u6539\u7528\u5206\u6D41\u628A\u5169\u95DC\u653E\u5728\u540C\u4E00\u689D\u8DEF\u7DDA\u4E0A\uFF0C\u5E73\u884C\u5206\u652F\u4E0A\u7684\u8ACB\u6539\u6210\u5148\u5F8C\u4E32\u63A5\u3002";
61
+ /** Shown when no earlier stage can be picked. */
62
+ export declare const NO_EXCLUDABLE_STAGE_HINT = "\u9019\u500B\u7BC0\u9EDE\u524D\u9762\u6C92\u6709\u53EF\u4EE5\u9078\u7684\u7C3D\u6838\u95DC\u5361\uFF0C\u8ACB\u5148\u5728\u5B83\u524D\u9762\u52A0\u5165\u7C3D\u6838\u7BC0\u9EDE\uFF08\u6BCF\u689D\u8DEF\u5F91\u90FD\u6703\u7D93\u904E\u3001\u6C92\u6709\u9032\u5165\u689D\u4EF6\u3001\u6C92\u8A2D\u8DF3\u904E\u6B64\u95DC\uFF0C\u4E5F\u6C92\u8A2D\u903E\u6642\u81EA\u52D5\u6838\u51C6\uFF09";
63
+ /**
64
+ * The 不可與前面關卡同一人 picker: the user tasks that pass the publish
65
+ * check on their own (`readExcludeNodeActorsIssues` with just that stage
66
+ * listed: upstream of `nodeId`, on every path to it, not skippable, a real
67
+ * signer every time). Each listed stage has to pass alone, so unlike the
68
+ * `NODE_ACTOR` picker nothing is left to the selection as a whole. A stored
69
+ * stage that does not qualify (gone, no longer upstream, or skippable) stays in
70
+ * the list, marked, and the selection's `problems` say why, so the stored
71
+ * choice is never dropped silently.
72
+ */
73
+ export declare function readExcludeNodeActorStageChoice(definition: WorkflowDefinition, nodeId: string, selectedIds: readonly string[], whenEmpty: ExcludeInitiatorWhenEmpty): NodeActorStageChoice;
74
+ /**
75
+ * The graph problems of every node with 不可與前面關卡同一人, naming the node:
76
+ * the checks the backend publish lint runs (`readExcludeNodeActorsIssues`),
77
+ * for the designer to show before publish. The shape of the setting (no stage
78
+ * chosen, no 排除後沒有簽核人時) is left to `readExcludeNodeActorsShapeIssue`,
79
+ * which blocks saving.
80
+ */
81
+ export declare function readExcludeNodeActorsGraphIssues(definition: WorkflowDefinition): readonly string[];
@@ -0,0 +1,81 @@
1
+ import { ApproverResolver, ServiceAction } from '@rytass/bpm-core-shared/workflow';
2
+ import { PositionRecord } from '@rytass/bpm-core-client/organization';
3
+ import { ApproverResolverModeOption } from './approver-resolver-model.cjs';
4
+ /**
5
+ * The 知會對象 sources the designer can edit. The engine accepts more for a
6
+ * notify node (`isNotifyRecipientResolverType`): 發起人主管, 主管鏈 and 運算式
7
+ * stay readable and are kept as saved, but the designer does not edit them.
8
+ *
9
+ * Keyed by the JSON `type`, not by the approver panel's screen option: that
10
+ * option folds FORM_MEMBER_MANAGER into 依表單欄位指定 and
11
+ * FORM_ORG_UNIT_MANAGER into 指定組織主管, neither of which a notify node
12
+ * may use.
13
+ */
14
+ export type NotifyRecipientMode = Extract<ApproverResolver['type'], 'DIRECT' | 'DYNAMIC_FORM' | 'ORG_UNIT_MANAGER' | 'ORG_UNIT_MEMBER' | 'ORG_UNIT_POSITION' | 'POSITION'>;
15
+ export declare function isNotifyRecipientEditableType(type: string): type is NotifyRecipientMode;
16
+ /**
17
+ * The editable sources, worded exactly as the 簽核來源 select words them so
18
+ * the two panels never name one source two ways.
19
+ */
20
+ export declare const NOTIFY_RECIPIENT_MODE_OPTIONS: readonly ApproverResolverModeOption[];
21
+ /** The id of the read-only entry a source the designer does not edit is shown as. */
22
+ export declare const READ_ONLY_NOTIFY_RECIPIENT_OPTION_ID = "READ_ONLY";
23
+ /** The recipients of a notify action; the empty 指定會員 when it has none. */
24
+ export declare const EMPTY_NOTIFY_RECIPIENTS: ApproverResolver;
25
+ /**
26
+ * A notify action's recipients, or the empty 指定會員 for an action that is
27
+ * not a notify yet (the panel is also what turns one into a notify) or that
28
+ * carries no readable recipients (raw JSON that has not been linted).
29
+ */
30
+ export declare function readNotifyRecipients(action: ServiceAction): ApproverResolver;
31
+ export type NotifyRecipientSourceChoice = Readonly<{
32
+ /** Hint under the select, `null` when nothing needs saying. */
33
+ hint: string | null;
34
+ options: readonly Readonly<{
35
+ id: string;
36
+ name: string;
37
+ }>[];
38
+ /** `true` when the stored source is not one the designer edits. */
39
+ readOnly: boolean;
40
+ selected: Readonly<{
41
+ id: string;
42
+ name: string;
43
+ }>;
44
+ }>;
45
+ /**
46
+ * The 知會對象來源 select. A stored source the designer does not edit
47
+ * (發起人主管, 主管鏈, 運算式, one a notify node may not use, or one a newer
48
+ * BPMCore saved) is shown as a read-only entry that is the current value:
49
+ * nothing is written unless the author explicitly picks another source.
50
+ */
51
+ export declare function readNotifyRecipientSourceChoice(recipients: ApproverResolver): NotifyRecipientSourceChoice;
52
+ /**
53
+ * The recipients a 知會對象來源 pick produces, or `null` when the pick must
54
+ * change nothing: no option, an id that is not an editable source (the
55
+ * read-only entry included), or the source already stored. Re-picking the
56
+ * shown source would otherwise rebuild a clean default and wipe what the
57
+ * author had filled in.
58
+ */
59
+ export declare function readNotifyRecipientSourcePick(recipients: ApproverResolver, optionId: string | null, positions: readonly PositionRecord[]): ApproverResolver | null;
60
+ /**
61
+ * The action with new recipients. Only the recipients change: channels,
62
+ * template and webhooks belong to the same action and survive. An action that
63
+ * is not a notify yet becomes one with the default channel.
64
+ */
65
+ export declare function withNotifyRecipients(action: ServiceAction, recipients: ApproverResolver): ServiceAction;
66
+ /**
67
+ * Picks the organization. 組織特定職位 clears its position (it may not belong
68
+ * to the new organization); 指定組織主管 goes through the approver editor
69
+ * state so its 無主管時 and 只取最近一層主管 settings survive.
70
+ */
71
+ export declare function withNotifyOrgUnit(recipients: ApproverResolver, orgUnitId: string): ApproverResolver;
72
+ /**
73
+ * Switches 包含下層 of 組織任一人 or 組織特定職位; the latter clears its
74
+ * position, the way the 簽核來源 panel does, because the positions on offer
75
+ * change with the scope.
76
+ */
77
+ export declare function withNotifyIncludeDescendants(recipients: ApproverResolver, includeDescendants: boolean): ApproverResolver;
78
+ /** Picks the position of 指定職位 or 組織特定職位. */
79
+ export declare function withNotifyPosition(recipients: ApproverResolver, positionId: string): ApproverResolver;
80
+ /** Picks the member field of 依表單欄位指定 (the person in the field only). */
81
+ export declare function withNotifyFormPath(recipients: ApproverResolver, formPath: string): ApproverResolver;
@@ -0,0 +1,81 @@
1
+ import { ApproverResolver, ServiceAction } from '@rytass/bpm-core-shared/workflow';
2
+ import { PositionRecord } from '@rytass/bpm-core-client/organization';
3
+ import { ApproverResolverModeOption } from './approver-resolver-model.js';
4
+ /**
5
+ * The 知會對象 sources the designer can edit. The engine accepts more for a
6
+ * notify node (`isNotifyRecipientResolverType`): 發起人主管, 主管鏈 and 運算式
7
+ * stay readable and are kept as saved, but the designer does not edit them.
8
+ *
9
+ * Keyed by the JSON `type`, not by the approver panel's screen option: that
10
+ * option folds FORM_MEMBER_MANAGER into 依表單欄位指定 and
11
+ * FORM_ORG_UNIT_MANAGER into 指定組織主管, neither of which a notify node
12
+ * may use.
13
+ */
14
+ export type NotifyRecipientMode = Extract<ApproverResolver['type'], 'DIRECT' | 'DYNAMIC_FORM' | 'ORG_UNIT_MANAGER' | 'ORG_UNIT_MEMBER' | 'ORG_UNIT_POSITION' | 'POSITION'>;
15
+ export declare function isNotifyRecipientEditableType(type: string): type is NotifyRecipientMode;
16
+ /**
17
+ * The editable sources, worded exactly as the 簽核來源 select words them so
18
+ * the two panels never name one source two ways.
19
+ */
20
+ export declare const NOTIFY_RECIPIENT_MODE_OPTIONS: readonly ApproverResolverModeOption[];
21
+ /** The id of the read-only entry a source the designer does not edit is shown as. */
22
+ export declare const READ_ONLY_NOTIFY_RECIPIENT_OPTION_ID = "READ_ONLY";
23
+ /** The recipients of a notify action; the empty 指定會員 when it has none. */
24
+ export declare const EMPTY_NOTIFY_RECIPIENTS: ApproverResolver;
25
+ /**
26
+ * A notify action's recipients, or the empty 指定會員 for an action that is
27
+ * not a notify yet (the panel is also what turns one into a notify) or that
28
+ * carries no readable recipients (raw JSON that has not been linted).
29
+ */
30
+ export declare function readNotifyRecipients(action: ServiceAction): ApproverResolver;
31
+ export type NotifyRecipientSourceChoice = Readonly<{
32
+ /** Hint under the select, `null` when nothing needs saying. */
33
+ hint: string | null;
34
+ options: readonly Readonly<{
35
+ id: string;
36
+ name: string;
37
+ }>[];
38
+ /** `true` when the stored source is not one the designer edits. */
39
+ readOnly: boolean;
40
+ selected: Readonly<{
41
+ id: string;
42
+ name: string;
43
+ }>;
44
+ }>;
45
+ /**
46
+ * The 知會對象來源 select. A stored source the designer does not edit
47
+ * (發起人主管, 主管鏈, 運算式, one a notify node may not use, or one a newer
48
+ * BPMCore saved) is shown as a read-only entry that is the current value:
49
+ * nothing is written unless the author explicitly picks another source.
50
+ */
51
+ export declare function readNotifyRecipientSourceChoice(recipients: ApproverResolver): NotifyRecipientSourceChoice;
52
+ /**
53
+ * The recipients a 知會對象來源 pick produces, or `null` when the pick must
54
+ * change nothing: no option, an id that is not an editable source (the
55
+ * read-only entry included), or the source already stored. Re-picking the
56
+ * shown source would otherwise rebuild a clean default and wipe what the
57
+ * author had filled in.
58
+ */
59
+ export declare function readNotifyRecipientSourcePick(recipients: ApproverResolver, optionId: string | null, positions: readonly PositionRecord[]): ApproverResolver | null;
60
+ /**
61
+ * The action with new recipients. Only the recipients change: channels,
62
+ * template and webhooks belong to the same action and survive. An action that
63
+ * is not a notify yet becomes one with the default channel.
64
+ */
65
+ export declare function withNotifyRecipients(action: ServiceAction, recipients: ApproverResolver): ServiceAction;
66
+ /**
67
+ * Picks the organization. 組織特定職位 clears its position (it may not belong
68
+ * to the new organization); 指定組織主管 goes through the approver editor
69
+ * state so its 無主管時 and 只取最近一層主管 settings survive.
70
+ */
71
+ export declare function withNotifyOrgUnit(recipients: ApproverResolver, orgUnitId: string): ApproverResolver;
72
+ /**
73
+ * Switches 包含下層 of 組織任一人 or 組織特定職位; the latter clears its
74
+ * position, the way the 簽核來源 panel does, because the positions on offer
75
+ * change with the scope.
76
+ */
77
+ export declare function withNotifyIncludeDescendants(recipients: ApproverResolver, includeDescendants: boolean): ApproverResolver;
78
+ /** Picks the position of 指定職位 or 組織特定職位. */
79
+ export declare function withNotifyPosition(recipients: ApproverResolver, positionId: string): ApproverResolver;
80
+ /** Picks the member field of 依表單欄位指定 (the person in the field only). */
81
+ export declare function withNotifyFormPath(recipients: ApproverResolver, formPath: string): ApproverResolver;
@@ -10,8 +10,10 @@ type PositionLevelSource = Pick<PositionRecord, 'level' | 'name'>;
10
10
  * labelled with the positions sitting on that level. A saved level that no
11
11
  * position carries (positions deleted or not loaded yet) is still offered so
12
12
  * the select never renders blank and the stored value is not silently changed.
13
+ * `currentLevel` is that saved level; `null` offers only the directory's own
14
+ * levels, for a field that has no value yet.
13
15
  */
14
- export declare function readMinPositionLevelOptions(positions: readonly PositionLevelSource[], currentLevel: number): readonly PositionLevelOption[];
16
+ export declare function readMinPositionLevelOptions(positions: readonly PositionLevelSource[], currentLevel: number | null): readonly PositionLevelOption[];
15
17
  /** The highest level in the directory, or `1` when there are no positions. */
16
18
  export declare function readDefaultMinPositionLevel(positions: readonly PositionLevelSource[]): number;
17
19
  export {};
@@ -10,8 +10,10 @@ type PositionLevelSource = Pick<PositionRecord, 'level' | 'name'>;
10
10
  * labelled with the positions sitting on that level. A saved level that no
11
11
  * position carries (positions deleted or not loaded yet) is still offered so
12
12
  * the select never renders blank and the stored value is not silently changed.
13
+ * `currentLevel` is that saved level; `null` offers only the directory's own
14
+ * levels, for a field that has no value yet.
13
15
  */
14
- export declare function readMinPositionLevelOptions(positions: readonly PositionLevelSource[], currentLevel: number): readonly PositionLevelOption[];
16
+ export declare function readMinPositionLevelOptions(positions: readonly PositionLevelSource[], currentLevel: number | null): readonly PositionLevelOption[];
15
17
  /** The highest level in the directory, or `1` when there are no positions. */
16
18
  export declare function readDefaultMinPositionLevel(positions: readonly PositionLevelSource[]): number;
17
19
  export {};
@@ -0,0 +1,51 @@
1
+ import { MembershipRecord, OrgUnitRecord, PositionRecord } from '@rytass/bpm-core-client/organization';
2
+ /**
3
+ * Today as `YYYY-MM-DD` in the organization zone, the clock the designer's
4
+ * pickers and dry run share. Mirrors the engine's `formatDateOnlyInTimeZone`;
5
+ * a UTC date is one day behind Taipei between 00:00 and 08:00. `timeZone`
6
+ * must already be resolved (see `useBPMOrganizationTimeZone`).
7
+ */
8
+ export declare function readTodayDateOnlyString(now?: Date, timeZone?: string): string;
9
+ /**
10
+ * Today in the host's organization zone (`organizationTimeZone` on the BPM
11
+ * providers, the value the engine's `BPMRootModule` is given), read on every
12
+ * render, so the designer judges effective dates on the engine's day.
13
+ */
14
+ export declare function useOrganizationTodayDateOnlyString(): string;
15
+ export declare function isMembershipActiveOn(membership: Pick<MembershipRecord, 'effectiveFrom' | 'effectiveTo'>, date: string): boolean;
16
+ /**
17
+ * The positions at least one member holds through a membership that is in
18
+ * effect on `date`. The engine resolves a position or an organization position
19
+ * only through such members, so a position outside this set has nobody to
20
+ * notify or assign.
21
+ */
22
+ export declare function readActivePositionIds(memberships: readonly MembershipRecord[], date: string): ReadonlySet<string>;
23
+ /**
24
+ * The positions an organization-scoped picker offers: those held by a member
25
+ * effective on `date` inside the organization scope. Memberships that have
26
+ * ended or not started yet do not count, the same rule the engine applies.
27
+ */
28
+ export declare function readOrgScopedPositions({ date, includeDescendants, memberships, orgUnitId, orgUnits, positions, }: {
29
+ readonly date: string;
30
+ readonly includeDescendants: boolean;
31
+ readonly memberships: readonly MembershipRecord[];
32
+ readonly orgUnitId: string;
33
+ readonly orgUnits: readonly OrgUnitRecord[];
34
+ readonly positions: readonly PositionRecord[];
35
+ }): readonly PositionRecord[];
36
+ /**
37
+ * Options for an organization-scoped position picker, and whether the stored
38
+ * position has no effective holder in that scope. A stored position outside
39
+ * the scope stays in the options (and so selected), as the POSITION picker
40
+ * keeps an inactive one, so the author sees what the engine will not resolve.
41
+ */
42
+ export declare function readOrgPositionPickerState({ orgUnitId, positionId, positions, scopedPositions, }: {
43
+ readonly orgUnitId: string;
44
+ readonly positionId: string;
45
+ readonly positions: readonly PositionRecord[];
46
+ readonly scopedPositions: readonly PositionRecord[];
47
+ }): {
48
+ readonly isInactive: boolean;
49
+ readonly options: readonly PositionRecord[];
50
+ };
51
+ export declare function readOrgUnitScopeIds(orgUnits: readonly OrgUnitRecord[], orgUnitId: string, includeDescendants: boolean): readonly string[];
@@ -0,0 +1,51 @@
1
+ import { MembershipRecord, OrgUnitRecord, PositionRecord } from '@rytass/bpm-core-client/organization';
2
+ /**
3
+ * Today as `YYYY-MM-DD` in the organization zone, the clock the designer's
4
+ * pickers and dry run share. Mirrors the engine's `formatDateOnlyInTimeZone`;
5
+ * a UTC date is one day behind Taipei between 00:00 and 08:00. `timeZone`
6
+ * must already be resolved (see `useBPMOrganizationTimeZone`).
7
+ */
8
+ export declare function readTodayDateOnlyString(now?: Date, timeZone?: string): string;
9
+ /**
10
+ * Today in the host's organization zone (`organizationTimeZone` on the BPM
11
+ * providers, the value the engine's `BPMRootModule` is given), read on every
12
+ * render, so the designer judges effective dates on the engine's day.
13
+ */
14
+ export declare function useOrganizationTodayDateOnlyString(): string;
15
+ export declare function isMembershipActiveOn(membership: Pick<MembershipRecord, 'effectiveFrom' | 'effectiveTo'>, date: string): boolean;
16
+ /**
17
+ * The positions at least one member holds through a membership that is in
18
+ * effect on `date`. The engine resolves a position or an organization position
19
+ * only through such members, so a position outside this set has nobody to
20
+ * notify or assign.
21
+ */
22
+ export declare function readActivePositionIds(memberships: readonly MembershipRecord[], date: string): ReadonlySet<string>;
23
+ /**
24
+ * The positions an organization-scoped picker offers: those held by a member
25
+ * effective on `date` inside the organization scope. Memberships that have
26
+ * ended or not started yet do not count, the same rule the engine applies.
27
+ */
28
+ export declare function readOrgScopedPositions({ date, includeDescendants, memberships, orgUnitId, orgUnits, positions, }: {
29
+ readonly date: string;
30
+ readonly includeDescendants: boolean;
31
+ readonly memberships: readonly MembershipRecord[];
32
+ readonly orgUnitId: string;
33
+ readonly orgUnits: readonly OrgUnitRecord[];
34
+ readonly positions: readonly PositionRecord[];
35
+ }): readonly PositionRecord[];
36
+ /**
37
+ * Options for an organization-scoped position picker, and whether the stored
38
+ * position has no effective holder in that scope. A stored position outside
39
+ * the scope stays in the options (and so selected), as the POSITION picker
40
+ * keeps an inactive one, so the author sees what the engine will not resolve.
41
+ */
42
+ export declare function readOrgPositionPickerState({ orgUnitId, positionId, positions, scopedPositions, }: {
43
+ readonly orgUnitId: string;
44
+ readonly positionId: string;
45
+ readonly positions: readonly PositionRecord[];
46
+ readonly scopedPositions: readonly PositionRecord[];
47
+ }): {
48
+ readonly isInactive: boolean;
49
+ readonly options: readonly PositionRecord[];
50
+ };
51
+ export declare function readOrgUnitScopeIds(orgUnits: readonly OrgUnitRecord[], orgUnitId: string, includeDescendants: boolean): readonly string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rytass/bpm-core-react",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "BPM approval workflow React components and views for the Rytass BPM stack. Ships AuthProvider, NotificationDrawer + bell widget, host-facing hooks (useBPMMember / useBPMLogout / useBPMRoutes), and full page-body views for inbox / instances / templates / forms / admin / settings on top of Mezzanine UI and the BPM client functions. The host owns the navigation shell — BPM does not bundle a layout.",
5
5
  "keywords": [
6
6
  "bpm",
@@ -536,8 +536,8 @@
536
536
  "@mezzanine-ui/core": ">=1.0.0",
537
537
  "@mezzanine-ui/icons": ">=1.0.0",
538
538
  "@mezzanine-ui/react": ">=1.0.0",
539
- "@rytass/bpm-core-client": "^0.21.0",
540
- "@rytass/bpm-core-shared": "^0.21.0",
539
+ "@rytass/bpm-core-client": "^0.21.1",
540
+ "@rytass/bpm-core-shared": "^0.21.1",
541
541
  "@uiw/react-codemirror": ">=4.0.0",
542
542
  "@xyflow/react": ">=12.0.0",
543
543
  "ai": ">=6.0.0",
@@ -1,2 +0,0 @@
1
- "use client";const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./router-adapter--gYs13E8.cjs"),n=require("./routes-config-C1j_vFKo.cjs"),r=require("./FormBuilderView-DjPGrOJ2.cjs"),i=require("./FormRendererView-B-xycC9S.cjs"),a=require("./designer-C_m8DmMl.cjs"),o=require("./language-provider-Bdnx3Gxl.cjs");let s=require("react"),c=require("@mezzanine-ui/react"),l=require("react/jsx-runtime"),u=require("@mezzanine-ui/core/form"),d=require("@mezzanine-ui/react/ContentHeader");d=e.t(d,1);let f=require("@rytass/bpm-core-client/template");var p={id:`UNCATEGORIZED`,name:`未分類`},m=100;function h({categoryId:e,formSchema:t,formUiSchema:n,name:i,onCategoryIdChange:a,onFormChange:o,onNameChange:d}){let[h,_]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await(0,f.listApprovalTemplateCategoriesPage)({page:1,pageSize:m,searchText:``,status:`ACTIVE`});e&&_(t.categories)}catch{e&&_([])}})(),()=>{e=!1}},[]);let v=[p,...h.map(e=>({id:e.id,name:e.name}))],y=v.find(t=>t.id===e)??p;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{style:g,children:[(0,l.jsx)(c.FormField,{label:`名稱`,layout:u.FormFieldLayout.VERTICAL,name:`composeName`,children:(0,l.jsx)(c.Input,{fullWidth:!0,onChange:e=>d(e.target.value),placeholder:`例如:請款簽核`,value:i})}),(0,l.jsx)(c.FormField,{label:`分類(選填)`,layout:u.FormFieldLayout.VERTICAL,name:`composeCategory`,children:(0,l.jsx)(c.Select,{clearable:!1,fullWidth:!0,onChange:e=>a(e&&e.id!==p.id?e.id:null),options:v,placeholder:`未分類`,value:y})})]}),(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`caption`,children:`先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。`}),(0,l.jsx)(r.t,{onChange:o,value:{schema:t,uiSchema:n}})]})}var g={display:`grid`,gap:16,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`};function _({formSchema:e,formUiSchema:t,initiatorPolicyCel:n,name:r,publishError:a,workflowDefinition:o}){let s=o?.nodes??[],u=o?.edges??[],d=e.fields.length,f=new Map(s.map(e=>[e.id,e.data.label])),p=s.map(e=>({detail:x(e)??`—`,key:e.id,label:e.data.label,typeLabel:b(e)})),m=u.filter(e=>!!e.data.condition).map(e=>({condition:e.data.condition??``,key:e.id,source:f.get(e.source)??e.source,target:f.get(e.target)??e.target}));return(0,l.jsxs)(`div`,{style:S,children:[(0,l.jsx)(c.Typography,{component:`h2`,style:C,variant:`h2`,children:r||`(未命名)`}),(0,l.jsxs)(`div`,{style:S,children:[(0,l.jsx)(c.Typography,{variant:`h3`,children:`表單預覽`}),d>0?(0,l.jsx)(i.t,{dataSourceContext:{kind:`preview`},readonly:!0,schema:e,uiSchema:t}):(0,l.jsx)(c.Empty,{title:`尚未設計表單欄位`})]}),(0,l.jsxs)(`div`,{style:S,children:[(0,l.jsx)(c.Typography,{variant:`h3`,children:`流程概覽`}),s.length>0?(0,l.jsx)(c.Table,{columns:v,dataSource:p,fullWidth:!0}):(0,l.jsx)(c.Empty,{title:`尚未設計流程節點`}),m.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`caption`,children:`條件分流`}),(0,l.jsx)(c.Table,{columns:y,dataSource:m,fullWidth:!0})]}):null,n?(0,l.jsxs)(c.Typography,{color:`text-neutral`,variant:`caption`,children:[`發起權限:`,n]}):null]}),a?(0,l.jsx)(c.Typography,{color:`text-error`,variant:`body`,children:a}):null]})}var v=[{key:`type`,render:e=>(0,l.jsx)(c.Tag,{label:e.typeLabel,size:`sub`,type:`static`}),title:`類型`,width:130},{dataIndex:`label`,key:`label`,title:`節點`},{dataIndex:`detail`,key:`detail`,title:`簽核方式`,width:160}],y=[{dataIndex:`source`,key:`source`,title:`來源`,width:180},{dataIndex:`target`,key:`target`,title:`目標`,width:180},{dataIndex:`condition`,key:`condition`,title:`條件`}];function b(e){switch(e.type){case`startEvent`:return`開始`;case`endEvent`:return e.data.endState===`REJECTED`?`結束(駁回)`:`結束(核准)`;case`userTask`:return`簽核`;case`serviceTask`:return`服務`;case`exclusiveGateway`:return`條件閘道`;case`parallelGateway`:return`平行閘道`;default:return`節點`}}function x(e){return e.type===`userTask`?a.r(e.data.approverResolver):null}var S={display:`grid`,gap:12},C={marginTop:`var(--mzn-spacing-padding-vertical-spacious)`};function w({aiAssistantAvailable:e=!1,formSchema:t,initiatorPolicyCel:n,onInitiatorPolicyChange:r,onWorkflowChange:i,showAiAssistant:o=!1,workflowDefinition:s}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`caption`,children:`設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。`}),(0,l.jsx)(a.t,{aiAssistantAvailable:e,embedded:!0,formSchemaOverride:t,initialInitiatorPolicyCel:n,initialWorkflowDefinition:s??void 0,onInitiatorPolicyChange:r,onWorkflowChange:i,showAiAssistant:o})]})}var T={fields:[],schemaVersion:1},E={layout:[],schemaVersion:1};function D(){let e=o.i(),[t,n]=(0,s.useState)(0),[r,i]=(0,s.useState)(``),[c,l]=(0,s.useState)(null),[u,d]=(0,s.useState)(T),[p,m]=(0,s.useState)(E),[h,g]=(0,s.useState)(null),[_,v]=(0,s.useState)(null),[y,b]=(0,s.useState)(`idle`),[x,S]=(0,s.useState)(null),C=r.trim().length>0&&u.fields.length>0,w=(0,s.useCallback)(e=>{n(e)},[]),D=(0,s.useCallback)(()=>{n(e=>e<2?e+1:e)},[]),k=(0,s.useCallback)(()=>{n(e=>e>0?e-1:e)},[]),A=(0,s.useCallback)(e=>{d(e.schema),m(e.uiSchema)},[]),j=(0,s.useCallback)(e=>{g(e)},[]),M=(0,s.useCallback)(e=>{v(e)},[]);return{canLeaveBasics:C,categoryId:c,currentStep:t,formSchema:u,formUiSchema:p,goBack:k,goNext:D,goToStep:w,initiatorPolicyCel:_,name:r,publish:(0,s.useCallback)(async()=>{b(`submitting`),S(null);let t=h??O;try{let e=await(0,f.composeApprovalTemplateWithForm)({category:null,categoryId:c,formDefinitionId:null,formDescription:null,formName:r,initiatorPolicyCel:_,notificationConfig:null,publish:!0,schema:u,slaDefaults:null,templateDescription:null,templateId:null,templateName:r,uiSchema:p,workflowDefinition:t});return b(`success`),e}catch(n){return S(a.n(n,e,t)),b(`error`),null}},[c,u,p,_,e,r,h]),publishError:x,publishPhase:y,setCategoryId:l,setFormValue:A,setInitiatorPolicyCel:M,setName:i,setWorkflowDefinition:j,workflowDefinition:h}}var O={edges:[],expressionDialect:`cel-v2`,meta:{schemaVersion:1},nodes:[{data:{label:`開始`},id:`start`,position:{x:80,y:160},type:`startEvent`},{data:{endState:`APPROVED`,label:`完成`,triggerMode:`AND`},id:`end`,position:{x:560,y:160},type:`endEvent`}]};function k({aiAssistantAvailable:e=!1,showAiAssistant:r=!1}={}){let i=t.r(),a=n.r(),o=D(),s=o.publishPhase===`submitting`;async function u(){let e=await o.publish();e&&i.push(a.templateDesigner(e.templateId))}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:`一次完成表單與流程設計,發佈後即可直接發起。`,title:`建立模板(表單 + 流程)`,children:(0,l.jsx)(c.Button,{disabled:s,onClick:()=>i.push(a.templates()),variant:`base-secondary`,children:`返回模板列表`})})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsxs)(c.Section,{children:[(0,l.jsxs)(c.Stepper,{currentStep:o.currentStep,children:[(0,l.jsx)(c.Step,{description:`設計欄位與版面`,title:`表單設計`}),(0,l.jsx)(c.Step,{description:`設計簽核節點與條件`,title:`流程設計`}),(0,l.jsx)(c.Step,{description:`確認後發佈`,title:`檢視並發佈`})]}),o.currentStep===0?(0,l.jsx)(h,{categoryId:o.categoryId,formSchema:o.formSchema,formUiSchema:o.formUiSchema,name:o.name,onCategoryIdChange:o.setCategoryId,onFormChange:o.setFormValue,onNameChange:o.setName}):null,o.currentStep===1?(0,l.jsx)(w,{aiAssistantAvailable:e,formSchema:o.formSchema,initiatorPolicyCel:o.initiatorPolicyCel,onInitiatorPolicyChange:o.setInitiatorPolicyCel,onWorkflowChange:o.setWorkflowDefinition,showAiAssistant:r,workflowDefinition:o.workflowDefinition}):null,o.currentStep===2?(0,l.jsx)(_,{formSchema:o.formSchema,formUiSchema:o.formUiSchema,initiatorPolicyCel:o.initiatorPolicyCel,name:o.name,publishError:o.publishError,workflowDefinition:o.workflowDefinition}):null,(0,l.jsxs)(`div`,{style:A,children:[o.currentStep===0&&!o.canLeaveBasics?(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`caption`,children:`請填寫模板名稱、表單名稱,並至少新增一個表單欄位。`}):(0,l.jsx)(`span`,{}),(0,l.jsxs)(`div`,{style:j,children:[(0,l.jsx)(c.Button,{disabled:o.currentStep===0||s,onClick:o.goBack,variant:`base-secondary`,children:`上一步`}),o.currentStep<2?(0,l.jsx)(c.Button,{disabled:o.currentStep===0&&!o.canLeaveBasics,onClick:o.goNext,variant:`base-primary`,children:`下一步`}):(0,l.jsx)(c.Button,{disabled:s,loading:s,onClick:()=>{u()},variant:`base-primary`,children:`發佈`})]})]})]})})]})}var A={alignItems:`center`,display:`flex`,marginTop:`var(--mzn-spacing-padding-vertical-spacious)`,justifyContent:`space-between`,gap:16},j={display:`flex`,gap:8};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return k}});
2
- //# sourceMappingURL=compose-BKUTsB2W.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compose-BKUTsB2W.cjs","names":["useState","listApprovalTemplateCategoriesPage","_Fragment","FormField","FormFieldLayout","Input","Select","Typography","FormBuilderView","Typography","FormRenderer","Empty","Table","_Fragment","Tag","readApproverResolverDetail","_Fragment","Typography","TemplateDesignerView","useBPMLanguage","useState","useCallback","composeApprovalTemplateWithForm","readTemplateErrorMessage","useRouterAdapter","useBPMRoutes","_Fragment","PageHeader","ContentHeader","Button","SectionGroup","Section","Stepper","Step","Typography","require_rolldown_runtime","require_router_adapter","require_routes_config","require_FormBuilderView","require_FormRendererView","require_designer","require_language_provider","react","_mezzanine_ui_react","react_jsx_runtime","_mezzanine_ui_core_form","_mezzanine_ui_react_ContentHeader","_rytass_bpm_core_client_template","UNCATEGORIZED_OPTION","CATEGORY_PAGE_SIZE","ComposeFormStep","categoryOptions","setCategoryOptions","active","result","selectOptions","category","selectedOption","option","categoryId","BASICS_GRID_STYLE","onNameChange","event","name","onCategoryIdChange","onFormChange","formSchema","formUiSchema","ComposeReviewStep","nodes","workflowDefinition","edges","fieldCount","nodeLabelById","node","nodeRows","readNodeDetail","readNodeTypeLabel","branchRows","edge","STACK_STYLE","TITLE_STYLE","NODE_COLUMNS","BRANCH_COLUMNS","initiatorPolicyCel","publishError","record","ComposeWorkflowStep","EMPTY_COMPOSE_FORM_SCHEMA","EMPTY_COMPOSE_FORM_UI_SCHEMA","useTemplateComposeWizard","language","currentStep","setCurrentStep","setName","setCategoryId","setFormSchema","setFormUiSchema","setWorkflowDefinitionState","setInitiatorPolicyCelState","publishPhase","setPublishPhase","setPublishError","canLeaveBasics","goToStep","step","goNext","goBack","setFormValue","next","setWorkflowDefinition","definition","setInitiatorPolicyCel","cel","submittedDefinition","EMPTY_WORKFLOW_DEFINITION","requestError","TemplateComposeWizardView","router","routes","wizard","submitting","handlePublish","FOOTER_STYLE","FOOTER_ACTIONS_STYLE"],"sources":["../../src/views/templates/compose/steps/ComposeFormStep.tsx","../../src/views/templates/compose/steps/ComposeReviewStep.tsx","../../src/views/templates/compose/steps/ComposeWorkflowStep.tsx","../../src/views/templates/compose/use-template-compose-wizard.ts","../../src/views/templates/compose/TemplateComposeWizardView.tsx"],"sourcesContent":["'use client';\n\nimport type { ChangeEvent, ReactElement } from 'react';\nimport { useEffect, useState } from 'react';\nimport { FormField, Input, Select, Typography } from '@mezzanine-ui/react';\nimport { FormFieldLayout } from '@mezzanine-ui/core/form';\nimport type { SelectValue } from '@mezzanine-ui/react/Select';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport {\n ApprovalTemplateCategoryRecord,\n listApprovalTemplateCategoriesPage,\n} from '@rytass/bpm-core-client/template';\nimport { FormBuilderView } from '../../../forms/builder';\n\nconst UNCATEGORIZED_OPTION: SelectValue = {\n id: 'UNCATEGORIZED',\n name: '未分類',\n};\n\nconst CATEGORY_PAGE_SIZE = 100;\n\nexport interface ComposeFormStepProps {\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly onNameChange: (value: string) => void;\n readonly onCategoryIdChange: (value: string | null) => void;\n readonly onFormChange: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n}\n\nexport function ComposeFormStep({\n categoryId,\n formSchema,\n formUiSchema,\n name,\n onCategoryIdChange,\n onFormChange,\n onNameChange,\n}: ComposeFormStepProps): ReactElement {\n const [categoryOptions, setCategoryOptions] = useState<\n readonly ApprovalTemplateCategoryRecord[]\n >([]);\n\n useEffect((): (() => void) => {\n let active = true;\n\n void (async (): Promise<void> => {\n try {\n const result = await listApprovalTemplateCategoriesPage({\n page: 1,\n pageSize: CATEGORY_PAGE_SIZE,\n searchText: '',\n status: 'ACTIVE',\n });\n\n if (active) {\n setCategoryOptions(result.categories);\n }\n } catch {\n if (active) {\n setCategoryOptions([]);\n }\n }\n })();\n\n return (): void => {\n active = false;\n };\n }, []);\n\n const selectOptions: SelectValue[] = [\n UNCATEGORIZED_OPTION,\n ...categoryOptions.map((category) => ({\n id: category.id,\n name: category.name,\n })),\n ];\n const selectedOption =\n selectOptions.find((option) => option.id === categoryId) ??\n UNCATEGORIZED_OPTION;\n\n return (\n <>\n <div style={BASICS_GRID_STYLE}>\n <FormField\n label=\"名稱\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeName\"\n >\n <Input\n fullWidth\n onChange={(event: ChangeEvent<HTMLInputElement>): void =>\n onNameChange(event.target.value)\n }\n placeholder=\"例如:請款簽核\"\n value={name}\n />\n </FormField>\n <FormField\n label=\"分類(選填)\"\n layout={FormFieldLayout.VERTICAL}\n name=\"composeCategory\"\n >\n <Select\n clearable={false}\n fullWidth\n onChange={(option): void =>\n onCategoryIdChange(\n option && option.id !== UNCATEGORIZED_OPTION.id\n ? option.id\n : null,\n )\n }\n options={selectOptions}\n placeholder=\"未分類\"\n value={selectedOption}\n />\n </FormField>\n </div>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 先設計表單欄位,下一步的流程條件分流即可直接引用這些欄位。\n </Typography>\n <FormBuilderView\n onChange={onFormChange}\n value={{ schema: formSchema, uiSchema: formUiSchema }}\n />\n </>\n );\n}\n\nconst BASICS_GRID_STYLE = {\n display: 'grid',\n gap: 16,\n gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))',\n} as const;\n","'use client';\n\nimport type { CSSProperties, ReactElement } from 'react';\nimport { Empty, Table, Tag, Typography } from '@mezzanine-ui/react';\nimport type { TableColumn } from '@mezzanine-ui/core/table';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type {\n WorkflowDefinition,\n WorkflowNode,\n} from '@rytass/bpm-core-shared/workflow';\nimport { FormRenderer } from '../../../forms/renderer/FormRendererView';\nimport { readApproverResolverDetail } from '../../designer/approver-resolver-model';\n\ntype FlowNodeRow = Readonly<\n Record<string, unknown> & {\n detail: string;\n key: string;\n label: string;\n typeLabel: string;\n }\n>;\n\ntype BranchRow = Readonly<\n Record<string, unknown> & {\n condition: string;\n key: string;\n source: string;\n target: string;\n }\n>;\n\nexport interface ComposeReviewStepProps {\n readonly name: string;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishError: string | null;\n}\n\nexport function ComposeReviewStep({\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n name,\n publishError,\n workflowDefinition,\n}: ComposeReviewStepProps): ReactElement {\n const nodes = workflowDefinition?.nodes ?? [];\n const edges = workflowDefinition?.edges ?? [];\n const fieldCount = formSchema.fields.length;\n const nodeLabelById = new Map(\n nodes.map((node) => [node.id, node.data.label] as const),\n );\n const nodeRows: FlowNodeRow[] = nodes.map((node) => ({\n detail: readNodeDetail(node) ?? '—',\n key: node.id,\n label: node.data.label,\n typeLabel: readNodeTypeLabel(node),\n }));\n const branchRows: BranchRow[] = edges\n .filter((edge) => Boolean(edge.data.condition))\n .map((edge) => ({\n condition: edge.data.condition ?? '',\n key: edge.id,\n source: nodeLabelById.get(edge.source) ?? edge.source,\n target: nodeLabelById.get(edge.target) ?? edge.target,\n }));\n\n return (\n <div style={STACK_STYLE}>\n <Typography component=\"h2\" style={TITLE_STYLE} variant=\"h2\">\n {name || '(未命名)'}\n </Typography>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">表單預覽</Typography>\n {fieldCount > 0 ? (\n <FormRenderer\n dataSourceContext={{ kind: 'preview' }}\n readonly\n schema={formSchema}\n uiSchema={formUiSchema}\n />\n ) : (\n <Empty title=\"尚未設計表單欄位\" />\n )}\n </div>\n\n <div style={STACK_STYLE}>\n <Typography variant=\"h3\">流程概覽</Typography>\n {nodes.length > 0 ? (\n <Table columns={NODE_COLUMNS} dataSource={nodeRows} fullWidth />\n ) : (\n <Empty title=\"尚未設計流程節點\" />\n )}\n {branchRows.length > 0 ? (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 條件分流\n </Typography>\n <Table columns={BRANCH_COLUMNS} dataSource={branchRows} fullWidth />\n </>\n ) : null}\n {initiatorPolicyCel ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 發起權限:{initiatorPolicyCel}\n </Typography>\n ) : null}\n </div>\n\n {publishError ? (\n <Typography color=\"text-error\" variant=\"body\">\n {publishError}\n </Typography>\n ) : null}\n </div>\n );\n}\n\nconst NODE_COLUMNS: TableColumn<FlowNodeRow>[] = [\n {\n key: 'type',\n render: (record: FlowNodeRow): ReactElement => (\n <Tag label={record.typeLabel} size=\"sub\" type=\"static\" />\n ),\n title: '類型',\n width: 130,\n },\n { dataIndex: 'label', key: 'label', title: '節點' },\n { dataIndex: 'detail', key: 'detail', title: '簽核方式', width: 160 },\n];\n\nconst BRANCH_COLUMNS: TableColumn<BranchRow>[] = [\n { dataIndex: 'source', key: 'source', title: '來源', width: 180 },\n { dataIndex: 'target', key: 'target', title: '目標', width: 180 },\n { dataIndex: 'condition', key: 'condition', title: '條件' },\n];\n\nfunction readNodeTypeLabel(node: WorkflowNode): string {\n switch (node.type) {\n case 'startEvent':\n return '開始';\n case 'endEvent':\n return node.data.endState === 'REJECTED' ? '結束(駁回)' : '結束(核准)';\n case 'userTask':\n return '簽核';\n case 'serviceTask':\n return '服務';\n case 'exclusiveGateway':\n return '條件閘道';\n case 'parallelGateway':\n return '平行閘道';\n default:\n return '節點';\n }\n}\n\nfunction readNodeDetail(node: WorkflowNode): string | null {\n if (node.type !== 'userTask') {\n return null;\n }\n\n return readApproverResolverDetail(node.data.approverResolver);\n}\n\nconst STACK_STYLE: CSSProperties = {\n display: 'grid',\n gap: 12,\n};\n\n// Match the breathing room between the stepper and the PageHeader, which is the\n// Section's top padding token.\nconst TITLE_STYLE: CSSProperties = {\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n};\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport { Typography } from '@mezzanine-ui/react';\nimport type { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport { TemplateDesignerView } from '../../designer';\n\nexport interface ComposeWorkflowStepProps {\n readonly formSchema: FormDefinitionSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly onWorkflowChange: (definition: WorkflowDefinition) => void;\n readonly onInitiatorPolicyChange: (cel: string | null) => void;\n /**\n * Show the AI assistant button inside the embedded designer's side panel.\n * Follows the same opt-in contract as the standalone designer page; default\n * hidden. Wired up the stack from the server page's `BPM_AI_ASSISTANT_ENABLED`.\n */\n readonly showAiAssistant?: boolean;\n /**\n * Whether the LLM backend is configured (host has an API key). When `false`\n * the AI button shows disabled as a placeholder. Default `false`.\n */\n readonly aiAssistantAvailable?: boolean;\n}\n\nexport function ComposeWorkflowStep({\n aiAssistantAvailable = false,\n formSchema,\n initiatorPolicyCel,\n onInitiatorPolicyChange,\n onWorkflowChange,\n showAiAssistant = false,\n workflowDefinition,\n}: ComposeWorkflowStepProps): ReactElement {\n return (\n <>\n <Typography color=\"text-neutral\" variant=\"caption\">\n 設計簽核節點與條件分流;條件可直接引用上一步設計的表單欄位。\n </Typography>\n <TemplateDesignerView\n aiAssistantAvailable={aiAssistantAvailable}\n embedded\n formSchemaOverride={formSchema}\n initialInitiatorPolicyCel={initiatorPolicyCel}\n initialWorkflowDefinition={workflowDefinition ?? undefined}\n onInitiatorPolicyChange={onInitiatorPolicyChange}\n onWorkflowChange={onWorkflowChange}\n showAiAssistant={showAiAssistant}\n />\n </>\n );\n}\n","'use client';\n\nimport { useCallback, useState } from 'react';\nimport type {\n FormDefinitionSchema,\n FormUiSchema,\n} from '@rytass/bpm-core-shared/form';\nimport type { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';\nimport { useBPMLanguage } from '../../../lib/language-provider';\nimport {\n ComposeApprovalTemplateWithFormResult,\n composeApprovalTemplateWithForm,\n} from '@rytass/bpm-core-client/template';\nimport { readTemplateErrorMessage } from '../template-error-message';\n\nexport type ComposeWizardStep = 0 | 1 | 2;\n\nexport type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';\n\nexport const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema = {\n fields: [],\n schemaVersion: 1,\n};\n\nexport const EMPTY_COMPOSE_FORM_UI_SCHEMA: FormUiSchema = {\n layout: [],\n schemaVersion: 1,\n};\n\nexport interface TemplateComposeWizard {\n readonly currentStep: ComposeWizardStep;\n /**\n * Single user-facing name. Persisted to both the template and the form\n * (`templateName` / `formName`) at the `composeApprovalTemplateWithForm`\n * boundary — the DB keeps two columns, the UI keeps one field.\n */\n readonly name: string;\n readonly categoryId: string | null;\n readonly formSchema: FormDefinitionSchema;\n readonly formUiSchema: FormUiSchema;\n readonly workflowDefinition: WorkflowDefinition | null;\n readonly initiatorPolicyCel: string | null;\n readonly publishPhase: ComposePublishPhase;\n readonly publishError: string | null;\n readonly canLeaveBasics: boolean;\n readonly goToStep: (step: ComposeWizardStep) => void;\n readonly goNext: () => void;\n readonly goBack: () => void;\n readonly setName: (value: string) => void;\n readonly setCategoryId: (value: string | null) => void;\n readonly setFormValue: (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }) => void;\n readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;\n readonly setInitiatorPolicyCel: (cel: string | null) => void;\n readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;\n}\n\n/**\n * Owns the cross-step state for the unified \"form + flow\" template wizard.\n *\n * Step 0 (表單) edits `formSchema`/`formUiSchema`; that same in-memory schema\n * feeds Step 1 (流程) as the field source for condition branches, so the\n * embedded designer never needs a published form version. Step 2 (檢視發佈)\n * submits everything through the atomic `composeApprovalTemplateWithForm`\n * mutation.\n */\nexport function useTemplateComposeWizard(): TemplateComposeWizard {\n const language = useBPMLanguage();\n const [currentStep, setCurrentStep] = useState<ComposeWizardStep>(0);\n const [name, setName] = useState('');\n const [categoryId, setCategoryId] = useState<string | null>(null);\n const [formSchema, setFormSchema] = useState<FormDefinitionSchema>(\n EMPTY_COMPOSE_FORM_SCHEMA,\n );\n const [formUiSchema, setFormUiSchema] = useState<FormUiSchema>(\n EMPTY_COMPOSE_FORM_UI_SCHEMA,\n );\n const [workflowDefinition, setWorkflowDefinitionState] =\n useState<WorkflowDefinition | null>(null);\n const [initiatorPolicyCel, setInitiatorPolicyCelState] = useState<\n string | null\n >(null);\n const [publishPhase, setPublishPhase] = useState<ComposePublishPhase>('idle');\n const [publishError, setPublishError] = useState<string | null>(null);\n\n const canLeaveBasics = name.trim().length > 0 && formSchema.fields.length > 0;\n\n const goToStep = useCallback((step: ComposeWizardStep): void => {\n setCurrentStep(step);\n }, []);\n\n const goNext = useCallback((): void => {\n setCurrentStep((step) =>\n step < 2 ? ((step + 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const goBack = useCallback((): void => {\n setCurrentStep((step) =>\n step > 0 ? ((step - 1) as ComposeWizardStep) : step,\n );\n }, []);\n\n const setFormValue = useCallback(\n (next: {\n readonly schema: FormDefinitionSchema;\n readonly uiSchema: FormUiSchema;\n }): void => {\n setFormSchema(next.schema);\n setFormUiSchema(next.uiSchema);\n },\n [],\n );\n\n const setWorkflowDefinition = useCallback(\n (definition: WorkflowDefinition): void => {\n setWorkflowDefinitionState(definition);\n },\n [],\n );\n\n const setInitiatorPolicyCel = useCallback((cel: string | null): void => {\n setInitiatorPolicyCelState(cel);\n }, []);\n\n const publish =\n useCallback(async (): Promise<ComposeApprovalTemplateWithFormResult | null> => {\n setPublishPhase('submitting');\n setPublishError(null);\n\n const submittedDefinition =\n workflowDefinition ?? EMPTY_WORKFLOW_DEFINITION;\n\n try {\n const result = await composeApprovalTemplateWithForm({\n category: null,\n categoryId,\n formDefinitionId: null,\n formDescription: null,\n // One UI name fans out to both persisted columns.\n formName: name,\n initiatorPolicyCel,\n notificationConfig: null,\n publish: true,\n schema: formSchema,\n slaDefaults: null,\n templateDescription: null,\n templateId: null,\n templateName: name,\n uiSchema: formUiSchema,\n workflowDefinition: submittedDefinition,\n });\n\n setPublishPhase('success');\n\n return result;\n } catch (requestError: unknown) {\n setPublishError(\n readTemplateErrorMessage(requestError, language, submittedDefinition),\n );\n setPublishPhase('error');\n\n return null;\n }\n }, [\n categoryId,\n formSchema,\n formUiSchema,\n initiatorPolicyCel,\n language,\n name,\n workflowDefinition,\n ]);\n\n return {\n canLeaveBasics,\n categoryId,\n currentStep,\n formSchema,\n formUiSchema,\n goBack,\n goNext,\n goToStep,\n initiatorPolicyCel,\n name,\n publish,\n publishError,\n publishPhase,\n setCategoryId,\n setFormValue,\n setInitiatorPolicyCel,\n setName,\n setWorkflowDefinition,\n workflowDefinition,\n };\n}\n\n// Phase 23 P4: templates created through the wizard start on cel-v2.\nconst EMPTY_WORKFLOW_DEFINITION: WorkflowDefinition = {\n edges: [],\n expressionDialect: 'cel-v2',\n meta: { schemaVersion: 1 },\n nodes: [\n {\n data: { label: '開始' },\n id: 'start',\n position: { x: 80, y: 160 },\n type: 'startEvent',\n },\n {\n data: { endState: 'APPROVED', label: '完成', triggerMode: 'AND' },\n id: 'end',\n position: { x: 560, y: 160 },\n type: 'endEvent',\n },\n ],\n};\n","'use client';\n\nimport type { ReactElement } from 'react';\nimport {\n Button,\n PageHeader,\n Section,\n SectionGroup,\n Step,\n Stepper,\n Typography,\n} from '@mezzanine-ui/react';\nimport ContentHeader from '@mezzanine-ui/react/ContentHeader';\nimport { useRouterAdapter } from '../../../lib/router-adapter';\nimport { useBPMRoutes } from '../../../lib/routes-config';\nimport { ComposeFormStep } from './steps/ComposeFormStep';\nimport { ComposeReviewStep } from './steps/ComposeReviewStep';\nimport { ComposeWorkflowStep } from './steps/ComposeWorkflowStep';\nimport { useTemplateComposeWizard } from './use-template-compose-wizard';\n\nexport interface TemplateComposeWizardViewProps {\n /**\n * Show the workflow designer AI assistant inside Step 1 (流程設計). Opt-in,\n * default hidden — the server page maps `BPM_AI_ASSISTANT_ENABLED` to it.\n */\n readonly showAiAssistant?: boolean;\n /**\n * Whether the LLM backend is configured (host has an API key). When `false`\n * the AI button shows disabled as a placeholder. Default `false`.\n */\n readonly aiAssistantAvailable?: boolean;\n}\n\n/**\n * Unified \"form + flow\" template creation wizard. Walks the user through\n * Step 0 表單設計 → Step 1 流程設計 → Step 2 檢視並發佈, then commits both\n * sides atomically through `composeApprovalTemplateWithForm`. This is the\n * template entry point; the form builder is intentionally controlled here\n * instead of exposed as a standalone `/forms` page.\n */\nexport function TemplateComposeWizardView({\n aiAssistantAvailable = false,\n showAiAssistant = false,\n}: TemplateComposeWizardViewProps = {}): ReactElement {\n const router = useRouterAdapter();\n const routes = useBPMRoutes();\n const wizard = useTemplateComposeWizard();\n const submitting = wizard.publishPhase === 'submitting';\n\n async function handlePublish(): Promise<void> {\n const result = await wizard.publish();\n\n if (result) {\n router.push(routes.templateDesigner(result.templateId));\n }\n }\n\n return (\n <>\n <PageHeader>\n <ContentHeader\n description=\"一次完成表單與流程設計,發佈後即可直接發起。\"\n title=\"建立模板(表單 + 流程)\"\n >\n <Button\n disabled={submitting}\n onClick={(): void => router.push(routes.templates())}\n variant=\"base-secondary\"\n >\n 返回模板列表\n </Button>\n </ContentHeader>\n </PageHeader>\n\n <SectionGroup>\n <Section>\n <Stepper currentStep={wizard.currentStep}>\n <Step description=\"設計欄位與版面\" title=\"表單設計\" />\n <Step description=\"設計簽核節點與條件\" title=\"流程設計\" />\n <Step description=\"確認後發佈\" title=\"檢視並發佈\" />\n </Stepper>\n\n {wizard.currentStep === 0 ? (\n <ComposeFormStep\n categoryId={wizard.categoryId}\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n name={wizard.name}\n onCategoryIdChange={wizard.setCategoryId}\n onFormChange={wizard.setFormValue}\n onNameChange={wizard.setName}\n />\n ) : null}\n\n {wizard.currentStep === 1 ? (\n <ComposeWorkflowStep\n aiAssistantAvailable={aiAssistantAvailable}\n formSchema={wizard.formSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n onInitiatorPolicyChange={wizard.setInitiatorPolicyCel}\n onWorkflowChange={wizard.setWorkflowDefinition}\n showAiAssistant={showAiAssistant}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n {wizard.currentStep === 2 ? (\n <ComposeReviewStep\n formSchema={wizard.formSchema}\n formUiSchema={wizard.formUiSchema}\n initiatorPolicyCel={wizard.initiatorPolicyCel}\n name={wizard.name}\n publishError={wizard.publishError}\n workflowDefinition={wizard.workflowDefinition}\n />\n ) : null}\n\n <div style={FOOTER_STYLE}>\n {wizard.currentStep === 0 && !wizard.canLeaveBasics ? (\n <Typography color=\"text-neutral\" variant=\"caption\">\n 請填寫模板名稱、表單名稱,並至少新增一個表單欄位。\n </Typography>\n ) : (\n <span />\n )}\n <div style={FOOTER_ACTIONS_STYLE}>\n <Button\n disabled={wizard.currentStep === 0 || submitting}\n onClick={wizard.goBack}\n variant=\"base-secondary\"\n >\n 上一步\n </Button>\n {wizard.currentStep < 2 ? (\n <Button\n disabled={wizard.currentStep === 0 && !wizard.canLeaveBasics}\n onClick={wizard.goNext}\n variant=\"base-primary\"\n >\n 下一步\n </Button>\n ) : (\n <Button\n disabled={submitting}\n loading={submitting}\n onClick={(): void => {\n void handlePublish();\n }}\n variant=\"base-primary\"\n >\n 發佈\n </Button>\n )}\n </div>\n </div>\n </Section>\n </SectionGroup>\n </>\n );\n}\n\nconst FOOTER_STYLE = {\n alignItems: 'center',\n display: 'flex',\n // Match the breathing room used elsewhere (the Section's top padding token).\n marginTop: 'var(--mzn-spacing-padding-vertical-spacious)',\n justifyContent: 'space-between',\n gap: 16,\n} as const;\n\nconst FOOTER_ACTIONS_STYLE = {\n display: 'flex',\n gap: 8,\n} as const;\n"],"mappings":"A,yiBAiBA,IAAMgD,EAAoC,CACxC,GAAI,gBACJ,KAAM,KACR,EAEMC,EAAqB,IAe3B,SAAgBC,EAAgB,CAC9B,aACA,aACA,eACA,OACA,qBACA,eACA,gBACqC,CACrC,GAAM,CAACC,EAAiBC,IAAA,EAAsBpD,EAAAA,SAAAA,CAE5C,CAAC,CAAC,GA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