@quanticjs/workflow-ui 0.1.0

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 (186) hide show
  1. package/dist/components/ProcessTimeline/ProcessTimeline.d.ts +7 -0
  2. package/dist/components/ProcessTimeline/ProcessTimeline.d.ts.map +1 -0
  3. package/dist/components/ProcessTimeline/ProcessTimeline.js +48 -0
  4. package/dist/components/ProcessTimeline/ProcessTimeline.js.map +1 -0
  5. package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.d.ts +6 -0
  6. package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.d.ts.map +1 -0
  7. package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.js +6 -0
  8. package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.js.map +1 -0
  9. package/dist/components/ProcessTimeline/TimelineEntry.d.ts +8 -0
  10. package/dist/components/ProcessTimeline/TimelineEntry.d.ts.map +1 -0
  11. package/dist/components/ProcessTimeline/TimelineEntry.js +66 -0
  12. package/dist/components/ProcessTimeline/TimelineEntry.js.map +1 -0
  13. package/dist/components/ProcessTimeline/index.d.ts +4 -0
  14. package/dist/components/ProcessTimeline/index.d.ts.map +1 -0
  15. package/dist/components/ProcessTimeline/index.js +4 -0
  16. package/dist/components/ProcessTimeline/index.js.map +1 -0
  17. package/dist/components/TaskActions/ConfirmationDialog.d.ts +8 -0
  18. package/dist/components/TaskActions/ConfirmationDialog.d.ts.map +1 -0
  19. package/dist/components/TaskActions/ConfirmationDialog.js +45 -0
  20. package/dist/components/TaskActions/ConfirmationDialog.js.map +1 -0
  21. package/dist/components/TaskActions/TaskActions.d.ts +10 -0
  22. package/dist/components/TaskActions/TaskActions.d.ts.map +1 -0
  23. package/dist/components/TaskActions/TaskActions.js +51 -0
  24. package/dist/components/TaskActions/TaskActions.js.map +1 -0
  25. package/dist/components/TaskActions/index.d.ts +3 -0
  26. package/dist/components/TaskActions/index.d.ts.map +1 -0
  27. package/dist/components/TaskActions/index.js +3 -0
  28. package/dist/components/TaskActions/index.js.map +1 -0
  29. package/dist/components/TaskDetail/TaskDetail.d.ts +8 -0
  30. package/dist/components/TaskDetail/TaskDetail.d.ts.map +1 -0
  31. package/dist/components/TaskDetail/TaskDetail.js +116 -0
  32. package/dist/components/TaskDetail/TaskDetail.js.map +1 -0
  33. package/dist/components/TaskDetail/TaskDetailError.d.ts +7 -0
  34. package/dist/components/TaskDetail/TaskDetailError.d.ts.map +1 -0
  35. package/dist/components/TaskDetail/TaskDetailError.js +8 -0
  36. package/dist/components/TaskDetail/TaskDetailError.js.map +1 -0
  37. package/dist/components/TaskDetail/TaskDetailHeader.d.ts +7 -0
  38. package/dist/components/TaskDetail/TaskDetailHeader.d.ts.map +1 -0
  39. package/dist/components/TaskDetail/TaskDetailHeader.js +39 -0
  40. package/dist/components/TaskDetail/TaskDetailHeader.js.map +1 -0
  41. package/dist/components/TaskDetail/TaskDetailNotFound.d.ts +5 -0
  42. package/dist/components/TaskDetail/TaskDetailNotFound.d.ts.map +1 -0
  43. package/dist/components/TaskDetail/TaskDetailNotFound.js +6 -0
  44. package/dist/components/TaskDetail/TaskDetailNotFound.js.map +1 -0
  45. package/dist/components/TaskDetail/TaskDetailSkeleton.d.ts +5 -0
  46. package/dist/components/TaskDetail/TaskDetailSkeleton.d.ts.map +1 -0
  47. package/dist/components/TaskDetail/TaskDetailSkeleton.js +6 -0
  48. package/dist/components/TaskDetail/TaskDetailSkeleton.js.map +1 -0
  49. package/dist/components/TaskDetail/index.d.ts +6 -0
  50. package/dist/components/TaskDetail/index.d.ts.map +1 -0
  51. package/dist/components/TaskDetail/index.js +6 -0
  52. package/dist/components/TaskDetail/index.js.map +1 -0
  53. package/dist/components/TaskInbox/TaskCard.d.ts +10 -0
  54. package/dist/components/TaskInbox/TaskCard.d.ts.map +1 -0
  55. package/dist/components/TaskInbox/TaskCard.js +90 -0
  56. package/dist/components/TaskInbox/TaskCard.js.map +1 -0
  57. package/dist/components/TaskInbox/TaskFilters.d.ts +10 -0
  58. package/dist/components/TaskInbox/TaskFilters.d.ts.map +1 -0
  59. package/dist/components/TaskInbox/TaskFilters.js +59 -0
  60. package/dist/components/TaskInbox/TaskFilters.js.map +1 -0
  61. package/dist/components/TaskInbox/TaskInbox.d.ts +12 -0
  62. package/dist/components/TaskInbox/TaskInbox.d.ts.map +1 -0
  63. package/dist/components/TaskInbox/TaskInbox.js +85 -0
  64. package/dist/components/TaskInbox/TaskInbox.js.map +1 -0
  65. package/dist/components/TaskInbox/TaskInboxEmpty.d.ts +7 -0
  66. package/dist/components/TaskInbox/TaskInboxEmpty.d.ts.map +1 -0
  67. package/dist/components/TaskInbox/TaskInboxEmpty.js +6 -0
  68. package/dist/components/TaskInbox/TaskInboxEmpty.js.map +1 -0
  69. package/dist/components/TaskInbox/TaskInboxError.d.ts +7 -0
  70. package/dist/components/TaskInbox/TaskInboxError.d.ts.map +1 -0
  71. package/dist/components/TaskInbox/TaskInboxError.js +8 -0
  72. package/dist/components/TaskInbox/TaskInboxError.js.map +1 -0
  73. package/dist/components/TaskInbox/TaskInboxSkeleton.d.ts +6 -0
  74. package/dist/components/TaskInbox/TaskInboxSkeleton.d.ts.map +1 -0
  75. package/dist/components/TaskInbox/TaskInboxSkeleton.js +6 -0
  76. package/dist/components/TaskInbox/TaskInboxSkeleton.js.map +1 -0
  77. package/dist/components/TaskInbox/index.d.ts +7 -0
  78. package/dist/components/TaskInbox/index.d.ts.map +1 -0
  79. package/dist/components/TaskInbox/index.js +7 -0
  80. package/dist/components/TaskInbox/index.js.map +1 -0
  81. package/dist/components/WorkflowForm/FieldRenderer.d.ts +14 -0
  82. package/dist/components/WorkflowForm/FieldRenderer.d.ts.map +1 -0
  83. package/dist/components/WorkflowForm/FieldRenderer.js +28 -0
  84. package/dist/components/WorkflowForm/FieldRenderer.js.map +1 -0
  85. package/dist/components/WorkflowForm/FormSection.d.ts +10 -0
  86. package/dist/components/WorkflowForm/FormSection.d.ts.map +1 -0
  87. package/dist/components/WorkflowForm/FormSection.js +12 -0
  88. package/dist/components/WorkflowForm/FormSection.js.map +1 -0
  89. package/dist/components/WorkflowForm/WorkflowForm.d.ts +11 -0
  90. package/dist/components/WorkflowForm/WorkflowForm.d.ts.map +1 -0
  91. package/dist/components/WorkflowForm/WorkflowForm.js +61 -0
  92. package/dist/components/WorkflowForm/WorkflowForm.js.map +1 -0
  93. package/dist/components/WorkflowForm/buildZodSchema.d.ts +4 -0
  94. package/dist/components/WorkflowForm/buildZodSchema.d.ts.map +1 -0
  95. package/dist/components/WorkflowForm/buildZodSchema.js +79 -0
  96. package/dist/components/WorkflowForm/buildZodSchema.js.map +1 -0
  97. package/dist/components/WorkflowForm/fields/CheckboxField.d.ts +3 -0
  98. package/dist/components/WorkflowForm/fields/CheckboxField.d.ts.map +1 -0
  99. package/dist/components/WorkflowForm/fields/CheckboxField.js +7 -0
  100. package/dist/components/WorkflowForm/fields/CheckboxField.js.map +1 -0
  101. package/dist/components/WorkflowForm/fields/DateField.d.ts +3 -0
  102. package/dist/components/WorkflowForm/fields/DateField.d.ts.map +1 -0
  103. package/dist/components/WorkflowForm/fields/DateField.js +7 -0
  104. package/dist/components/WorkflowForm/fields/DateField.js.map +1 -0
  105. package/dist/components/WorkflowForm/fields/FileUploadField.d.ts +3 -0
  106. package/dist/components/WorkflowForm/fields/FileUploadField.d.ts.map +1 -0
  107. package/dist/components/WorkflowForm/fields/FileUploadField.js +80 -0
  108. package/dist/components/WorkflowForm/fields/FileUploadField.js.map +1 -0
  109. package/dist/components/WorkflowForm/fields/MultiSelectField.d.ts +3 -0
  110. package/dist/components/WorkflowForm/fields/MultiSelectField.d.ts.map +1 -0
  111. package/dist/components/WorkflowForm/fields/MultiSelectField.js +33 -0
  112. package/dist/components/WorkflowForm/fields/MultiSelectField.js.map +1 -0
  113. package/dist/components/WorkflowForm/fields/NumberField.d.ts +3 -0
  114. package/dist/components/WorkflowForm/fields/NumberField.d.ts.map +1 -0
  115. package/dist/components/WorkflowForm/fields/NumberField.js +16 -0
  116. package/dist/components/WorkflowForm/fields/NumberField.js.map +1 -0
  117. package/dist/components/WorkflowForm/fields/ReadonlyField.d.ts +3 -0
  118. package/dist/components/WorkflowForm/fields/ReadonlyField.d.ts.map +1 -0
  119. package/dist/components/WorkflowForm/fields/ReadonlyField.js +6 -0
  120. package/dist/components/WorkflowForm/fields/ReadonlyField.js.map +1 -0
  121. package/dist/components/WorkflowForm/fields/SelectField.d.ts +3 -0
  122. package/dist/components/WorkflowForm/fields/SelectField.d.ts.map +1 -0
  123. package/dist/components/WorkflowForm/fields/SelectField.js +7 -0
  124. package/dist/components/WorkflowForm/fields/SelectField.js.map +1 -0
  125. package/dist/components/WorkflowForm/fields/TextField.d.ts +3 -0
  126. package/dist/components/WorkflowForm/fields/TextField.d.ts.map +1 -0
  127. package/dist/components/WorkflowForm/fields/TextField.js +7 -0
  128. package/dist/components/WorkflowForm/fields/TextField.js.map +1 -0
  129. package/dist/components/WorkflowForm/fields/TextareaField.d.ts +3 -0
  130. package/dist/components/WorkflowForm/fields/TextareaField.d.ts.map +1 -0
  131. package/dist/components/WorkflowForm/fields/TextareaField.js +7 -0
  132. package/dist/components/WorkflowForm/fields/TextareaField.js.map +1 -0
  133. package/dist/components/WorkflowForm/fields/UnknownField.d.ts +3 -0
  134. package/dist/components/WorkflowForm/fields/UnknownField.d.ts.map +1 -0
  135. package/dist/components/WorkflowForm/fields/UnknownField.js +7 -0
  136. package/dist/components/WorkflowForm/fields/UnknownField.js.map +1 -0
  137. package/dist/components/WorkflowForm/fields/shared.d.ts +22 -0
  138. package/dist/components/WorkflowForm/fields/shared.d.ts.map +1 -0
  139. package/dist/components/WorkflowForm/fields/shared.js +2 -0
  140. package/dist/components/WorkflowForm/fields/shared.js.map +1 -0
  141. package/dist/components/WorkflowForm/index.d.ts +5 -0
  142. package/dist/components/WorkflowForm/index.d.ts.map +1 -0
  143. package/dist/components/WorkflowForm/index.js +5 -0
  144. package/dist/components/WorkflowForm/index.js.map +1 -0
  145. package/dist/hooks/mutation-error-handler.d.ts +3 -0
  146. package/dist/hooks/mutation-error-handler.d.ts.map +1 -0
  147. package/dist/hooks/mutation-error-handler.js +20 -0
  148. package/dist/hooks/mutation-error-handler.js.map +1 -0
  149. package/dist/hooks/useProcessTimeline.d.ts +8 -0
  150. package/dist/hooks/useProcessTimeline.d.ts.map +1 -0
  151. package/dist/hooks/useProcessTimeline.js +17 -0
  152. package/dist/hooks/useProcessTimeline.js.map +1 -0
  153. package/dist/hooks/useTask.d.ts +3 -0
  154. package/dist/hooks/useTask.d.ts.map +1 -0
  155. package/dist/hooks/useTask.js +11 -0
  156. package/dist/hooks/useTask.js.map +1 -0
  157. package/dist/hooks/useTaskAction.d.ts +3 -0
  158. package/dist/hooks/useTaskAction.d.ts.map +1 -0
  159. package/dist/hooks/useTaskAction.js +15 -0
  160. package/dist/hooks/useTaskAction.js.map +1 -0
  161. package/dist/hooks/useTaskClaim.d.ts +5 -0
  162. package/dist/hooks/useTaskClaim.d.ts.map +1 -0
  163. package/dist/hooks/useTaskClaim.js +23 -0
  164. package/dist/hooks/useTaskClaim.js.map +1 -0
  165. package/dist/hooks/useTaskList.d.ts +3 -0
  166. package/dist/hooks/useTaskList.d.ts.map +1 -0
  167. package/dist/hooks/useTaskList.js +23 -0
  168. package/dist/hooks/useTaskList.js.map +1 -0
  169. package/dist/index.d.ts +13 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +12 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/provider/WorkflowProvider.d.ts +32 -0
  174. package/dist/provider/WorkflowProvider.d.ts.map +1 -0
  175. package/dist/provider/WorkflowProvider.js +52 -0
  176. package/dist/provider/WorkflowProvider.js.map +1 -0
  177. package/dist/test-setup.d.ts +2 -0
  178. package/dist/test-setup.d.ts.map +1 -0
  179. package/dist/test-setup.js +2 -0
  180. package/dist/test-setup.js.map +1 -0
  181. package/dist/tsconfig.build.tsbuildinfo +1 -0
  182. package/dist/types.d.ts +141 -0
  183. package/dist/types.d.ts.map +1 -0
  184. package/dist/types.js +2 -0
  185. package/dist/types.js.map +1 -0
  186. package/package.json +53 -0
@@ -0,0 +1,3 @@
1
+ import type { FieldProps } from './shared';
2
+ export declare function TextareaField({ field, register, error, readOnly }: FieldProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=TextareaField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextareaField.d.ts","sourceRoot":"","sources":["../../../../src/components/WorkflowForm/fields/TextareaField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,2CA6B7E"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function TextareaField({ field, register, error, readOnly }) {
3
+ const props = register(field.name);
4
+ const errorId = `${field.name}-error`;
5
+ return (_jsxs("div", { className: "col-span-2", children: [_jsx("label", { htmlFor: field.name, className: "mb-1.5 block text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: field.label }), _jsx("textarea", { id: field.name, ...props, disabled: readOnly, rows: 4, "aria-required": !readOnly && field.required ? 'true' : undefined, "aria-invalid": !!error || undefined, "aria-describedby": error ? errorId : undefined, className: `w-full resize-none rounded-xl border bg-muted/30 px-4 py-3 text-sm text-foreground placeholder-muted-foreground/50 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:opacity-60 ${error ? 'border-destructive' : 'border-border'}` }), error && (_jsx("p", { id: errorId, className: "mt-1 text-xs text-destructive", role: "alert", children: error }))] }));
6
+ }
7
+ //# sourceMappingURL=TextareaField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextareaField.js","sourceRoot":"","sources":["../../../../src/components/WorkflowForm/fields/TextareaField.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAc;IAC5E,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,QAAQ,CAAC;IAEtC,OAAO,CACL,eAAK,SAAS,EAAC,YAAY,aACzB,gBACE,OAAO,EAAE,KAAK,CAAC,IAAI,EACnB,SAAS,EAAC,uFAAuF,YAEhG,KAAK,CAAC,KAAK,GACN,EACR,mBACE,EAAE,EAAE,KAAK,CAAC,IAAI,KACV,KAAK,EACT,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,CAAC,mBACQ,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,kBACjD,CAAC,CAAC,KAAK,IAAI,SAAS,sBAChB,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC7C,SAAS,EAAE,wOAAwO,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,EAAE,GACnS,EACD,KAAK,IAAI,CACR,YAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,+BAA+B,EAAC,IAAI,EAAC,OAAO,YACnE,KAAK,GACJ,CACL,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FieldProps } from './shared';
2
+ export declare function UnknownField({ field, register, error, readOnly }: FieldProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=UnknownField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownField.d.ts","sourceRoot":"","sources":["../../../../src/components/WorkflowForm/fields/UnknownField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,2CAmC5E"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function UnknownField({ field, register, error, readOnly }) {
3
+ const props = register(field.name);
4
+ const errorId = `${field.name}-error`;
5
+ return (_jsxs("div", { children: [_jsxs("label", { htmlFor: field.name, className: "mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: [field.label, _jsx("span", { className: "rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-bold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", role: "status", children: "Unknown type" })] }), _jsx("input", { id: field.name, type: "text", ...props, disabled: readOnly, "aria-required": !readOnly && field.required ? 'true' : undefined, "aria-invalid": !!error || undefined, "aria-describedby": error ? errorId : undefined, className: `w-full rounded-xl border bg-muted/30 px-4 py-3 text-sm text-foreground placeholder-muted-foreground/50 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:opacity-60 ${error ? 'border-destructive' : 'border-border'}` }), error && (_jsx("p", { id: errorId, className: "mt-1 text-xs text-destructive", role: "alert", children: error }))] }));
6
+ }
7
+ //# sourceMappingURL=UnknownField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnknownField.js","sourceRoot":"","sources":["../../../../src/components/WorkflowForm/fields/UnknownField.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAc;IAC3E,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,QAAQ,CAAC;IAEtC,OAAO,CACL,0BACE,iBACE,OAAO,EAAE,KAAK,CAAC,IAAI,EACnB,SAAS,EAAC,uGAAuG,aAEhH,KAAK,CAAC,KAAK,EACZ,eACE,SAAS,EAAC,kHAAkH,EAC5H,IAAI,EAAC,QAAQ,6BAGR,IACD,EACR,gBACE,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAC,MAAM,KACP,KAAK,EACT,QAAQ,EAAE,QAAQ,mBACH,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,kBACjD,CAAC,CAAC,KAAK,IAAI,SAAS,sBAChB,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC7C,SAAS,EAAE,4NAA4N,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,EAAE,GACvR,EACD,KAAK,IAAI,CACR,YAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,+BAA+B,EAAC,IAAI,EAAC,OAAO,YACnE,KAAK,GACJ,CACL,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { ChangeEvent } from 'react';
2
+ import type { WorkflowFormField } from '../../../types';
3
+ export interface RegisterReturn {
4
+ name: string;
5
+ value: string;
6
+ onChange: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
7
+ onBlur: () => void;
8
+ }
9
+ export interface FieldProps {
10
+ field: WorkflowFormField;
11
+ register: (name: string) => RegisterReturn;
12
+ setValue: (name: string, value: unknown) => void;
13
+ error?: string;
14
+ readOnly?: boolean;
15
+ value?: unknown;
16
+ }
17
+ export interface FileReference {
18
+ id: string;
19
+ name: string;
20
+ url: string;
21
+ }
22
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/components/WorkflowForm/fields/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,GAAG,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/F,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,CAAC;IAC3C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/components/WorkflowForm/fields/shared.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export { WorkflowForm, type WorkflowFormProps } from './WorkflowForm';
2
+ export { FieldRenderer } from './FieldRenderer';
3
+ export { FormSection } from './FormSection';
4
+ export { buildZodSchema } from './buildZodSchema';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/WorkflowForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { WorkflowForm } from './WorkflowForm';
2
+ export { FieldRenderer } from './FieldRenderer';
3
+ export { FormSection } from './FormSection';
4
+ export { buildZodSchema } from './buildZodSchema';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/WorkflowForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { WorkflowToast } from '../provider/WorkflowProvider';
2
+ export declare function handleMutationError(error: unknown, toast: (t: WorkflowToast) => void): void;
3
+ //# sourceMappingURL=mutation-error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-error-handler.d.ts","sourceRoot":"","sources":["../../src/hooks/mutation-error-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,GAChC,IAAI,CAgBN"}
@@ -0,0 +1,20 @@
1
+ import { isApiError } from '@quanticjs/react-core';
2
+ export function handleMutationError(error, toast) {
3
+ if (isApiError(error)) {
4
+ toast({
5
+ title: error.isServerError ? 'Something went wrong' : error.title,
6
+ description: error.isServerError
7
+ ? `Please try again. (ref: ${error.correlationId ?? 'unknown'})`
8
+ : `${error.detail ?? ''} (ref: ${error.correlationId ?? 'unknown'})`,
9
+ variant: 'destructive',
10
+ });
11
+ }
12
+ else {
13
+ toast({
14
+ title: 'Something went wrong',
15
+ description: 'An unexpected error occurred.',
16
+ variant: 'destructive',
17
+ });
18
+ }
19
+ }
20
+ //# sourceMappingURL=mutation-error-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-error-handler.js","sourceRoot":"","sources":["../../src/hooks/mutation-error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,UAAU,mBAAmB,CACjC,KAAc,EACd,KAAiC;IAEjC,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,KAAK,CAAC;YACJ,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;YACjE,WAAW,EAAE,KAAK,CAAC,aAAa;gBAC9B,CAAC,CAAC,2BAA2B,KAAK,CAAC,aAAa,IAAI,SAAS,GAAG;gBAChE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,UAAU,KAAK,CAAC,aAAa,IAAI,SAAS,GAAG;YACtE,OAAO,EAAE,aAAa;SACvB,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,KAAK,CAAC;YACJ,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,+BAA+B;YAC5C,OAAO,EAAE,aAAa;SACvB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { TimelineResponse } from '../types';
2
+ interface UseProcessTimelineOptions {
3
+ limit?: number;
4
+ cursor?: string | null;
5
+ }
6
+ export declare function useProcessTimeline(instanceId: string, options?: UseProcessTimelineOptions): import("@tanstack/react-query").UseQueryResult<NoInfer<TimelineResponse>, Error>;
7
+ export {};
8
+ //# sourceMappingURL=useProcessTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProcessTimeline.d.ts","sourceRoot":"","sources":["../../src/hooks/useProcessTimeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,UAAU,yBAAyB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,yBAA8B,oFAmBxC"}
@@ -0,0 +1,17 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { useWorkflowContext } from '../provider/WorkflowProvider';
3
+ export function useProcessTimeline(instanceId, options = {}) {
4
+ const { apiClient } = useWorkflowContext();
5
+ const { limit = 20, cursor } = options;
6
+ return useQuery({
7
+ queryKey: ['workflow', 'timeline', instanceId, limit, cursor],
8
+ queryFn: () => apiClient.get(`/workflow/instances/${instanceId}/timeline`, {
9
+ params: {
10
+ limit,
11
+ ...(cursor && { cursor }),
12
+ },
13
+ }),
14
+ enabled: !!instanceId,
15
+ });
16
+ }
17
+ //# sourceMappingURL=useProcessTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProcessTimeline.js","sourceRoot":"","sources":["../../src/hooks/useProcessTimeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAQlE,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,UAAqC,EAAE;IAEvC,MAAM,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC3C,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEvC,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC;QAC7D,OAAO,EAAE,GAAG,EAAE,CACZ,SAAS,CAAC,GAAG,CACX,uBAAuB,UAAU,WAAW,EAC5C;YACE,MAAM,EAAE;gBACN,KAAK;gBACL,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;aAC1B;SACF,CACF;QACH,OAAO,EAAE,CAAC,CAAC,UAAU;KACtB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { TaskDetail } from '../types';
2
+ export declare function useTask(taskId: string): import("@tanstack/react-query").UseQueryResult<NoInfer<TaskDetail>, Error>;
3
+ //# sourceMappingURL=useTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTask.d.ts","sourceRoot":"","sources":["../../src/hooks/useTask.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,8EAQrC"}
@@ -0,0 +1,11 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { useWorkflowContext } from '../provider/WorkflowProvider';
3
+ export function useTask(taskId) {
4
+ const { apiClient } = useWorkflowContext();
5
+ return useQuery({
6
+ queryKey: ['workflow', 'tasks', taskId],
7
+ queryFn: () => apiClient.get(`/workflow/tasks/${taskId}`),
8
+ enabled: !!taskId,
9
+ });
10
+ }
11
+ //# sourceMappingURL=useTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTask.js","sourceRoot":"","sources":["../../src/hooks/useTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,MAAM,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE3C,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC;QACvC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAa,mBAAmB,MAAM,EAAE,CAAC;QACrE,OAAO,EAAE,CAAC,CAAC,MAAM;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { TaskActionPayload } from '../types';
2
+ export declare function useTaskAction(taskId: string): import("@tanstack/react-query").UseMutationResult<unknown, unknown, TaskActionPayload, unknown>;
3
+ //# sourceMappingURL=useTaskAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTaskAction.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,mGAY3C"}
@@ -0,0 +1,15 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { useWorkflowContext } from '../provider/WorkflowProvider';
3
+ import { handleMutationError } from './mutation-error-handler';
4
+ export function useTaskAction(taskId) {
5
+ const { apiClient, toast } = useWorkflowContext();
6
+ const queryClient = useQueryClient();
7
+ return useMutation({
8
+ mutationFn: (payload) => apiClient.post(`/workflow/tasks/${taskId}/action`, payload),
9
+ onSuccess: () => {
10
+ void queryClient.invalidateQueries({ queryKey: ['workflow', 'tasks'] });
11
+ },
12
+ onError: (error) => handleMutationError(error, toast),
13
+ });
14
+ }
15
+ //# sourceMappingURL=useTaskAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTaskAction.js","sourceRoot":"","sources":["../../src/hooks/useTaskAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAClD,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,CAAC,OAA0B,EAAE,EAAE,CACzC,SAAS,CAAC,IAAI,CAAC,mBAAmB,MAAM,SAAS,EAAE,OAAO,CAAC;QAC7D,SAAS,EAAE,GAAG,EAAE;YACd,KAAK,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;KAC/D,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function useTaskClaim(taskId: string): {
2
+ claim: import("@tanstack/react-query").UseMutationResult<unknown, unknown, void, unknown>;
3
+ unclaim: import("@tanstack/react-query").UseMutationResult<unknown, unknown, void, unknown>;
4
+ };
5
+ //# sourceMappingURL=useTaskClaim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTaskClaim.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskClaim.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM;;;EAqB1C"}
@@ -0,0 +1,23 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { useWorkflowContext } from '../provider/WorkflowProvider';
3
+ import { handleMutationError } from './mutation-error-handler';
4
+ export function useTaskClaim(taskId) {
5
+ const { apiClient, toast } = useWorkflowContext();
6
+ const queryClient = useQueryClient();
7
+ const claim = useMutation({
8
+ mutationFn: () => apiClient.post(`/workflow/tasks/${taskId}/claim`),
9
+ onSuccess: () => {
10
+ void queryClient.invalidateQueries({ queryKey: ['workflow', 'tasks'] });
11
+ },
12
+ onError: (error) => handleMutationError(error, toast),
13
+ });
14
+ const unclaim = useMutation({
15
+ mutationFn: () => apiClient.post(`/workflow/tasks/${taskId}/unclaim`),
16
+ onSuccess: () => {
17
+ void queryClient.invalidateQueries({ queryKey: ['workflow', 'tasks'] });
18
+ },
19
+ onError: (error) => handleMutationError(error, toast),
20
+ });
21
+ return { claim, unclaim };
22
+ }
23
+ //# sourceMappingURL=useTaskClaim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTaskClaim.js","sourceRoot":"","sources":["../../src/hooks/useTaskClaim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAClD,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM,KAAK,GAAG,WAAW,CAAC;QACxB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,MAAM,QAAQ,CAAC;QACnE,SAAS,EAAE,GAAG,EAAE;YACd,KAAK,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;KAC/D,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,WAAW,CAAC;QAC1B,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,MAAM,UAAU,CAAC;QACrE,SAAS,EAAE,GAAG,EAAE;YACd,KAAK,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;KAC/D,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { TaskListParams, TaskSummary, PaginatedResponse } from '../types';
2
+ export declare function useTaskList(params: TaskListParams): import("@tanstack/react-query").UseQueryResult<NoInfer<PaginatedResponse<TaskSummary>>, Error>;
3
+ //# sourceMappingURL=useTaskList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTaskList.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskList.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE/E,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,kGAqBjD"}
@@ -0,0 +1,23 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { useWorkflowContext } from '../provider/WorkflowProvider';
3
+ export function useTaskList(params) {
4
+ const { apiClient } = useWorkflowContext();
5
+ return useQuery({
6
+ queryKey: ['workflow', 'tasks', params.tab, params.filters, params.page, params.pageSize],
7
+ queryFn: () => apiClient.get('/workflow/tasks', {
8
+ params: {
9
+ tab: params.tab,
10
+ ...(params.filters?.definition && { definition: params.filters.definition }),
11
+ ...(params.filters?.status && { status: params.filters.status }),
12
+ ...(params.filters?.assignedUser && { assignedUser: params.filters.assignedUser }),
13
+ ...(params.filters?.role?.length && { role: params.filters.role.join(',') }),
14
+ ...(params.filters?.dateRange?.start && { dateStart: params.filters.dateRange.start }),
15
+ ...(params.filters?.dateRange?.end && { dateEnd: params.filters.dateRange.end }),
16
+ ...(params.filters?.search && { search: params.filters.search }),
17
+ page: params.page ?? 1,
18
+ pageSize: params.pageSize ?? 20,
19
+ },
20
+ }),
21
+ });
22
+ }
23
+ //# sourceMappingURL=useTaskList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTaskList.js","sourceRoot":"","sources":["../../src/hooks/useTaskList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,MAAM,UAAU,WAAW,CAAC,MAAsB;IAChD,MAAM,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE3C,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC;QACzF,OAAO,EAAE,GAAG,EAAE,CACZ,SAAS,CAAC,GAAG,CAAiC,iBAAiB,EAAE;YAC/D,MAAM,EAAE;gBACN,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC5E,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBAChE,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;gBAClF,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5E,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;gBACtF,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;gBAChF,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBAChE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC;gBACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE;aAChC;SACF,CAAC;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,13 @@
1
+ export { WorkflowProvider, useWorkflowContext, type WorkflowProviderProps, type WorkflowContextValue, type WorkflowUserContext, type WorkflowToast, } from './provider/WorkflowProvider';
2
+ export { useTaskList } from './hooks/useTaskList';
3
+ export { useTask } from './hooks/useTask';
4
+ export { useTaskClaim } from './hooks/useTaskClaim';
5
+ export { useTaskAction } from './hooks/useTaskAction';
6
+ export { useProcessTimeline } from './hooks/useProcessTimeline';
7
+ export { TaskInbox, TaskCard, TaskInboxSkeleton, TaskInboxEmpty, TaskInboxError, type TaskInboxProps, type TaskCardProps, type TaskInboxSkeletonProps, type TaskInboxEmptyProps, type TaskInboxErrorProps, } from './components/TaskInbox';
8
+ export { WorkflowForm, FieldRenderer, FormSection, buildZodSchema, type WorkflowFormProps, } from './components/WorkflowForm';
9
+ export { TaskDetail, TaskDetailHeader, TaskDetailSkeleton, TaskDetailNotFound, TaskDetailError, type TaskDetailProps, type TaskDetailHeaderProps, type TaskDetailSkeletonProps, type TaskDetailNotFoundProps, type TaskDetailErrorProps, } from './components/TaskDetail';
10
+ export { TaskActions, ConfirmationDialog, type TaskActionsProps, type ConfirmationDialogProps, } from './components/TaskActions';
11
+ export { ProcessTimeline, TimelineEntry, ProcessTimelineSkeleton, type ProcessTimelineProps, type TimelineEntryProps, type ProcessTimelineSkeletonProps, } from './components/ProcessTimeline';
12
+ export type { TaskTab, TaskInboxTab, TaskFilters, TaskListParams, TaskSummary, PaginatedResponse, FormFieldSchema, TaskAction, TaskDetail as TaskDetailData, TimelineTriggerType, TimelineEntry as TimelineEntryData, TimelineResponse, TaskActionPayload, WorkflowFormFieldType, WorkflowFormFieldOption, WorkflowFormFieldValidation, WorkflowFormField, WorkflowFormSection, WorkflowFormSchema, } from './types';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,GACnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EACV,OAAO,EACP,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,UAAU,IAAI,cAAc,EAC5B,mBAAmB,EACnB,aAAa,IAAI,iBAAiB,EAClC,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ export { WorkflowProvider, useWorkflowContext, } from './provider/WorkflowProvider';
2
+ export { useTaskList } from './hooks/useTaskList';
3
+ export { useTask } from './hooks/useTask';
4
+ export { useTaskClaim } from './hooks/useTaskClaim';
5
+ export { useTaskAction } from './hooks/useTaskAction';
6
+ export { useProcessTimeline } from './hooks/useProcessTimeline';
7
+ export { TaskInbox, TaskCard, TaskInboxSkeleton, TaskInboxEmpty, TaskInboxError, } from './components/TaskInbox';
8
+ export { WorkflowForm, FieldRenderer, FormSection, buildZodSchema, } from './components/WorkflowForm';
9
+ export { TaskDetail, TaskDetailHeader, TaskDetailSkeleton, TaskDetailNotFound, TaskDetailError, } from './components/TaskDetail';
10
+ export { TaskActions, ConfirmationDialog, } from './components/TaskActions';
11
+ export { ProcessTimeline, TimelineEntry, ProcessTimelineSkeleton, } from './components/ProcessTimeline';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAKnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,cAAc,GAMf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAMhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,kBAAkB,GAGnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,eAAe,EACf,aAAa,EACb,uBAAuB,GAIxB,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type ReactNode } from 'react';
2
+ import { QueryClient } from '@tanstack/react-query';
3
+ import { type ApiClient } from '@quanticjs/react-core';
4
+ export interface WorkflowUserContext {
5
+ userId: string;
6
+ roles: string[];
7
+ }
8
+ export interface WorkflowContextValue {
9
+ apiClient: ApiClient;
10
+ userContext: WorkflowUserContext;
11
+ fileUploadUrl?: string;
12
+ fileDownloadUrl?: string;
13
+ toast: (t: WorkflowToast) => void;
14
+ }
15
+ export interface WorkflowToast {
16
+ title: string;
17
+ description?: string;
18
+ variant?: 'default' | 'destructive';
19
+ }
20
+ export interface WorkflowProviderProps {
21
+ apiBaseUrl: string;
22
+ userContext: WorkflowUserContext;
23
+ fileUploadUrl?: string;
24
+ fileDownloadUrl?: string;
25
+ toast: (t: WorkflowToast) => void;
26
+ apiClient?: ApiClient;
27
+ queryClient?: QueryClient;
28
+ children: ReactNode;
29
+ }
30
+ export declare function WorkflowProvider({ apiBaseUrl, userContext, fileUploadUrl, fileDownloadUrl, toast, apiClient: externalApiClient, queryClient: externalQueryClient, children, }: WorkflowProviderProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function useWorkflowContext(): WorkflowContextValue;
32
+ //# sourceMappingURL=WorkflowProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowProvider.d.ts","sourceRoot":"","sources":["../../src/provider/WorkflowProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE9F,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAsBD,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,KAAK,EACL,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,mBAAmB,EAChC,QAAQ,GACT,EAAE,qBAAqB,2CAiCvB;AAED,wBAAgB,kBAAkB,IAAI,oBAAoB,CAQzD"}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo, } from 'react';
3
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
4
+ import { createClient, correlationId, ApiError } from '@quanticjs/react-core';
5
+ const WorkflowContext = createContext(null);
6
+ function normalizeBaseUrl(url) {
7
+ return url.replace(/\/+$/, '');
8
+ }
9
+ function createQueryClient() {
10
+ return new QueryClient({
11
+ defaultOptions: {
12
+ queries: {
13
+ staleTime: 30000,
14
+ retry: (failureCount, error) => {
15
+ if (error instanceof ApiError && error.status >= 400 && error.status < 500)
16
+ return false;
17
+ return failureCount < 3;
18
+ },
19
+ },
20
+ },
21
+ });
22
+ }
23
+ export function WorkflowProvider({ apiBaseUrl, userContext, fileUploadUrl, fileDownloadUrl, toast, apiClient: externalApiClient, queryClient: externalQueryClient, children, }) {
24
+ if (!userContext.userId || !userContext.roles) {
25
+ throw new Error('WorkflowProvider requires userContext with userId and roles');
26
+ }
27
+ const { apiClient, queryClient } = useMemo(() => {
28
+ const client = externalApiClient ?? createClient({
29
+ baseUrl: normalizeBaseUrl(apiBaseUrl),
30
+ credentials: 'include',
31
+ interceptors: [correlationId()],
32
+ });
33
+ const qc = externalQueryClient ?? createQueryClient();
34
+ return { apiClient: client, queryClient: qc };
35
+ }, [apiBaseUrl, externalApiClient, externalQueryClient]);
36
+ const contextValue = useMemo(() => ({
37
+ apiClient,
38
+ userContext,
39
+ fileUploadUrl,
40
+ fileDownloadUrl,
41
+ toast,
42
+ }), [apiClient, userContext, fileUploadUrl, fileDownloadUrl, toast]);
43
+ return (_jsx(WorkflowContext.Provider, { value: contextValue, children: _jsx(QueryClientProvider, { client: queryClient, children: children }) }));
44
+ }
45
+ export function useWorkflowContext() {
46
+ const ctx = useContext(WorkflowContext);
47
+ if (!ctx) {
48
+ throw new Error('WorkflowProvider is required — wrap your app root.');
49
+ }
50
+ return ctx;
51
+ }
52
+ //# sourceMappingURL=WorkflowProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkflowProvider.js","sourceRoot":"","sources":["../../src/provider/WorkflowProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,OAAO,GAER,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAgC9F,MAAM,eAAe,GAAG,aAAa,CAA8B,IAAI,CAAC,CAAC;AAEzE,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,IAAI,WAAW,CAAC;QACrB,cAAc,EAAE;YACd,OAAO,EAAE;gBACP,SAAS,EAAE,KAAM;gBACjB,KAAK,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;oBAC7B,IAAI,KAAK,YAAY,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG;wBAAE,OAAO,KAAK,CAAC;oBACzF,OAAO,YAAY,GAAG,CAAC,CAAC;gBAC1B,CAAC;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAC/B,UAAU,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,KAAK,EACL,SAAS,EAAE,iBAAiB,EAC5B,WAAW,EAAE,mBAAmB,EAChC,QAAQ,GACc;IACtB,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9C,MAAM,MAAM,GAAG,iBAAiB,IAAI,YAAY,CAAC;YAC/C,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC;YACrC,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,CAAC,aAAa,EAAE,CAAC;SAChC,CAAC,CAAC;QACH,MAAM,EAAE,GAAG,mBAAmB,IAAI,iBAAiB,EAAE,CAAC;QACtD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAChD,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEzD,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,SAAS;QACT,WAAW;QACX,aAAa;QACb,eAAe;QACf,KAAK;KACN,CAAC,EACF,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,CAAC,CAChE,CAAC;IAEF,OAAO,CACL,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,KAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW,YACrC,QAAQ,GACW,GACG,CAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,oDAAoD,CACrD,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/test-setup.ts","../src/types.ts","../src/components/ProcessTimeline/ProcessTimeline.tsx","../src/components/ProcessTimeline/ProcessTimelineSkeleton.tsx","../src/components/ProcessTimeline/TimelineEntry.tsx","../src/components/ProcessTimeline/index.ts","../src/components/TaskActions/ConfirmationDialog.tsx","../src/components/TaskActions/TaskActions.tsx","../src/components/TaskActions/index.ts","../src/components/TaskDetail/TaskDetail.tsx","../src/components/TaskDetail/TaskDetailError.tsx","../src/components/TaskDetail/TaskDetailHeader.tsx","../src/components/TaskDetail/TaskDetailNotFound.tsx","../src/components/TaskDetail/TaskDetailSkeleton.tsx","../src/components/TaskDetail/index.ts","../src/components/TaskInbox/TaskCard.tsx","../src/components/TaskInbox/TaskFilters.tsx","../src/components/TaskInbox/TaskInbox.tsx","../src/components/TaskInbox/TaskInboxEmpty.tsx","../src/components/TaskInbox/TaskInboxError.tsx","../src/components/TaskInbox/TaskInboxSkeleton.tsx","../src/components/TaskInbox/index.ts","../src/components/WorkflowForm/FieldRenderer.tsx","../src/components/WorkflowForm/FormSection.tsx","../src/components/WorkflowForm/WorkflowForm.tsx","../src/components/WorkflowForm/buildZodSchema.ts","../src/components/WorkflowForm/index.ts","../src/components/WorkflowForm/fields/CheckboxField.tsx","../src/components/WorkflowForm/fields/DateField.tsx","../src/components/WorkflowForm/fields/FileUploadField.tsx","../src/components/WorkflowForm/fields/MultiSelectField.tsx","../src/components/WorkflowForm/fields/NumberField.tsx","../src/components/WorkflowForm/fields/ReadonlyField.tsx","../src/components/WorkflowForm/fields/SelectField.tsx","../src/components/WorkflowForm/fields/TextField.tsx","../src/components/WorkflowForm/fields/TextareaField.tsx","../src/components/WorkflowForm/fields/UnknownField.tsx","../src/components/WorkflowForm/fields/shared.ts","../src/hooks/mutation-error-handler.ts","../src/hooks/useProcessTimeline.ts","../src/hooks/useTask.ts","../src/hooks/useTaskAction.ts","../src/hooks/useTaskClaim.ts","../src/hooks/useTaskList.ts","../src/provider/WorkflowProvider.tsx"],"version":"5.9.3"}
@@ -0,0 +1,141 @@
1
+ export type TaskTab = 'my' | 'available' | 'all' | 'my-tasks' | 'team' | 'overdue' | 'inbox';
2
+ export type TaskInboxTab = 'inbox' | 'available' | 'my-tasks' | 'team' | 'overdue';
3
+ export interface TaskFilters {
4
+ definition?: string;
5
+ status?: string;
6
+ assignedUser?: string;
7
+ role?: string[];
8
+ dateRange?: {
9
+ start: string;
10
+ end: string;
11
+ };
12
+ search?: string;
13
+ }
14
+ export interface TaskListParams {
15
+ tab: TaskTab;
16
+ filters?: TaskFilters;
17
+ page?: number;
18
+ pageSize?: number;
19
+ }
20
+ export interface TaskSummary {
21
+ id: string;
22
+ name: string;
23
+ definitionName: string;
24
+ instanceId: string;
25
+ assignedRole: string;
26
+ assignedUser: string | null;
27
+ status: string;
28
+ createdAt: string;
29
+ dueDate: string | null;
30
+ }
31
+ export interface PaginatedResponse<T> {
32
+ items: T[];
33
+ total: number;
34
+ page: number;
35
+ pageSize: number;
36
+ }
37
+ export interface FormFieldSchema {
38
+ key: string;
39
+ label: string;
40
+ type: string;
41
+ required: boolean;
42
+ options?: Array<{
43
+ label: string;
44
+ value: string;
45
+ }>;
46
+ validation?: Record<string, unknown>;
47
+ }
48
+ export type WorkflowFormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'multiselect' | 'checkbox' | 'date' | 'file' | 'readonly';
49
+ export interface WorkflowFormFieldOption {
50
+ label: string;
51
+ value: string;
52
+ }
53
+ export interface WorkflowFormFieldValidation {
54
+ min?: number;
55
+ max?: number;
56
+ minLength?: number;
57
+ maxLength?: number;
58
+ pattern?: string;
59
+ step?: number;
60
+ }
61
+ export interface WorkflowFormField {
62
+ name: string;
63
+ type: WorkflowFormFieldType | (string & {});
64
+ label: string;
65
+ required?: boolean;
66
+ requiredForActions?: string[];
67
+ default?: unknown;
68
+ options?: WorkflowFormFieldOption[];
69
+ validation?: WorkflowFormFieldValidation;
70
+ }
71
+ export interface WorkflowFormSection {
72
+ name: string;
73
+ label: string;
74
+ fields: string[];
75
+ columns?: number;
76
+ }
77
+ export interface WorkflowFormSchema {
78
+ fields: WorkflowFormField[];
79
+ layout?: {
80
+ sections?: WorkflowFormSection[];
81
+ };
82
+ }
83
+ export interface TaskAction {
84
+ name: string;
85
+ label: string;
86
+ roles?: string[];
87
+ }
88
+ export interface TaskDetail {
89
+ id: string;
90
+ name: string;
91
+ definitionName: string;
92
+ workflowName?: string;
93
+ currentState?: string;
94
+ instanceId: string;
95
+ assignedRole: string;
96
+ assignedUser: string | null;
97
+ assignedUserDisplayName?: string;
98
+ status: string;
99
+ createdAt: string;
100
+ dueDate: string | null;
101
+ formSchema: FormFieldSchema[];
102
+ formData: Record<string, unknown>;
103
+ actions: TaskAction[];
104
+ variables: Record<string, unknown>;
105
+ }
106
+ export type TimelineTriggerType = 'user' | 'system' | 'error' | 'completion';
107
+ export interface TimelineEntry {
108
+ id: string;
109
+ timestamp: string;
110
+ fromState: string;
111
+ toState: string;
112
+ signal: string | null;
113
+ user: string | null;
114
+ taskName: string | null;
115
+ triggerType?: TimelineTriggerType;
116
+ }
117
+ export interface TimelineResponse {
118
+ items: TimelineEntry[];
119
+ cursor: string | null;
120
+ hasMore: boolean;
121
+ }
122
+ export interface TaskActionPayload {
123
+ actionName: string;
124
+ data?: Record<string, unknown>;
125
+ }
126
+ export interface WorkflowToast {
127
+ title: string;
128
+ description?: string;
129
+ variant?: 'default' | 'destructive';
130
+ }
131
+ export interface WorkflowContextValue {
132
+ apiBaseUrl: string;
133
+ userContext: {
134
+ userId: string;
135
+ roles: string[];
136
+ };
137
+ fileUploadUrl?: string;
138
+ fileDownloadUrl?: string;
139
+ toast: (t: WorkflowToast) => void;
140
+ }
141
+ //# sourceMappingURL=types.d.ts.map