@rytass/bpm-core-react 0.16.2 → 0.17.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 (247) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +54 -6
  3. package/dist/chunks/admin-pickers-BRHk3qKq.cjs +2 -0
  4. package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +1 -0
  5. package/dist/chunks/{admin-pickers-DxhzECkD.js → admin-pickers-Djq3h-UR.js} +41 -39
  6. package/dist/chunks/admin-pickers-Djq3h-UR.js.map +1 -0
  7. package/dist/chunks/{categories-DjENouRm.cjs → categories-AxxhqjLZ.cjs} +2 -2
  8. package/dist/chunks/{categories-DjENouRm.cjs.map → categories-AxxhqjLZ.cjs.map} +1 -1
  9. package/dist/chunks/{categories-1gKxeEqw.js → categories-riC33J_j.js} +2 -2
  10. package/dist/chunks/{categories-1gKxeEqw.js.map → categories-riC33J_j.js.map} +1 -1
  11. package/dist/chunks/{compose-DUH9cQ-L.cjs → compose-B7TtrpQJ.cjs} +2 -2
  12. package/dist/chunks/{compose-DUH9cQ-L.cjs.map → compose-B7TtrpQJ.cjs.map} +1 -1
  13. package/dist/chunks/{compose-DO6n0NJi.js → compose-_pREPtfN.js} +2 -2
  14. package/dist/chunks/{compose-DO6n0NJi.js.map → compose-_pREPtfN.js.map} +1 -1
  15. package/dist/chunks/{delegations-BLzYnOae.cjs → delegations-V9HIe3_P.cjs} +2 -2
  16. package/dist/chunks/delegations-V9HIe3_P.cjs.map +1 -0
  17. package/dist/chunks/{delegations-_b4_xBit.js → delegations-xUt1tj8d.js} +2 -1
  18. package/dist/chunks/{delegations-_b4_xBit.js.map → delegations-xUt1tj8d.js.map} +1 -1
  19. package/dist/chunks/{designer-B-cfiob9.js → designer-BiywgNXs.js} +1003 -949
  20. package/dist/chunks/designer-BiywgNXs.js.map +1 -0
  21. package/dist/chunks/designer-ttAqv859.cjs +65 -0
  22. package/dist/chunks/designer-ttAqv859.cjs.map +1 -0
  23. package/dist/chunks/detail-DRCTnuKm.cjs +2 -0
  24. package/dist/chunks/detail-DRCTnuKm.cjs.map +1 -0
  25. package/dist/chunks/{detail-C6NdVijG.js → detail-DScLf42P.js} +183 -156
  26. package/dist/chunks/detail-DScLf42P.js.map +1 -0
  27. package/dist/chunks/orgs-C8usknWb.cjs +2 -0
  28. package/dist/chunks/orgs-C8usknWb.cjs.map +1 -0
  29. package/dist/chunks/{orgs-Bpp1U60k.js → orgs-Lg7tXv2u.js} +584 -544
  30. package/dist/chunks/orgs-Lg7tXv2u.js.map +1 -0
  31. package/dist/chunks/users-DRbuDYF1.js +422 -0
  32. package/dist/chunks/users-DRbuDYF1.js.map +1 -0
  33. package/dist/chunks/users-DVQicZIo.cjs +2 -0
  34. package/dist/chunks/users-DVQicZIo.cjs.map +1 -0
  35. package/dist/components/admin-pickers.d.cts +65 -0
  36. package/dist/components/approval-instance-list-page.d.cts +17 -0
  37. package/dist/components/bpm-form-field.d.cts +10 -0
  38. package/dist/components/bpm-notification-bell-button.d.cts +22 -0
  39. package/dist/components/dashboard-page.d.cts +7 -0
  40. package/dist/components/notification-drawer.d.cts +11 -0
  41. package/dist/components/org-unit-tree-draft-editor.d.cts +24 -0
  42. package/dist/components/org-unit-tree-draft-editor.d.ts +1 -1
  43. package/dist/components/pdf-preview.d.cts +12 -0
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.d.cts +15 -0
  46. package/dist/index.d.ts +15 -15
  47. package/dist/index.js +1 -1
  48. package/dist/lib/auth-provider.d.cts +37 -0
  49. package/dist/lib/format-date-time.d.cts +5 -0
  50. package/dist/lib/format-member-label.d.cts +12 -0
  51. package/dist/lib/member-profile-resolution.d.cts +48 -0
  52. package/dist/lib/notification-drawer-provider.d.cts +27 -0
  53. package/dist/lib/notification-unread-provider.d.cts +25 -0
  54. package/dist/lib/org-tree-draft.d.cts +27 -0
  55. package/dist/lib/providers.d.cts +31 -0
  56. package/dist/lib/router-adapter.d.cts +47 -0
  57. package/dist/lib/routes-config.d.cts +117 -0
  58. package/dist/lib/task-node-label.d.cts +10 -0
  59. package/dist/lib/use-bpm-logout.d.cts +12 -0
  60. package/dist/lib/use-bpm-member.d.cts +17 -0
  61. package/dist/next/BPMNextProviders.d.cts +51 -0
  62. package/dist/next/index.d.cts +2 -0
  63. package/dist/next/index.d.ts +2 -2
  64. package/dist/next/workflow-chat-route.d.cts +17 -0
  65. package/dist/pages/admin/delegations/index.cjs +1 -1
  66. package/dist/pages/admin/delegations/index.d.cts +4 -0
  67. package/dist/pages/admin/delegations/index.js +1 -1
  68. package/dist/pages/admin/orgs/index.cjs +1 -1
  69. package/dist/pages/admin/orgs/index.d.cts +4 -0
  70. package/dist/pages/admin/orgs/index.js +1 -1
  71. package/dist/pages/admin/users/index.cjs +1 -1
  72. package/dist/pages/admin/users/index.d.cts +4 -0
  73. package/dist/pages/admin/users/index.js +1 -1
  74. package/dist/pages/admin/webhook-endpoints/index.d.cts +4 -0
  75. package/dist/pages/cc/index.d.cts +16 -0
  76. package/dist/pages/dashboard/index.d.cts +16 -0
  77. package/dist/pages/delegations/index.d.cts +4 -0
  78. package/dist/pages/inbox/index.d.cts +16 -0
  79. package/dist/pages/instances/detail/index.cjs +1 -1
  80. package/dist/pages/instances/detail/index.d.cts +23 -0
  81. package/dist/pages/instances/detail/index.js +1 -1
  82. package/dist/pages/instances/new/index.d.cts +20 -0
  83. package/dist/pages/login/index.d.cts +21 -0
  84. package/dist/pages/root/index.d.cts +18 -0
  85. package/dist/pages/search/index.d.cts +16 -0
  86. package/dist/pages/sent/index.d.cts +16 -0
  87. package/dist/pages/settings/notifications/index.d.cts +4 -0
  88. package/dist/pages/templates/categories/index.cjs +1 -1
  89. package/dist/pages/templates/categories/index.d.cts +4 -0
  90. package/dist/pages/templates/categories/index.js +1 -1
  91. package/dist/pages/templates/compose/index.cjs +1 -1
  92. package/dist/pages/templates/compose/index.d.cts +25 -0
  93. package/dist/pages/templates/compose/index.js +1 -1
  94. package/dist/pages/templates/designer/index.cjs +1 -1
  95. package/dist/pages/templates/designer/index.d.cts +8 -0
  96. package/dist/pages/templates/designer/index.js +1 -1
  97. package/dist/pages/templates/index.d.cts +4 -0
  98. package/dist/pages/templates/versions/index.d.cts +8 -0
  99. package/dist/views/admin/delegations/AdminDelegationsView.d.cts +2 -0
  100. package/dist/views/admin/delegations/index.cjs +1 -1
  101. package/dist/views/admin/delegations/index.d.cts +1 -0
  102. package/dist/views/admin/delegations/index.d.ts +1 -1
  103. package/dist/views/admin/delegations/index.js +1 -1
  104. package/dist/views/admin/index.cjs +1 -1
  105. package/dist/views/admin/index.d.cts +4 -0
  106. package/dist/views/admin/index.d.ts +4 -4
  107. package/dist/views/admin/index.js +3 -3
  108. package/dist/views/admin/orgs/AdminOrgsView.d.cts +2 -0
  109. package/dist/views/admin/orgs/index.cjs +1 -1
  110. package/dist/views/admin/orgs/index.d.cts +1 -0
  111. package/dist/views/admin/orgs/index.d.ts +1 -1
  112. package/dist/views/admin/orgs/index.js +1 -1
  113. package/dist/views/admin/users/AdminUsersView.d.cts +2 -0
  114. package/dist/views/admin/users/MemberTaskReassignModal.d.cts +13 -0
  115. package/dist/views/admin/users/MemberTaskReassignModal.d.ts +13 -0
  116. package/dist/views/admin/users/index.cjs +1 -1
  117. package/dist/views/admin/users/index.d.cts +1 -0
  118. package/dist/views/admin/users/index.d.ts +1 -1
  119. package/dist/views/admin/users/index.js +1 -1
  120. package/dist/views/admin/webhook-endpoints/AdminWebhookEndpointsView.d.cts +8 -0
  121. package/dist/views/admin/webhook-endpoints/index.d.cts +1 -0
  122. package/dist/views/admin/webhook-endpoints/index.d.ts +1 -1
  123. package/dist/views/cc/CcView.d.cts +7 -0
  124. package/dist/views/cc/index.d.cts +1 -0
  125. package/dist/views/cc/index.d.ts +1 -1
  126. package/dist/views/dashboard/DashboardView.d.cts +7 -0
  127. package/dist/views/dashboard/index.d.cts +1 -0
  128. package/dist/views/dashboard/index.d.ts +1 -1
  129. package/dist/views/delegations/DelegationsView.d.cts +2 -0
  130. package/dist/views/delegations/index.d.cts +1 -0
  131. package/dist/views/delegations/index.d.ts +1 -1
  132. package/dist/views/forms/builder/FormBuilderView.d.cts +18 -0
  133. package/dist/views/forms/builder/index.d.cts +1 -0
  134. package/dist/views/forms/builder/index.d.ts +1 -1
  135. package/dist/views/forms/builder/json-code-editor.d.cts +11 -0
  136. package/dist/views/forms/renderer/FormRendererView.d.cts +24 -0
  137. package/dist/views/forms/renderer/FormRendererView.d.ts +1 -1
  138. package/dist/views/forms/renderer/form-data-source-field.d.cts +65 -0
  139. package/dist/views/forms/renderer/form-field-link.d.cts +16 -0
  140. package/dist/views/forms/renderer/index.d.cts +2 -0
  141. package/dist/views/forms/renderer/index.d.ts +2 -2
  142. package/dist/views/forms/renderer/member-field-options.d.cts +39 -0
  143. package/dist/views/forms/renderer/member-field.d.cts +21 -0
  144. package/dist/views/inbox/InboxView.d.cts +7 -0
  145. package/dist/views/inbox/index.d.cts +1 -0
  146. package/dist/views/inbox/index.d.ts +1 -1
  147. package/dist/views/instances/detail/InstanceDetailView.d.cts +27 -0
  148. package/dist/views/instances/detail/index.cjs +1 -1
  149. package/dist/views/instances/detail/index.d.cts +7 -0
  150. package/dist/views/instances/detail/index.d.ts +7 -7
  151. package/dist/views/instances/detail/index.js +1 -1
  152. package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.cts +15 -0
  153. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +36 -0
  154. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +1 -1
  155. package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +29 -0
  156. package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.cts +14 -0
  157. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +55 -0
  158. package/dist/views/instances/detail/sections/InstanceWebhookDeliveriesSection.d.cts +20 -0
  159. package/dist/views/instances/detail/sections/container-helpers.d.cts +10 -0
  160. package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
  161. package/dist/views/instances/detail/sections/shared.d.cts +141 -0
  162. package/dist/views/instances/detail/submitted-by.d.cts +23 -0
  163. package/dist/views/instances/index.d.cts +1 -0
  164. package/dist/views/instances/index.d.ts +1 -1
  165. package/dist/views/instances/new/InstanceNewView.d.cts +15 -0
  166. package/dist/views/instances/new/index.d.cts +1 -0
  167. package/dist/views/instances/new/index.d.ts +1 -1
  168. package/dist/views/login/LoginView.d.cts +47 -0
  169. package/dist/views/login/index.d.cts +1 -0
  170. package/dist/views/login/index.d.ts +1 -1
  171. package/dist/views/root/RootView.d.cts +10 -0
  172. package/dist/views/root/index.d.cts +1 -0
  173. package/dist/views/root/index.d.ts +1 -1
  174. package/dist/views/search/SearchView.d.cts +7 -0
  175. package/dist/views/search/index.d.cts +1 -0
  176. package/dist/views/search/index.d.ts +1 -1
  177. package/dist/views/sent/SentView.d.cts +7 -0
  178. package/dist/views/sent/index.d.cts +1 -0
  179. package/dist/views/sent/index.d.ts +1 -1
  180. package/dist/views/settings/index.d.cts +1 -0
  181. package/dist/views/settings/index.d.ts +1 -1
  182. package/dist/views/settings/notifications/SettingsNotificationsView.d.cts +2 -0
  183. package/dist/views/settings/notifications/index.d.cts +1 -0
  184. package/dist/views/settings/notifications/index.d.ts +1 -1
  185. package/dist/views/templates/TemplatesView.d.cts +7 -0
  186. package/dist/views/templates/categories/TemplateCategoriesView.d.cts +2 -0
  187. package/dist/views/templates/categories/index.cjs +1 -1
  188. package/dist/views/templates/categories/index.d.cts +1 -0
  189. package/dist/views/templates/categories/index.d.ts +1 -1
  190. package/dist/views/templates/categories/index.js +1 -1
  191. package/dist/views/templates/compose/TemplateComposeWizardView.d.cts +21 -0
  192. package/dist/views/templates/compose/index.cjs +1 -1
  193. package/dist/views/templates/compose/index.d.cts +2 -0
  194. package/dist/views/templates/compose/index.d.ts +2 -2
  195. package/dist/views/templates/compose/index.js +1 -1
  196. package/dist/views/templates/compose/steps/ComposeFormStep.d.cts +15 -0
  197. package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +12 -0
  198. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +22 -0
  199. package/dist/views/templates/compose/use-template-compose-wizard.d.cts +46 -0
  200. package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.cts +20 -0
  201. package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.ts +1 -1
  202. package/dist/views/templates/designer/TemplateDesignerView.d.cts +65 -0
  203. package/dist/views/templates/designer/chrome-workflow-chat.d.cts +12 -0
  204. package/dist/views/templates/designer/chrome-workflow-chat.d.ts +1 -1
  205. package/dist/views/templates/designer/decision-policy-options.d.cts +8 -0
  206. package/dist/views/templates/designer/designer-version-labels.d.cts +12 -0
  207. package/dist/views/templates/designer/dry-run-assignee-label.d.cts +28 -0
  208. package/dist/views/templates/designer/dry-run-sample-data.d.cts +9 -0
  209. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +35 -0
  210. package/dist/views/templates/designer/index.cjs +1 -1
  211. package/dist/views/templates/designer/index.d.cts +1 -0
  212. package/dist/views/templates/designer/index.d.ts +1 -1
  213. package/dist/views/templates/designer/index.js +1 -1
  214. package/dist/views/templates/designer/notify-webhook-designer.d.cts +74 -0
  215. package/dist/views/templates/designer/position-level-options.d.cts +17 -0
  216. package/dist/views/templates/designer/use-workflow-chat.d.cts +21 -0
  217. package/dist/views/templates/designer/use-workflow-chat.d.ts +1 -1
  218. package/dist/views/templates/designer/use-workflow-designer-controller.d.cts +41 -0
  219. package/dist/views/templates/designer/workflow-chat-drawer.d.cts +16 -0
  220. package/dist/views/templates/designer/workflow-chat-drawer.d.ts +1 -1
  221. package/dist/views/templates/index.cjs +1 -1
  222. package/dist/views/templates/index.d.cts +3 -0
  223. package/dist/views/templates/index.d.ts +3 -3
  224. package/dist/views/templates/index.js +1 -1
  225. package/dist/views/templates/versions/TemplateVersionsView.d.cts +5 -0
  226. package/dist/views/templates/versions/index.d.cts +1 -0
  227. package/dist/views/templates/versions/index.d.ts +1 -1
  228. package/dist/views/workflow/index.d.cts +4 -0
  229. package/dist/views/workflow/index.d.ts +4 -4
  230. package/package.json +387 -147
  231. package/dist/chunks/admin-pickers-DxhzECkD.js.map +0 -1
  232. package/dist/chunks/admin-pickers-qe3j--gX.cjs +0 -2
  233. package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +0 -1
  234. package/dist/chunks/delegations-BLzYnOae.cjs.map +0 -1
  235. package/dist/chunks/designer-2YvjP_GU.cjs +0 -65
  236. package/dist/chunks/designer-2YvjP_GU.cjs.map +0 -1
  237. package/dist/chunks/designer-B-cfiob9.js.map +0 -1
  238. package/dist/chunks/detail-C6NdVijG.js.map +0 -1
  239. package/dist/chunks/detail-DKobK4Cg.cjs +0 -2
  240. package/dist/chunks/detail-DKobK4Cg.cjs.map +0 -1
  241. package/dist/chunks/orgs-Bpp1U60k.js.map +0 -1
  242. package/dist/chunks/orgs-ywaE1_02.cjs +0 -2
  243. package/dist/chunks/orgs-ywaE1_02.cjs.map +0 -1
  244. package/dist/chunks/users-BSVo_eNe.js +0 -215
  245. package/dist/chunks/users-BSVo_eNe.js.map +0 -1
  246. package/dist/chunks/users-DFSBTDMy.cjs +0 -2
  247. package/dist/chunks/users-DFSBTDMy.cjs.map +0 -1
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Header line of the designer. A published template version is named
3
+ * explicitly because the bound form's own version sits right below it, and a
4
+ * reader seeing only "v1" there takes it for the template's version.
5
+ */
6
+ export declare function readTemplateVersionDescription(input: {
7
+ draftVersion: number | null;
8
+ hasPublishedVersion: boolean;
9
+ publishedVersion: number | null;
10
+ }): string;
11
+ /** The bound form's version, labelled so it is not mistaken for the template's. */
12
+ export declare function readFormVersionLabel(formName: string, version: number): string;
@@ -0,0 +1,28 @@
1
+ type NamedRecord = Readonly<{
2
+ id: string;
3
+ name: string;
4
+ }>;
5
+ type FormFieldRecord = Readonly<{
6
+ fieldKey: string;
7
+ label: string;
8
+ }>;
9
+ export type DryRunAssigneeDirectory = Readonly<{
10
+ /** Fields of the schema the dry run samples, to name a member placeholder. */
11
+ formFields: readonly FormFieldRecord[];
12
+ /** Display name of a real member id, or `null` when it is not known. */
13
+ memberName: (memberId: string) => string | null;
14
+ orgUnits: readonly NamedRecord[];
15
+ positions: readonly NamedRecord[];
16
+ }>;
17
+ /**
18
+ * The dry run cannot know who a position / org-unit / manager-chain resolver
19
+ * would pick (that depends on the submitter and the directory at submit
20
+ * time), so the engine reports a `<kind>:<ids>` placeholder instead of a
21
+ * member id. This turns each placeholder into a sentence a template author can
22
+ * read; a real member id becomes the member's name, and anything else is
23
+ * returned untouched so an unexpected value stays visible.
24
+ *
25
+ * The placeholder shapes mirror `resolveDryRunAssigneeMemberId` in the engine.
26
+ */
27
+ export declare function readDryRunAssigneeLabel(assignee: string, directory: DryRunAssigneeDirectory): string;
28
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
2
+ export declare function readDryRunSampleFormData(schema: FormDefinitionSchema | null): Readonly<Record<string, unknown>>;
3
+ /**
4
+ * Sample value of a member field: a placeholder the dry-run result labels as
5
+ * "whoever this field names", never the dry-run initiator — a real submitter
6
+ * picks someone else, and sampling the initiator would make a node that
7
+ * excludes the initiator look skipped or stopped when it would not be.
8
+ */
9
+ export declare function readDryRunFormMemberPlaceholder(fieldKey: string): string;
@@ -0,0 +1,35 @@
1
+ import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
2
+ export type MemberFieldOption = Readonly<{
3
+ id: string;
4
+ name: string;
5
+ /**
6
+ * Set when the field can be empty at submit time (optional, hidden by a
7
+ * visibility rule, or a store-only hidden field); the node would then find no
8
+ * approver, so publishing refuses it. Still selectable, so the stored choice
9
+ * stays visible until the form or the node is fixed.
10
+ */
11
+ warning?: string;
12
+ }>;
13
+ export type DynamicFormFieldChoice = Readonly<{
14
+ /** What the picker offers; includes the stale stored key when there is one. */
15
+ options: readonly MemberFieldOption[];
16
+ /** Hint under the picker, or `null` when nothing needs saying. */
17
+ problem: string | null;
18
+ selected: MemberFieldOption | null;
19
+ }>;
20
+ export declare const NO_MEMBER_FIELD_HINT = "\u8868\u55AE\u4E2D\u6C92\u6709\u300C\u4EBA\u54E1\u9078\u64C7\u300D\u6B04\u4F4D\uFF0C\u8ACB\u5148\u5230\u8868\u55AE\u8A2D\u8A08\u52A0\u5165";
21
+ /** Only member fields can feed a 依表單欄位指定 approver resolver. */
22
+ export declare function readMemberFieldOptions(schema: FormDefinitionSchema | null): readonly MemberFieldOption[];
23
+ /**
24
+ * The member-field picker for the 依表單欄位指定 resolver. A stored `formPath`
25
+ * that no longer names a member field of the bound form (the form was switched
26
+ * or edited, or the template came from the API) stays visible as its own
27
+ * option together with a warning, instead of being cleared behind the user's
28
+ * back — the resolver stays invalid until a real field is chosen.
29
+ */
30
+ export declare function readDynamicFormFieldChoice(schema: FormDefinitionSchema | null, formPath: string): DynamicFormFieldChoice;
31
+ /**
32
+ * 依表單欄位:<label>; the field key when the form does not have it (any
33
+ * more), and a marker when the key names something that is not a member field.
34
+ */
35
+ export declare function readDynamicFormSummary(schema: FormDefinitionSchema | null, formPath: string): string;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/designer-2YvjP_GU.cjs");exports.TemplateDesignerView=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/designer-ttAqv859.cjs");exports.TemplateDesignerView=e.t;
@@ -0,0 +1 @@
1
+ export * from './TemplateDesignerView.cjs';
@@ -1 +1 @@
1
- export * from './TemplateDesignerView';
1
+ export * from './TemplateDesignerView.js';
@@ -1 +1 @@
1
- export { t as TemplateDesignerView } from "../../../chunks/designer-B-cfiob9.js";
1
+ export { t as TemplateDesignerView } from "../../../chunks/designer-BiywgNXs.js";
@@ -0,0 +1,74 @@
1
+ import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
2
+ import { NotifyWebhookBindingSource, NotifyWebhookContextPath, NotifyWebhookParameterType, NotifyWebhookTarget, WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
3
+ import { NotifyWebhookEndpointContract } from '@rytass/bpm-core-shared/workflow-graph';
4
+ export type NotifyWebhookBindingKind = NotifyWebhookBindingSource['kind'];
5
+ /** The catalog fields the designer reads; a subset of the client record. */
6
+ export interface NotifyWebhookDesignerEndpoint extends NotifyWebhookEndpointContract {
7
+ readonly deprecated: boolean;
8
+ readonly description: string | null;
9
+ /** Switched off by an administrator (database endpoints). */
10
+ readonly disabled?: boolean;
11
+ readonly key: string;
12
+ readonly label: string;
13
+ readonly parameters: readonly {
14
+ readonly description: string | null;
15
+ readonly key: string;
16
+ readonly label: string;
17
+ readonly required: boolean;
18
+ readonly type: NotifyWebhookParameterType;
19
+ }[];
20
+ /** `DATABASE` endpoints are maintained in the back office. */
21
+ readonly source?: 'DATABASE' | 'REGISTRY';
22
+ readonly version: number;
23
+ }
24
+ type DesignerParameter = NotifyWebhookDesignerEndpoint['parameters'][number];
25
+ export declare const NOTIFY_WEBHOOK_CONTEXT_PATH_LABELS: Readonly<Record<NotifyWebhookContextPath, string>>;
26
+ export declare const NOTIFY_WEBHOOK_PARAMETER_TYPE_LABELS: Readonly<Record<NotifyWebhookParameterType, string>>;
27
+ export declare function readNotifyWebhookEndpointOptionId(endpoint: {
28
+ readonly key: string;
29
+ readonly version: number;
30
+ }): string;
31
+ export declare function findNotifyWebhookEndpoint(endpoints: readonly NotifyWebhookDesignerEndpoint[], reference: {
32
+ readonly key: string;
33
+ readonly version: number;
34
+ }): NotifyWebhookDesignerEndpoint | null;
35
+ /**
36
+ * The sources a parameter can take. A `CONTEXT` path is always a string, and
37
+ * a `CONSTANT` cannot hold a list, so those are only offered where they fit.
38
+ */
39
+ export declare function readNotifyWebhookBindingKinds(type: NotifyWebhookParameterType): readonly NotifyWebhookBindingKind[];
40
+ export declare function readCompatibleFormFields(formFields: readonly FormFieldDefinition[], type: NotifyWebhookParameterType): readonly FormFieldDefinition[];
41
+ /** The value a binding starts with when its source kind is picked. */
42
+ export declare function createNotifyWebhookBindingSource(kind: NotifyWebhookBindingKind, parameter: DesignerParameter, formFields: readonly FormFieldDefinition[]): NotifyWebhookBindingSource;
43
+ /**
44
+ * Reads a typed constant from a text input. A number parameter takes plain
45
+ * decimals only (no `0x1f`, no exponent); anything else, including a number
46
+ * still being typed such as `1.`, stays text so the publish check can point
47
+ * at it instead of the input silently changing what was typed.
48
+ */
49
+ export declare function readNotifyWebhookConstantValue(type: NotifyWebhookParameterType, raw: string): boolean | number | string | null;
50
+ /**
51
+ * Whether the editor can render a node's `webhooks` at all. Parsed JSON is
52
+ * saved as a draft without the structural lint, so a hand-edited list may
53
+ * hold values the editor would throw on.
54
+ */
55
+ export declare function isNotifyWebhookListEditable(webhooks: unknown): boolean;
56
+ /** Sets, or with `null` removes, the binding for one parameter. */
57
+ export declare function setNotifyWebhookBinding(target: NotifyWebhookTarget, parameter: string, from: NotifyWebhookBindingSource | null): NotifyWebhookTarget;
58
+ /**
59
+ * Points a target at another endpoint, keeping the id (deliveries are keyed
60
+ * by it) and every binding whose parameter the new endpoint still declares
61
+ * with a type the bound value fits.
62
+ */
63
+ export declare function switchNotifyWebhookEndpoint(target: NotifyWebhookTarget, endpoint: NotifyWebhookDesignerEndpoint, formFields: readonly FormFieldDefinition[]): NotifyWebhookTarget;
64
+ /**
65
+ * The publish check the backend runs against the catalog, worded for the
66
+ * designer. Only structurally valid targets are checked; shape problems are
67
+ * already reported by the shared structural lint.
68
+ */
69
+ export declare function readNotifyWebhookDesignerIssues({ definition, endpoints, formFields, }: {
70
+ readonly definition: WorkflowDefinition;
71
+ readonly endpoints: readonly NotifyWebhookDesignerEndpoint[];
72
+ readonly formFields: readonly FormFieldDefinition[];
73
+ }): readonly string[];
74
+ export {};
@@ -0,0 +1,17 @@
1
+ import { PositionRecord } from '@rytass/bpm-core-client/organization';
2
+ export type PositionLevelOption = Readonly<{
3
+ id: string;
4
+ name: string;
5
+ value: number;
6
+ }>;
7
+ type PositionLevelSource = Pick<PositionRecord, 'level' | 'name'>;
8
+ /**
9
+ * One option per distinct position level in the directory, highest first, each
10
+ * labelled with the positions sitting on that level. A saved level that no
11
+ * position carries (positions deleted or not loaded yet) is still offered so
12
+ * the select never renders blank and the stored value is not silently changed.
13
+ */
14
+ export declare function readMinPositionLevelOptions(positions: readonly PositionLevelSource[], currentLevel: number): readonly PositionLevelOption[];
15
+ /** The highest level in the directory, or `1` when there are no positions. */
16
+ export declare function readDefaultMinPositionLevel(positions: readonly PositionLevelSource[]): number;
17
+ export {};
@@ -0,0 +1,21 @@
1
+ import { UseChatHelpers } from '@ai-sdk/react';
2
+ import { UIMessage } from 'ai';
3
+ import { WorkflowDesignerController } from './use-workflow-designer-controller.cjs';
4
+ /**
5
+ * Connects the workflow designer chat UI to the LLM.
6
+ *
7
+ * The server route (`@rytass/bpm-core-react/next/workflow-chat-route`) advertises
8
+ * the workflow tools with no `execute`, so every tool call is forwarded here.
9
+ * `onToolCall` runs it against the same {@link WorkflowDesignerController} the UI
10
+ * uses — so the assistant draws on the canvas exactly as a user would — and feeds
11
+ * the resulting snapshot back to the model, forming the observe→act loop.
12
+ *
13
+ * All tools are dynamic on the client (their names are not statically wired into
14
+ * `useChat`), so we handle (not skip) `toolCall.dynamic`.
15
+ */
16
+ export interface UseWorkflowChatOptions {
17
+ readonly controller: WorkflowDesignerController;
18
+ /** Chat API route. Defaults to same-origin `/api/chat`. */
19
+ readonly api?: string;
20
+ }
21
+ export declare function useWorkflowChat({ controller, api, }: UseWorkflowChatOptions): UseChatHelpers<UIMessage>;
@@ -1,6 +1,6 @@
1
1
  import { UseChatHelpers } from '@ai-sdk/react';
2
2
  import { UIMessage } from 'ai';
3
- import { WorkflowDesignerController } from './use-workflow-designer-controller';
3
+ import { WorkflowDesignerController } from './use-workflow-designer-controller.js';
4
4
  /**
5
5
  * Connects the workflow designer chat UI to the LLM.
6
6
  *
@@ -0,0 +1,41 @@
1
+ import { WorkflowCommand, WorkflowCommandResult, WorkflowDesignerState, WorkflowMacroCommand, WorkflowDirectory, WorkflowSnapshot, WorkflowTool, WorkflowToolResult } from '@rytass/bpm-core-shared';
2
+ import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
3
+ /**
4
+ * Bridges the pure, framework-agnostic workflow command layer
5
+ * (`@rytass/bpm-core-shared`) to React. It owns the {@link WorkflowDesignerState}
6
+ * and is the single dispatch path through which both the designer UI and the
7
+ * LLM assistant mutate the workflow — guaranteeing the assistant can do exactly
8
+ * what a user can.
9
+ *
10
+ * The pure reducer only describes logical structure; this hook injects the
11
+ * pixel concern: whenever a command reports `effects.layout`, the supplied
12
+ * `layout` function (dagre) recomputes node positions, and `onLayout` is invoked
13
+ * so the host can refit the viewport.
14
+ */
15
+ export interface UseWorkflowDesignerControllerOptions {
16
+ readonly initialState: WorkflowDesignerState;
17
+ /** Recompute node pixel positions (dagre) — runs after topology changes. */
18
+ readonly layout: (definition: WorkflowDefinition) => WorkflowDefinition;
19
+ /** Notified with the laid-out definition so the host can refit the viewport. */
20
+ readonly onLayout?: (definition: WorkflowDefinition) => void;
21
+ /** Org directory backing the LLM's member/org lookup query tools. */
22
+ readonly directory?: WorkflowDirectory;
23
+ }
24
+ export interface WorkflowDesignerController {
25
+ readonly state: WorkflowDesignerState;
26
+ readonly snapshot: WorkflowSnapshot;
27
+ /** The advertised LLM tool catalog (JSON Schema input contracts). */
28
+ readonly tools: readonly WorkflowTool[];
29
+ /** Dispatch a single primitive command. */
30
+ readonly dispatch: (command: WorkflowCommand) => WorkflowCommandResult;
31
+ /** Dispatch a high-level macro command. */
32
+ readonly dispatchMacro: (command: WorkflowMacroCommand) => WorkflowCommandResult;
33
+ /** Execute an LLM tool call by name; mutations commit + relayout. Async
34
+ * because directory query tools may fetch from the host. */
35
+ readonly executeTool: (toolName: string, input: unknown) => Promise<WorkflowToolResult>;
36
+ /** Replace the whole state (e.g. after loading a draft from the server). */
37
+ readonly replaceState: (next: WorkflowDesignerState | ((current: WorkflowDesignerState) => WorkflowDesignerState)) => void;
38
+ /** Imperatively read the latest committed state (avoids stale closures). */
39
+ readonly getState: () => WorkflowDesignerState;
40
+ }
41
+ export declare function useWorkflowDesignerController({ directory, initialState, layout, onLayout, }: UseWorkflowDesignerControllerOptions): WorkflowDesignerController;
@@ -0,0 +1,16 @@
1
+ import { ReactElement } from 'react';
2
+ import { WorkflowDesignerController } from './use-workflow-designer-controller.cjs';
3
+ /**
4
+ * Right-side AI assistant drawer for the workflow designer. Users describe the
5
+ * flow in natural language; the assistant draws it on the canvas by driving the
6
+ * shared workflow toolset through {@link useWorkflowChat}. The layout (canvas +
7
+ * 420px panel) is untouched — this slides over it.
8
+ */
9
+ export interface WorkflowChatDrawerProps {
10
+ readonly controller: WorkflowDesignerController;
11
+ readonly open: boolean;
12
+ readonly onClose: () => void;
13
+ /** Chat API route. Defaults to same-origin `/api/chat`. */
14
+ readonly api?: string;
15
+ }
16
+ export declare function WorkflowChatDrawer({ api, controller, onClose, open, }: WorkflowChatDrawerProps): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { WorkflowDesignerController } from './use-workflow-designer-controller';
2
+ import { WorkflowDesignerController } from './use-workflow-designer-controller.js';
3
3
  /**
4
4
  * Right-side AI assistant drawer for the workflow designer. Users describe the
5
5
  * flow in natural language; the assistant draws it on the canvas by driving the
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/rolldown-runtime-BocRIvOZ.cjs"),t=require("../../chunks/router-adapter--gYs13E8.cjs"),n=require("../../chunks/format-date-time-D-cx5M8z.cjs"),r=require("../../chunks/routes-config-C1j_vFKo.cjs"),i=require("../../chunks/categories-DjENouRm.cjs"),a=require("./versions/index.cjs");let o=require("react"),s=require("@mezzanine-ui/react"),c=require("react/jsx-runtime"),l=require("@rytass/bpm-core-client/workflow"),u=require("@mezzanine-ui/core/form"),d=require("@mezzanine-ui/react/ContentHeader");d=e.t(d,1);let f=require("@mezzanine-ui/icons"),p=require("@rytass/bpm-core-client/template");var m=[10,20,50],h=[{key:`ALL`,label:`全部`},{key:`PUBLISHED`,label:`已發布`},{key:`DRAFT`,label:`草稿`}],g=100;function _(){let e=t.r(),a=r.r(),[_,O]=(0,o.useState)([]),[k,A]=(0,o.useState)(C),[j,M]=(0,o.useState)([]),[N,P]=(0,o.useState)(new Set),[F,I]=(0,o.useState)(null),[L,R]=(0,o.useState)(!0),[z,B]=(0,o.useState)(1),[V,H]=(0,o.useState)(10),[U,W]=(0,o.useState)(``),[G,K]=(0,o.useState)(`ALL`),[q,J]=(0,o.useState)(0),[Y,X]=(0,o.useState)(null),Z=(0,o.useRef)(0),Q=(0,o.useCallback)(async()=>{let e=Z.current+1;Z.current=e,R(!0),I(null),P(new Set),(0,l.listLaunchableTemplates)().then(t=>{e===Z.current&&P(new Set(t.map(e=>e.id)))}).catch(()=>{e===Z.current&&P(new Set)});try{let[t,n]=await Promise.all([(0,p.listApprovalTemplatesPage)({categoryId:k.categoryId,page:z,pageSize:V,searchText:U,status:G===`ALL`?null:G}),(0,p.listApprovalTemplateCategoriesPage)({page:1,pageSize:g,searchText:``,status:`ACTIVE`})]);if(e!==Z.current)return;M([...n.categories.map(w)]),O(t.templates),J(t.totalCount)}catch(t){e===Z.current&&I(v(t))}finally{e===Z.current&&R(!1)}},[k,z,V,U,G]);(0,o.useEffect)(()=>{Q()},[Q]);let $=(0,o.useCallback)(async e=>{X(e.id),I(null);try{await(e.isActive?(0,p.deactivateApprovalTemplate)(e.id):(0,p.activateApprovalTemplate)(e.id)),await Q()}catch(e){I(v(e))}finally{X(null)}},[Q]),ee=(0,o.useMemo)(()=>_.map(e=>({...e,categoryLabel:D(e),key:e.id,status:e.currentVersionId?`PUBLISHED`:`DRAFT`,updatedAt:n.t(e.updatedAt)})),[_]),te=(0,o.useMemo)(()=>[{dataIndex:`name`,key:`name`,title:`模板名稱`,width:220},{key:`status`,render:e=>(0,c.jsx)(b,{status:e.status}),title:`狀態`,width:120},{key:`isActive`,render:e=>(0,c.jsx)(x,{isActive:e.isActive}),title:`服務狀態`,width:120},{key:`category`,render:e=>(0,c.jsx)(S,{record:e}),title:`分類`,width:160},{dataIndex:`updatedAt`,key:`updatedAt`,title:`更新時間`,width:220}],[]),ne=(0,o.useMemo)(()=>({render:t=>[{disabled:e=>!N.has(e.id),name:`發起`,onClick:()=>e.push(a.caseNew(t.id)),variant:`base-primary`},{name:`設計`,onClick:()=>e.push(a.templateDesigner(t.id))},{name:`版本`,onClick:()=>e.push(a.templateVersions(t.id))},{disabled:e=>Y===e.id,name:t.isActive?`停用`:`啟用`,onClick:e=>{$(e)},variant:t.isActive?`destructive-secondary`:`base-secondary`}],variant:`base-secondary`,width:264}),[Y,N,e,$]);return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.PageHeader,{children:(0,c.jsx)(d.default,{description:`建立流程模板、維護草稿與發布版本。`,title:`簽核模板`,children:(0,c.jsx)(s.Button,{icon:f.PlusIcon,iconType:`leading`,onClick:()=>e.push(a.templateCompose()),variant:`base-primary`,children:`建立模板`})})}),(0,c.jsx)(s.SectionGroup,{children:(0,c.jsxs)(s.Section,{filterArea:(0,c.jsx)(s.FilterArea,{className:i.n.templateFilterArea,size:`sub`,children:(0,c.jsxs)(s.FilterLine,{children:[(0,c.jsx)(s.Filter,{span:3,children:(0,c.jsx)(s.FormField,{fullWidth:!0,layout:u.FormFieldLayout.VERTICAL,name:`templateSearchText`,children:(0,c.jsx)(s.Input,{fullWidth:!0,onChange:e=>{W(e.target.value),B(1)},placeholder:`關鍵字:搜尋模板名稱、分類或描述`,size:`sub`,value:U,variant:`base`})})}),(0,c.jsx)(s.Filter,{span:2,children:(0,c.jsx)(s.FormField,{fullWidth:!0,layout:u.FormFieldLayout.VERTICAL,name:`templateCategoryFilter`,children:(0,c.jsx)(s.Select,{clearable:!1,fullWidth:!0,onChange:e=>{A(T(e,j)),B(1)},options:[C,...j],placeholder:`分類`,renderValue:e=>`分類:${E(e)}`,size:`sub`,value:k})})})]})}),tab:(0,c.jsx)(s.Tab,{activeKey:G,onChange:e=>{K(y(e)),B(1)},children:h.map(e=>(0,c.jsx)(s.TabItem,{children:e.label},e.key))}),children:[F?(0,c.jsx)(s.Typography,{color:`text-error`,variant:`body`,children:F}):null,(0,c.jsx)(s.Table,{actions:ne,columns:te,dataSource:ee,fullWidth:!0,loading:L,pagination:{current:z,onChange:e=>{B(e)},onChangePageSize:e=>{B(1),H(e)},pageSize:V,pageSizeLabel:`每頁筆數`,pageSizeOptions:m,renderResultSummary:(e,t,n)=>`顯示 ${e}-${t} 筆,共 ${n} 筆`,showPageSizeOptions:!0,total:q}})]})})]})})}function v(e){return e instanceof Error?e.message:`發生未知錯誤`}function y(e){return e===`PUBLISHED`||e===`DRAFT`?e:`ALL`}function b({status:e}){return e===`PUBLISHED`?(0,c.jsx)(s.Badge,{size:`sub`,text:`已發布`,variant:`dot-success`}):(0,c.jsx)(s.Badge,{size:`sub`,text:`草稿`,variant:`dot-inactive`})}function x({isActive:e}){return e?(0,c.jsx)(s.Badge,{size:`sub`,text:`啟用中`,variant:`dot-success`}):(0,c.jsx)(s.Badge,{size:`sub`,text:`已停用`,variant:`dot-inactive`})}function S({record:e}){return e.categoryDetail?.isActive===!1?(0,c.jsx)(s.Badge,{size:`sub`,text:`${e.categoryLabel}(停用)`,variant:`dot-inactive`}):(0,c.jsx)(s.Typography,{component:`span`,variant:`body`,children:e.categoryLabel})}var C={categoryId:null,id:`ALL_CATEGORIES`,name:`全部分類`};function w(e){return{categoryId:e.id,id:e.id,name:e.name}}function T(e,t){if(!O(e))return C;let n=typeof e.id==`string`?e.id:null;return n===C.id?C:t.find(e=>e.id===n)??C}function E(e){return Array.isArray(e)||!O(e)?C.name:typeof e.name==`string`?e.name:C.name}function D(e){return e.categoryDetail?.name??e.category??`未分類`}function O(e){return typeof e==`object`&&!!e}exports.TemplateCategoriesView=i.t,exports.TemplateVersionsView=a.TemplateVersionsView,exports.TemplatesView=_;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/rolldown-runtime-BocRIvOZ.cjs"),t=require("../../chunks/router-adapter--gYs13E8.cjs"),n=require("../../chunks/format-date-time-D-cx5M8z.cjs"),r=require("../../chunks/routes-config-C1j_vFKo.cjs"),i=require("../../chunks/categories-AxxhqjLZ.cjs"),a=require("./versions/index.cjs");let o=require("react"),s=require("@mezzanine-ui/react"),c=require("react/jsx-runtime"),l=require("@rytass/bpm-core-client/workflow"),u=require("@mezzanine-ui/core/form"),d=require("@mezzanine-ui/react/ContentHeader");d=e.t(d,1);let f=require("@mezzanine-ui/icons"),p=require("@rytass/bpm-core-client/template");var m=[10,20,50],h=[{key:`ALL`,label:`全部`},{key:`PUBLISHED`,label:`已發布`},{key:`DRAFT`,label:`草稿`}],g=100;function _(){let e=t.r(),a=r.r(),[_,O]=(0,o.useState)([]),[k,A]=(0,o.useState)(C),[j,M]=(0,o.useState)([]),[N,P]=(0,o.useState)(new Set),[F,I]=(0,o.useState)(null),[L,R]=(0,o.useState)(!0),[z,B]=(0,o.useState)(1),[V,H]=(0,o.useState)(10),[U,W]=(0,o.useState)(``),[G,K]=(0,o.useState)(`ALL`),[q,J]=(0,o.useState)(0),[Y,X]=(0,o.useState)(null),Z=(0,o.useRef)(0),Q=(0,o.useCallback)(async()=>{let e=Z.current+1;Z.current=e,R(!0),I(null),P(new Set),(0,l.listLaunchableTemplates)().then(t=>{e===Z.current&&P(new Set(t.map(e=>e.id)))}).catch(()=>{e===Z.current&&P(new Set)});try{let[t,n]=await Promise.all([(0,p.listApprovalTemplatesPage)({categoryId:k.categoryId,page:z,pageSize:V,searchText:U,status:G===`ALL`?null:G}),(0,p.listApprovalTemplateCategoriesPage)({page:1,pageSize:g,searchText:``,status:`ACTIVE`})]);if(e!==Z.current)return;M([...n.categories.map(w)]),O(t.templates),J(t.totalCount)}catch(t){e===Z.current&&I(v(t))}finally{e===Z.current&&R(!1)}},[k,z,V,U,G]);(0,o.useEffect)(()=>{Q()},[Q]);let $=(0,o.useCallback)(async e=>{X(e.id),I(null);try{await(e.isActive?(0,p.deactivateApprovalTemplate)(e.id):(0,p.activateApprovalTemplate)(e.id)),await Q()}catch(e){I(v(e))}finally{X(null)}},[Q]),ee=(0,o.useMemo)(()=>_.map(e=>({...e,categoryLabel:D(e),key:e.id,status:e.currentVersionId?`PUBLISHED`:`DRAFT`,updatedAt:n.t(e.updatedAt)})),[_]),te=(0,o.useMemo)(()=>[{dataIndex:`name`,key:`name`,title:`模板名稱`,width:220},{key:`status`,render:e=>(0,c.jsx)(b,{status:e.status}),title:`狀態`,width:120},{key:`isActive`,render:e=>(0,c.jsx)(x,{isActive:e.isActive}),title:`服務狀態`,width:120},{key:`category`,render:e=>(0,c.jsx)(S,{record:e}),title:`分類`,width:160},{dataIndex:`updatedAt`,key:`updatedAt`,title:`更新時間`,width:220}],[]),ne=(0,o.useMemo)(()=>({render:t=>[{disabled:e=>!N.has(e.id),name:`發起`,onClick:()=>e.push(a.caseNew(t.id)),variant:`base-primary`},{name:`設計`,onClick:()=>e.push(a.templateDesigner(t.id))},{name:`版本`,onClick:()=>e.push(a.templateVersions(t.id))},{disabled:e=>Y===e.id,name:t.isActive?`停用`:`啟用`,onClick:e=>{$(e)},variant:t.isActive?`destructive-secondary`:`base-secondary`}],variant:`base-secondary`,width:264}),[Y,N,e,$]);return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.PageHeader,{children:(0,c.jsx)(d.default,{description:`建立流程模板、維護草稿與發布版本。`,title:`簽核模板`,children:(0,c.jsx)(s.Button,{icon:f.PlusIcon,iconType:`leading`,onClick:()=>e.push(a.templateCompose()),variant:`base-primary`,children:`建立模板`})})}),(0,c.jsx)(s.SectionGroup,{children:(0,c.jsxs)(s.Section,{filterArea:(0,c.jsx)(s.FilterArea,{className:i.n.templateFilterArea,size:`sub`,children:(0,c.jsxs)(s.FilterLine,{children:[(0,c.jsx)(s.Filter,{span:3,children:(0,c.jsx)(s.FormField,{fullWidth:!0,layout:u.FormFieldLayout.VERTICAL,name:`templateSearchText`,children:(0,c.jsx)(s.Input,{fullWidth:!0,onChange:e=>{W(e.target.value),B(1)},placeholder:`關鍵字:搜尋模板名稱、分類或描述`,size:`sub`,value:U,variant:`base`})})}),(0,c.jsx)(s.Filter,{span:2,children:(0,c.jsx)(s.FormField,{fullWidth:!0,layout:u.FormFieldLayout.VERTICAL,name:`templateCategoryFilter`,children:(0,c.jsx)(s.Select,{clearable:!1,fullWidth:!0,onChange:e=>{A(T(e,j)),B(1)},options:[C,...j],placeholder:`分類`,renderValue:e=>`分類:${E(e)}`,size:`sub`,value:k})})})]})}),tab:(0,c.jsx)(s.Tab,{activeKey:G,onChange:e=>{K(y(e)),B(1)},children:h.map(e=>(0,c.jsx)(s.TabItem,{children:e.label},e.key))}),children:[F?(0,c.jsx)(s.Typography,{color:`text-error`,variant:`body`,children:F}):null,(0,c.jsx)(s.Table,{actions:ne,columns:te,dataSource:ee,fullWidth:!0,loading:L,pagination:{current:z,onChange:e=>{B(e)},onChangePageSize:e=>{B(1),H(e)},pageSize:V,pageSizeLabel:`每頁筆數`,pageSizeOptions:m,renderResultSummary:(e,t,n)=>`顯示 ${e}-${t} 筆,共 ${n} 筆`,showPageSizeOptions:!0,total:q}})]})})]})})}function v(e){return e instanceof Error?e.message:`發生未知錯誤`}function y(e){return e===`PUBLISHED`||e===`DRAFT`?e:`ALL`}function b({status:e}){return e===`PUBLISHED`?(0,c.jsx)(s.Badge,{size:`sub`,text:`已發布`,variant:`dot-success`}):(0,c.jsx)(s.Badge,{size:`sub`,text:`草稿`,variant:`dot-inactive`})}function x({isActive:e}){return e?(0,c.jsx)(s.Badge,{size:`sub`,text:`啟用中`,variant:`dot-success`}):(0,c.jsx)(s.Badge,{size:`sub`,text:`已停用`,variant:`dot-inactive`})}function S({record:e}){return e.categoryDetail?.isActive===!1?(0,c.jsx)(s.Badge,{size:`sub`,text:`${e.categoryLabel}(停用)`,variant:`dot-inactive`}):(0,c.jsx)(s.Typography,{component:`span`,variant:`body`,children:e.categoryLabel})}var C={categoryId:null,id:`ALL_CATEGORIES`,name:`全部分類`};function w(e){return{categoryId:e.id,id:e.id,name:e.name}}function T(e,t){if(!O(e))return C;let n=typeof e.id==`string`?e.id:null;return n===C.id?C:t.find(e=>e.id===n)??C}function E(e){return Array.isArray(e)||!O(e)?C.name:typeof e.name==`string`?e.name:C.name}function D(e){return e.categoryDetail?.name??e.category??`未分類`}function O(e){return typeof e==`object`&&!!e}exports.TemplateCategoriesView=i.t,exports.TemplateVersionsView=a.TemplateVersionsView,exports.TemplatesView=_;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,3 @@
1
+ export * from './TemplatesView.cjs';
2
+ export * from './categories/index.cjs';
3
+ export * from './versions/index.cjs';
@@ -1,3 +1,3 @@
1
- export * from './TemplatesView';
2
- export * from './categories';
3
- export * from './versions';
1
+ export * from './TemplatesView.js';
2
+ export * from './categories/index.js';
3
+ export * from './versions/index.js';
@@ -2,7 +2,7 @@
2
2
  import { r as e } from "../../chunks/router-adapter-DftlFTOd.js";
3
3
  import { t } from "../../chunks/format-date-time-CB-LxzqT.js";
4
4
  import { r as n } from "../../chunks/routes-config-yZbESPlw.js";
5
- import { n as ee, t as r } from "../../chunks/categories-1gKxeEqw.js";
5
+ import { n as ee, t as r } from "../../chunks/categories-riC33J_j.js";
6
6
  import { TemplateVersionsView as i } from "./versions/index.js";
7
7
  import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
8
8
  import { Badge as u, Button as te, Filter as d, FilterArea as ne, FilterLine as re, FormField as f, Input as p, PageHeader as m, Section as h, SectionGroup as ie, Select as ae, Tab as oe, TabItem as se, Table as ce, Typography as g } from "@mezzanine-ui/react";
@@ -0,0 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+ export interface TemplateVersionsViewProps {
3
+ readonly templateId: string;
4
+ }
5
+ export declare function TemplateVersionsView({ templateId, }: TemplateVersionsViewProps): ReactElement;
@@ -0,0 +1 @@
1
+ export * from './TemplateVersionsView.cjs';
@@ -1 +1 @@
1
- export * from './TemplateVersionsView';
1
+ export * from './TemplateVersionsView.js';
@@ -0,0 +1,4 @@
1
+ export * from '../inbox/index.cjs';
2
+ export * from '../sent/index.cjs';
3
+ export * from '../cc/index.cjs';
4
+ export * from '../search/index.cjs';
@@ -1,4 +1,4 @@
1
- export * from '../inbox';
2
- export * from '../sent';
3
- export * from '../cc';
4
- export * from '../search';
1
+ export * from '../inbox/index.js';
2
+ export * from '../sent/index.js';
3
+ export * from '../cc/index.js';
4
+ export * from '../search/index.js';