@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.
- package/dist/components/ProcessTimeline/ProcessTimeline.d.ts +7 -0
- package/dist/components/ProcessTimeline/ProcessTimeline.d.ts.map +1 -0
- package/dist/components/ProcessTimeline/ProcessTimeline.js +48 -0
- package/dist/components/ProcessTimeline/ProcessTimeline.js.map +1 -0
- package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.d.ts +6 -0
- package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.d.ts.map +1 -0
- package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.js +6 -0
- package/dist/components/ProcessTimeline/ProcessTimelineSkeleton.js.map +1 -0
- package/dist/components/ProcessTimeline/TimelineEntry.d.ts +8 -0
- package/dist/components/ProcessTimeline/TimelineEntry.d.ts.map +1 -0
- package/dist/components/ProcessTimeline/TimelineEntry.js +66 -0
- package/dist/components/ProcessTimeline/TimelineEntry.js.map +1 -0
- package/dist/components/ProcessTimeline/index.d.ts +4 -0
- package/dist/components/ProcessTimeline/index.d.ts.map +1 -0
- package/dist/components/ProcessTimeline/index.js +4 -0
- package/dist/components/ProcessTimeline/index.js.map +1 -0
- package/dist/components/TaskActions/ConfirmationDialog.d.ts +8 -0
- package/dist/components/TaskActions/ConfirmationDialog.d.ts.map +1 -0
- package/dist/components/TaskActions/ConfirmationDialog.js +45 -0
- package/dist/components/TaskActions/ConfirmationDialog.js.map +1 -0
- package/dist/components/TaskActions/TaskActions.d.ts +10 -0
- package/dist/components/TaskActions/TaskActions.d.ts.map +1 -0
- package/dist/components/TaskActions/TaskActions.js +51 -0
- package/dist/components/TaskActions/TaskActions.js.map +1 -0
- package/dist/components/TaskActions/index.d.ts +3 -0
- package/dist/components/TaskActions/index.d.ts.map +1 -0
- package/dist/components/TaskActions/index.js +3 -0
- package/dist/components/TaskActions/index.js.map +1 -0
- package/dist/components/TaskDetail/TaskDetail.d.ts +8 -0
- package/dist/components/TaskDetail/TaskDetail.d.ts.map +1 -0
- package/dist/components/TaskDetail/TaskDetail.js +116 -0
- package/dist/components/TaskDetail/TaskDetail.js.map +1 -0
- package/dist/components/TaskDetail/TaskDetailError.d.ts +7 -0
- package/dist/components/TaskDetail/TaskDetailError.d.ts.map +1 -0
- package/dist/components/TaskDetail/TaskDetailError.js +8 -0
- package/dist/components/TaskDetail/TaskDetailError.js.map +1 -0
- package/dist/components/TaskDetail/TaskDetailHeader.d.ts +7 -0
- package/dist/components/TaskDetail/TaskDetailHeader.d.ts.map +1 -0
- package/dist/components/TaskDetail/TaskDetailHeader.js +39 -0
- package/dist/components/TaskDetail/TaskDetailHeader.js.map +1 -0
- package/dist/components/TaskDetail/TaskDetailNotFound.d.ts +5 -0
- package/dist/components/TaskDetail/TaskDetailNotFound.d.ts.map +1 -0
- package/dist/components/TaskDetail/TaskDetailNotFound.js +6 -0
- package/dist/components/TaskDetail/TaskDetailNotFound.js.map +1 -0
- package/dist/components/TaskDetail/TaskDetailSkeleton.d.ts +5 -0
- package/dist/components/TaskDetail/TaskDetailSkeleton.d.ts.map +1 -0
- package/dist/components/TaskDetail/TaskDetailSkeleton.js +6 -0
- package/dist/components/TaskDetail/TaskDetailSkeleton.js.map +1 -0
- package/dist/components/TaskDetail/index.d.ts +6 -0
- package/dist/components/TaskDetail/index.d.ts.map +1 -0
- package/dist/components/TaskDetail/index.js +6 -0
- package/dist/components/TaskDetail/index.js.map +1 -0
- package/dist/components/TaskInbox/TaskCard.d.ts +10 -0
- package/dist/components/TaskInbox/TaskCard.d.ts.map +1 -0
- package/dist/components/TaskInbox/TaskCard.js +90 -0
- package/dist/components/TaskInbox/TaskCard.js.map +1 -0
- package/dist/components/TaskInbox/TaskFilters.d.ts +10 -0
- package/dist/components/TaskInbox/TaskFilters.d.ts.map +1 -0
- package/dist/components/TaskInbox/TaskFilters.js +59 -0
- package/dist/components/TaskInbox/TaskFilters.js.map +1 -0
- package/dist/components/TaskInbox/TaskInbox.d.ts +12 -0
- package/dist/components/TaskInbox/TaskInbox.d.ts.map +1 -0
- package/dist/components/TaskInbox/TaskInbox.js +85 -0
- package/dist/components/TaskInbox/TaskInbox.js.map +1 -0
- package/dist/components/TaskInbox/TaskInboxEmpty.d.ts +7 -0
- package/dist/components/TaskInbox/TaskInboxEmpty.d.ts.map +1 -0
- package/dist/components/TaskInbox/TaskInboxEmpty.js +6 -0
- package/dist/components/TaskInbox/TaskInboxEmpty.js.map +1 -0
- package/dist/components/TaskInbox/TaskInboxError.d.ts +7 -0
- package/dist/components/TaskInbox/TaskInboxError.d.ts.map +1 -0
- package/dist/components/TaskInbox/TaskInboxError.js +8 -0
- package/dist/components/TaskInbox/TaskInboxError.js.map +1 -0
- package/dist/components/TaskInbox/TaskInboxSkeleton.d.ts +6 -0
- package/dist/components/TaskInbox/TaskInboxSkeleton.d.ts.map +1 -0
- package/dist/components/TaskInbox/TaskInboxSkeleton.js +6 -0
- package/dist/components/TaskInbox/TaskInboxSkeleton.js.map +1 -0
- package/dist/components/TaskInbox/index.d.ts +7 -0
- package/dist/components/TaskInbox/index.d.ts.map +1 -0
- package/dist/components/TaskInbox/index.js +7 -0
- package/dist/components/TaskInbox/index.js.map +1 -0
- package/dist/components/WorkflowForm/FieldRenderer.d.ts +14 -0
- package/dist/components/WorkflowForm/FieldRenderer.d.ts.map +1 -0
- package/dist/components/WorkflowForm/FieldRenderer.js +28 -0
- package/dist/components/WorkflowForm/FieldRenderer.js.map +1 -0
- package/dist/components/WorkflowForm/FormSection.d.ts +10 -0
- package/dist/components/WorkflowForm/FormSection.d.ts.map +1 -0
- package/dist/components/WorkflowForm/FormSection.js +12 -0
- package/dist/components/WorkflowForm/FormSection.js.map +1 -0
- package/dist/components/WorkflowForm/WorkflowForm.d.ts +11 -0
- package/dist/components/WorkflowForm/WorkflowForm.d.ts.map +1 -0
- package/dist/components/WorkflowForm/WorkflowForm.js +61 -0
- package/dist/components/WorkflowForm/WorkflowForm.js.map +1 -0
- package/dist/components/WorkflowForm/buildZodSchema.d.ts +4 -0
- package/dist/components/WorkflowForm/buildZodSchema.d.ts.map +1 -0
- package/dist/components/WorkflowForm/buildZodSchema.js +79 -0
- package/dist/components/WorkflowForm/buildZodSchema.js.map +1 -0
- package/dist/components/WorkflowForm/fields/CheckboxField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/CheckboxField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/CheckboxField.js +7 -0
- package/dist/components/WorkflowForm/fields/CheckboxField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/DateField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/DateField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/DateField.js +7 -0
- package/dist/components/WorkflowForm/fields/DateField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/FileUploadField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/FileUploadField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/FileUploadField.js +80 -0
- package/dist/components/WorkflowForm/fields/FileUploadField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/MultiSelectField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/MultiSelectField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/MultiSelectField.js +33 -0
- package/dist/components/WorkflowForm/fields/MultiSelectField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/NumberField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/NumberField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/NumberField.js +16 -0
- package/dist/components/WorkflowForm/fields/NumberField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/ReadonlyField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/ReadonlyField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/ReadonlyField.js +6 -0
- package/dist/components/WorkflowForm/fields/ReadonlyField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/SelectField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/SelectField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/SelectField.js +7 -0
- package/dist/components/WorkflowForm/fields/SelectField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/TextField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/TextField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/TextField.js +7 -0
- package/dist/components/WorkflowForm/fields/TextField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/TextareaField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/TextareaField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/TextareaField.js +7 -0
- package/dist/components/WorkflowForm/fields/TextareaField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/UnknownField.d.ts +3 -0
- package/dist/components/WorkflowForm/fields/UnknownField.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/UnknownField.js +7 -0
- package/dist/components/WorkflowForm/fields/UnknownField.js.map +1 -0
- package/dist/components/WorkflowForm/fields/shared.d.ts +22 -0
- package/dist/components/WorkflowForm/fields/shared.d.ts.map +1 -0
- package/dist/components/WorkflowForm/fields/shared.js +2 -0
- package/dist/components/WorkflowForm/fields/shared.js.map +1 -0
- package/dist/components/WorkflowForm/index.d.ts +5 -0
- package/dist/components/WorkflowForm/index.d.ts.map +1 -0
- package/dist/components/WorkflowForm/index.js +5 -0
- package/dist/components/WorkflowForm/index.js.map +1 -0
- package/dist/hooks/mutation-error-handler.d.ts +3 -0
- package/dist/hooks/mutation-error-handler.d.ts.map +1 -0
- package/dist/hooks/mutation-error-handler.js +20 -0
- package/dist/hooks/mutation-error-handler.js.map +1 -0
- package/dist/hooks/useProcessTimeline.d.ts +8 -0
- package/dist/hooks/useProcessTimeline.d.ts.map +1 -0
- package/dist/hooks/useProcessTimeline.js +17 -0
- package/dist/hooks/useProcessTimeline.js.map +1 -0
- package/dist/hooks/useTask.d.ts +3 -0
- package/dist/hooks/useTask.d.ts.map +1 -0
- package/dist/hooks/useTask.js +11 -0
- package/dist/hooks/useTask.js.map +1 -0
- package/dist/hooks/useTaskAction.d.ts +3 -0
- package/dist/hooks/useTaskAction.d.ts.map +1 -0
- package/dist/hooks/useTaskAction.js +15 -0
- package/dist/hooks/useTaskAction.js.map +1 -0
- package/dist/hooks/useTaskClaim.d.ts +5 -0
- package/dist/hooks/useTaskClaim.d.ts.map +1 -0
- package/dist/hooks/useTaskClaim.js +23 -0
- package/dist/hooks/useTaskClaim.js.map +1 -0
- package/dist/hooks/useTaskList.d.ts +3 -0
- package/dist/hooks/useTaskList.d.ts.map +1 -0
- package/dist/hooks/useTaskList.js +23 -0
- package/dist/hooks/useTaskList.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/provider/WorkflowProvider.d.ts +32 -0
- package/dist/provider/WorkflowProvider.d.ts.map +1 -0
- package/dist/provider/WorkflowProvider.js +52 -0
- package/dist/provider/WorkflowProvider.js.map +1 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +2 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types.d.ts +141 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ProcessTimelineProps {
|
|
2
|
+
instanceId: string;
|
|
3
|
+
limit?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function ProcessTimeline({ instanceId, limit, className }: ProcessTimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=ProcessTimeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessTimeline.d.ts","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/ProcessTimeline.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,KAAU,EAAE,SAAS,EAAE,EAAE,oBAAoB,2CA4G1F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect, useRef } from 'react';
|
|
3
|
+
import { useProcessTimeline } from '../../hooks/useProcessTimeline';
|
|
4
|
+
import { isApiError } from '@quanticjs/react-core';
|
|
5
|
+
import { TimelineEntry } from './TimelineEntry';
|
|
6
|
+
import { ProcessTimelineSkeleton } from './ProcessTimelineSkeleton';
|
|
7
|
+
export function ProcessTimeline({ instanceId, limit = 20, className }) {
|
|
8
|
+
const [cursor, setCursor] = useState(null);
|
|
9
|
+
const [accumulatedEntries, setAccumulatedEntries] = useState([]);
|
|
10
|
+
const prevDataRef = useRef(null);
|
|
11
|
+
const { data, isLoading, isError, error, refetch } = useProcessTimeline(instanceId, {
|
|
12
|
+
limit,
|
|
13
|
+
cursor,
|
|
14
|
+
});
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!data?.items || data.items === prevDataRef.current)
|
|
17
|
+
return;
|
|
18
|
+
prevDataRef.current = data.items;
|
|
19
|
+
if (!cursor) {
|
|
20
|
+
setAccumulatedEntries(data.items);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
setAccumulatedEntries((prev) => {
|
|
24
|
+
const existingIds = new Set(prev.map((e) => e.id));
|
|
25
|
+
const newEntries = data.items.filter((e) => !existingIds.has(e.id));
|
|
26
|
+
return [...prev, ...newEntries];
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, [data, cursor]);
|
|
30
|
+
const handleLoadMore = useCallback(() => {
|
|
31
|
+
if (data?.cursor) {
|
|
32
|
+
setCursor(data.cursor);
|
|
33
|
+
}
|
|
34
|
+
}, [data?.cursor]);
|
|
35
|
+
const hasMore = data?.hasMore ?? false;
|
|
36
|
+
if (isLoading && accumulatedEntries.length === 0) {
|
|
37
|
+
return _jsx(ProcessTimelineSkeleton, { count: Math.min(limit, 5), className: className });
|
|
38
|
+
}
|
|
39
|
+
if (isError && accumulatedEntries.length === 0) {
|
|
40
|
+
const correlationId = error && isApiError(error) ? error.correlationId : undefined;
|
|
41
|
+
return (_jsxs("div", { className: `rounded-lg border border-destructive/30 bg-destructive/5 px-5 py-6 text-center ${className ?? ''}`, "data-component": "process-timeline-error", role: "alert", children: [_jsx("p", { className: "text-sm font-medium text-destructive", children: "Something went wrong loading timeline" }), correlationId && (_jsxs("p", { "data-field": "error-ref", className: "mt-1 text-xs text-muted-foreground", children: ["Reference: ", correlationId] })), _jsx("button", { type: "button", onClick: () => refetch(), "aria-label": "Retry loading timeline", className: "mt-4 rounded-md border border-destructive/30 bg-background px-4 py-1.5 text-sm font-medium text-destructive transition-colors hover:bg-destructive/10", children: "Retry" })] }));
|
|
42
|
+
}
|
|
43
|
+
if (!isLoading && accumulatedEntries.length === 0) {
|
|
44
|
+
return (_jsx("div", { className: `rounded-lg border border-dashed border-border bg-card px-5 py-8 text-center ${className ?? ''}`, "data-component": "process-timeline-empty", role: "status", children: _jsx("p", { className: "text-sm text-muted-foreground", children: "No timeline events" }) }));
|
|
45
|
+
}
|
|
46
|
+
return (_jsxs("div", { className: `space-y-5 ${className ?? ''}`, "data-component": "process-timeline", children: [_jsx("p", { className: "text-[11px] font-bold uppercase tracking-widest text-muted-foreground", children: "Process Timeline" }), _jsx("ol", { "aria-label": "Process timeline", className: "flex flex-col", children: accumulatedEntries.map((entry, i) => (_jsx(TimelineEntry, { entry: entry, isLast: i === accumulatedEntries.length - 1 && !hasMore }, entry.id))) }), hasMore && (_jsx("button", { type: "button", onClick: handleLoadMore, disabled: isLoading, "data-slot": "load-more", "aria-label": "Load more timeline entries", className: "ml-14 text-sm font-medium text-primary transition-colors hover:text-primary/80 disabled:opacity-50", children: isLoading ? 'Loading...' : 'Load more' }))] }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=ProcessTimeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessTimeline.js","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/ProcessTimeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAQpE,MAAM,UAAU,eAAe,CAAC,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,EAAwB;IACzF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAsB,EAAE,CAAC,CAAC;IACtF,MAAM,WAAW,GAAG,MAAM,CAA6B,IAAI,CAAC,CAAC;IAE7D,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC,UAAU,EAAE;QAClF,KAAK;QACL,MAAM;KACP,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,OAAO;YAAE,OAAO;QAC/D,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;QA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vC,SAAS,EAAC,oGAAoG,YAE7G,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,GAChC,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ProcessTimelineSkeletonProps {
|
|
2
|
+
count?: number;
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const ProcessTimelineSkeleton: import("react").ForwardRefExoticComponent<ProcessTimelineSkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
//# sourceMappingURL=ProcessTimelineSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessTimelineSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/ProcessTimelineSkeleton.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,uBAAuB,yHA2DnC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
export const ProcessTimelineSkeleton = forwardRef(function ProcessTimelineSkeleton({ count = 5, className }, ref) {
|
|
4
|
+
return (_jsxs("div", { ref: ref, className: `space-y-5 ${className ?? ''}`, role: "status", "aria-label": "Loading timeline", children: [_jsx("span", { className: "sr-only", children: "Loading timeline..." }), _jsx("div", { className: "h-3 w-28 animate-pulse rounded bg-muted" }), _jsx("ol", { "aria-hidden": "true", className: "flex flex-col", "data-skeleton": "timeline", children: Array.from({ length: count }, (_, i) => (_jsxs("li", { className: "flex gap-4", "data-skeleton": "true", children: [_jsxs("div", { className: "flex w-10 shrink-0 flex-col items-center", children: [_jsx("div", { className: "h-10 w-10 animate-pulse rounded-2xl bg-muted" }), i < count - 1 && (_jsx("div", { className: "my-1.5 w-px flex-1 bg-border", style: { minHeight: '24px' } }))] }), _jsx("div", { className: "mb-4 flex-1 rounded-2xl border border-border bg-card px-5 py-4 shadow-sm", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex-1 space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-5 w-20 animate-pulse rounded-md bg-muted", "data-skeleton-line": "transition" }), _jsx("div", { className: "h-3.5 w-3.5 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-5 w-24 animate-pulse rounded-md bg-muted", "data-skeleton-line": "transition" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-3 w-16 animate-pulse rounded bg-muted", "data-skeleton-line": "meta" }), _jsx("div", { className: "h-4 w-20 animate-pulse rounded-md bg-muted", "data-skeleton-line": "meta" })] })] }), _jsx("div", { className: "h-3 w-24 animate-pulse rounded bg-muted", "data-skeleton-line": "timestamp" })] }) })] }, i))) })] }));
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=ProcessTimelineSkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessTimelineSkeleton.js","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/ProcessTimelineSkeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAC/C,SAAS,uBAAuB,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG;IAC5D,OAAO,CACL,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,aAAa,SAAS,IAAI,EAAE,EAAE,EACzC,IAAI,EAAC,QAAQ,gBACF,kBAAkB,aAE7B,eAAM,SAAS,EAAC,SAAS,oCAA2B,EACpD,cAAK,SAAS,EAAC,yCAAyC,GAAG,EAC3D,4BAAgB,MAAM,EAAC,SAAS,EAAC,eAAe,mBAAe,UAAU,YACtE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACvC,cAAY,SAAS,EAAC,YAAY,mBAAe,MAAM,aAErD,eAAK,SAAS,EAAC,0CAA0C,aACvD,cAAK,SAAS,EAAC,8CAA8C,GAAG,EAC/D,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAChB,cAAK,SAAS,EAAC,8BAA8B,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAI,CAC/E,IACG,EAEN,cAAK,SAAS,EAAC,0EAA0E,YACvF,eAAK,SAAS,EAAC,wCAAwC,aACrD,eAAK,SAAS,EAAC,kBAAkB,aAC/B,eAAK,SAAS,EAAC,yBAAyB,aACtC,cACE,SAAS,EAAC,4CAA4C,wBACnC,YAAY,GAC/B,EACF,cAAK,SAAS,EAAC,4CAA4C,GAAG,EAC9D,cACE,SAAS,EAAC,4CAA4C,wBACnC,YAAY,GAC/B,IACE,EACN,eAAK,SAAS,EAAC,yBAAyB,aACtC,cACE,SAAS,EAAC,yCAAyC,wBAChC,MAAM,GACzB,EACF,cACE,SAAS,EAAC,4CAA4C,wBACnC,MAAM,GACzB,IACE,IACF,EACN,cACE,SAAS,EAAC,yCAAyC,wBAChC,WAAW,GAC9B,IACE,GACF,KAvCC,CAAC,CAwCL,CACN,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimelineEntry as TimelineEntryType } from '../../types';
|
|
2
|
+
export interface TimelineEntryProps {
|
|
3
|
+
entry: TimelineEntryType;
|
|
4
|
+
isLast?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const TimelineEntry: import("react").ForwardRefExoticComponent<TimelineEntryProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
8
|
+
//# sourceMappingURL=TimelineEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineEntry.d.ts","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/TimelineEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAuB,MAAM,aAAa,CAAC;AAE3F,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmED,eAAO,MAAM,aAAa,8GAuJxB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
function formatTimestamp(iso) {
|
|
4
|
+
const date = new Date(iso);
|
|
5
|
+
return date.toLocaleString(undefined, {
|
|
6
|
+
month: 'short',
|
|
7
|
+
day: 'numeric',
|
|
8
|
+
hour: '2-digit',
|
|
9
|
+
minute: '2-digit',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function iconClasses(triggerType) {
|
|
13
|
+
switch (triggerType) {
|
|
14
|
+
case 'user':
|
|
15
|
+
return 'bg-amber-500';
|
|
16
|
+
case 'error':
|
|
17
|
+
return 'bg-red-500';
|
|
18
|
+
case 'completion':
|
|
19
|
+
return 'bg-emerald-500';
|
|
20
|
+
case 'system':
|
|
21
|
+
default:
|
|
22
|
+
return 'bg-muted';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function iconSvgColor(triggerType) {
|
|
26
|
+
switch (triggerType) {
|
|
27
|
+
case 'user':
|
|
28
|
+
case 'error':
|
|
29
|
+
case 'completion':
|
|
30
|
+
return 'text-white';
|
|
31
|
+
case 'system':
|
|
32
|
+
default:
|
|
33
|
+
return 'text-muted-foreground';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function badgeClasses(triggerType) {
|
|
37
|
+
switch (triggerType) {
|
|
38
|
+
case 'user':
|
|
39
|
+
return 'bg-amber-100 text-amber-700 dark:bg-amber-400/15 dark:text-amber-400';
|
|
40
|
+
case 'error':
|
|
41
|
+
return 'bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-400';
|
|
42
|
+
case 'completion':
|
|
43
|
+
return 'bg-emerald-100 text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-400';
|
|
44
|
+
case 'system':
|
|
45
|
+
default:
|
|
46
|
+
return 'bg-muted text-muted-foreground';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function getTriggerLabel(triggerType) {
|
|
50
|
+
switch (triggerType) {
|
|
51
|
+
case 'user':
|
|
52
|
+
return 'User action';
|
|
53
|
+
case 'error':
|
|
54
|
+
return 'Error';
|
|
55
|
+
case 'completion':
|
|
56
|
+
return 'Completed';
|
|
57
|
+
case 'system':
|
|
58
|
+
return 'System';
|
|
59
|
+
default:
|
|
60
|
+
return 'System';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export const TimelineEntry = forwardRef(function TimelineEntry({ entry, isLast = false, className }, ref) {
|
|
64
|
+
return (_jsxs("li", { ref: ref, className: `flex gap-4 ${className ?? ''}`, "data-component": "timeline-entry", "data-color": entry.triggerType ?? 'system', children: [_jsxs("div", { className: "flex w-10 shrink-0 flex-col items-center", children: [_jsx("div", { "data-slot": "marker", "aria-hidden": "true", className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl shadow-sm ${iconClasses(entry.triggerType)}`, children: entry.triggerType === 'user' ? (_jsx("svg", { className: `h-4 w-4 ${iconSvgColor(entry.triggerType)}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" }) })) : entry.triggerType === 'error' ? (_jsx("svg", { className: `h-4 w-4 ${iconSvgColor(entry.triggerType)}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) })) : entry.triggerType === 'completion' ? (_jsx("svg", { className: `h-4 w-4 ${iconSvgColor(entry.triggerType)}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M5 13l4 4L19 7" }) })) : (_jsx("svg", { className: `h-4 w-4 ${iconSvgColor(entry.triggerType)}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M5 13l4 4L19 7" }) })) }), !isLast && _jsx("div", { className: "my-1.5 w-px flex-1 bg-border", style: { minHeight: '24px' } })] }), _jsx("div", { "data-slot": "content", className: "mb-4 flex-1 rounded-2xl border border-border bg-card px-5 py-4 shadow-sm transition-all", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "rounded-md bg-muted px-2 py-0.5 font-mono text-[11px] font-semibold text-muted-foreground", "data-field": "from-state", children: entry.fromState }), _jsx("svg", { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground/50", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M17 8l4 4m0 0l-4 4m4-4H3" }) }), _jsx("span", { className: "rounded-md bg-muted px-2 py-0.5 font-mono text-[11px] font-bold text-foreground", "data-field": "to-state", children: entry.toState }), entry.signal && (_jsxs("span", { "data-field": "signal", className: "text-[11px] italic text-muted-foreground", children: ["\u00B7 ", entry.signal] }))] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [entry.taskName && (_jsxs("span", { "data-field": "task-name", className: "text-[11px] text-muted-foreground", children: ["Task: ", _jsx("span", { className: "font-semibold", children: entry.taskName })] })), _jsx("span", { "data-field": "triggered-by", className: "text-[11px] font-semibold text-foreground", children: entry.user ?? 'system' }), _jsx("span", { "data-badge": "trigger-type", className: `rounded-md px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${badgeClasses(entry.triggerType)}`, children: getTriggerLabel(entry.triggerType) })] })] }), _jsx("time", { dateTime: entry.timestamp, "data-field": "timestamp", className: "shrink-0 text-[11px] font-medium text-muted-foreground", children: formatTimestamp(entry.timestamp) })] }) })] }));
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=TimelineEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineEntry.js","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/TimelineEntry.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AASnC,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE;QACpC,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,WAAiC;IACpD,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,cAAc,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,YAAY,CAAC;QACtB,KAAK,YAAY;YACf,OAAO,gBAAgB,CAAC;QAC1B,KAAK,QAAQ,CAAC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gBACd,WAAW,EACtB,SAAS,EAAC,wDAAwD,YAEjE,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,GAC5B,IACH,GACF,IACH,CACN,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ProcessTimeline, type ProcessTimelineProps } from './ProcessTimeline';
|
|
2
|
+
export { TimelineEntry, type TimelineEntryProps } from './TimelineEntry';
|
|
3
|
+
export { ProcessTimelineSkeleton, type ProcessTimelineSkeletonProps, } from './ProcessTimelineSkeleton';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ProcessTimeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA6B,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,uBAAuB,GAExB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ConfirmationDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
actionName: string;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function ConfirmationDialog({ open, actionName, onConfirm, onCancel, }: ConfirmationDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=ConfirmationDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../src/components/TaskActions/ConfirmationDialog.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,UAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,uBAAuB,kDAsFzB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
export function ConfirmationDialog({ open, actionName, onConfirm, onCancel, }) {
|
|
4
|
+
const dialogRef = useRef(null);
|
|
5
|
+
const cancelRef = useRef(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (open) {
|
|
8
|
+
cancelRef.current?.focus();
|
|
9
|
+
}
|
|
10
|
+
}, [open]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!open)
|
|
13
|
+
return;
|
|
14
|
+
const handleKeyDown = (e) => {
|
|
15
|
+
if (e.key === 'Escape') {
|
|
16
|
+
onCancel();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (e.key === 'Tab') {
|
|
20
|
+
const dialog = dialogRef.current;
|
|
21
|
+
if (!dialog)
|
|
22
|
+
return;
|
|
23
|
+
const focusable = dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
24
|
+
if (focusable.length === 0)
|
|
25
|
+
return;
|
|
26
|
+
const first = focusable[0];
|
|
27
|
+
const last = focusable[focusable.length - 1];
|
|
28
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
last.focus();
|
|
31
|
+
}
|
|
32
|
+
else if (!e.shiftKey && document.activeElement === last) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
first.focus();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
39
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
40
|
+
}, [open, onCancel]);
|
|
41
|
+
if (!open)
|
|
42
|
+
return null;
|
|
43
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", "data-component": "confirmation-dialog", children: [_jsx("div", { className: "fixed inset-0 bg-black/50", "aria-hidden": "true", onClick: onCancel }), _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": "confirm-dialog-title", "aria-describedby": "confirm-dialog-desc", ref: dialogRef, className: "relative z-10 w-full max-w-md rounded-lg border border-border bg-card px-6 py-5 shadow-lg", children: [_jsx("h2", { id: "confirm-dialog-title", className: "text-lg font-semibold text-foreground", children: "Confirm action" }), _jsxs("p", { id: "confirm-dialog-desc", className: "mt-2 text-sm text-muted-foreground", children: ["Are you sure you want to ", actionName, "? This action cannot be undone."] }), _jsxs("div", { "data-slot": "actions", className: "mt-5 flex justify-end gap-3", children: [_jsx("button", { ref: cancelRef, type: "button", onClick: onCancel, "data-variant": "outline", className: "rounded-md border border-border bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent", children: "Cancel" }), _jsx("button", { type: "button", onClick: onConfirm, "data-variant": "destructive", className: "rounded-md bg-destructive px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-destructive/90", children: "Confirm" })] })] })] }));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=ConfirmationDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationDialog.js","sourceRoot":"","sources":["../../../src/components/TaskActions/ConfirmationDialog.tsx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type { TaskAction } from '../../types';
|
|
2
|
+
export interface TaskActionsProps {
|
|
3
|
+
actions: TaskAction[];
|
|
4
|
+
userRoles: string[];
|
|
5
|
+
onAction: (actionName: string) => void;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function TaskActions({ actions, userRoles, onAction, loading, className, }: TaskActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=TaskActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskActions.d.ts","sourceRoot":"","sources":["../../../src/components/TaskActions/TaskActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,OAAe,EACf,SAAS,GACV,EAAE,gBAAgB,kDAyFlB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
3
|
+
import { ConfirmationDialog } from './ConfirmationDialog';
|
|
4
|
+
const DESTRUCTIVE_PATTERNS = /reject|abort|cancel/i;
|
|
5
|
+
function isDestructive(actionName) {
|
|
6
|
+
return DESTRUCTIVE_PATTERNS.test(actionName);
|
|
7
|
+
}
|
|
8
|
+
export function TaskActions({ actions, userRoles, onAction, loading = false, className, }) {
|
|
9
|
+
const [pendingAction, setPendingAction] = useState(null);
|
|
10
|
+
const [activeAction, setActiveAction] = useState(null);
|
|
11
|
+
const filteredActions = actions.filter((action) => {
|
|
12
|
+
if (!action.roles || action.roles.length === 0)
|
|
13
|
+
return true;
|
|
14
|
+
return action.roles.some((role) => userRoles.includes(role));
|
|
15
|
+
});
|
|
16
|
+
const handleClick = useCallback((actionName) => {
|
|
17
|
+
if (loading)
|
|
18
|
+
return;
|
|
19
|
+
if (isDestructive(actionName)) {
|
|
20
|
+
setPendingAction(actionName);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
setActiveAction(actionName);
|
|
24
|
+
onAction(actionName);
|
|
25
|
+
}, [loading, onAction]);
|
|
26
|
+
const handleConfirm = useCallback(() => {
|
|
27
|
+
if (pendingAction) {
|
|
28
|
+
setActiveAction(pendingAction);
|
|
29
|
+
onAction(pendingAction);
|
|
30
|
+
setPendingAction(null);
|
|
31
|
+
}
|
|
32
|
+
}, [pendingAction, onAction]);
|
|
33
|
+
const handleCancel = useCallback(() => {
|
|
34
|
+
setPendingAction(null);
|
|
35
|
+
}, []);
|
|
36
|
+
if (filteredActions.length === 0)
|
|
37
|
+
return null;
|
|
38
|
+
return (_jsxs("div", { className: `flex flex-wrap gap-3 ${className ?? ''}`, "data-component": "task-actions", role: "group", "aria-label": "Task actions", children: [filteredActions.map((action, index) => {
|
|
39
|
+
const isPrimary = index === 0;
|
|
40
|
+
const destructive = isDestructive(action.name);
|
|
41
|
+
const isActive = loading && activeAction === action.name;
|
|
42
|
+
const baseClasses = 'inline-flex items-center gap-2 rounded-xl px-7 py-2.5 text-sm font-bold transition-colors disabled:opacity-50';
|
|
43
|
+
const variantClasses = destructive
|
|
44
|
+
? 'border-2 border-destructive text-destructive hover:bg-destructive/5'
|
|
45
|
+
: isPrimary
|
|
46
|
+
? 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90'
|
|
47
|
+
: 'border border-border bg-background text-foreground hover:bg-accent';
|
|
48
|
+
return (_jsxs("button", { type: "button", onClick: () => handleClick(action.name), disabled: loading, className: `${baseClasses} ${variantClasses}`, "data-variant": destructive ? 'destructive' : isPrimary ? 'primary' : 'outline', "aria-label": `${action.label} task`, children: [isActive && (_jsx("span", { role: "status", "aria-label": "Processing", "data-spinner": "true", className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" })), action.label] }, action.name));
|
|
49
|
+
}), _jsx(ConfirmationDialog, { open: pendingAction !== null, actionName: pendingAction ?? '', onConfirm: handleConfirm, onCancel: handleCancel })] }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=TaskActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskActions.js","sourceRoot":"","sources":["../../../src/components/TaskActions/TaskActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAU1D,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAEpD,SAAS,aAAa,CAAC,UAAkB;IACvC,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,EAC1B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,SAAS,GACQ;IACjB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAEtE,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QAChD,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE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K,MAAM,CAAC,IAAI,CAAC;gBAEzD,MAAM,WAAW,GACf,+GAA+G,CAAC;gBAClH,MAAM,cAAc,GAAG,WAAW;oBAChC,CAAC,CAAC,qEAAqE;oBACvE,CAAC,CAAC,SAAS;wBACT,CAAC,CAAC,kEAAkE;wBACpE,CAAC,CAAC,oEAAoE,CAAC;gBAE3E,OAAO,CACL,kBAEE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EACvC,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,GAAG,WAAW,IAAI,cAAc,EAAE,kBAC/B,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,gBACjE,GAAG,MAAM,CAAC,KAAK,OAAO,aAEjC,QAAQ,IAAI,CACX,eACE,IAAI,EAAC,QAAQ,gBACF,YAAY,kBACV,MAAM,EACnB,SAAS,EAAC,gFAAgF,GAC1F,CACH,EACA,MAAM,CAAC,KAAK,KAhBR,MAAM,CAAC,IAAI,CAiBT,CACV,CAAC;YACJ,CAAC,CAAC,EAEF,KAAC,kBAAkB,IACjB,IAAI,EAAE,aAAa,KAAK,IAAI,EAC5B,UAAU,EAAE,aAAa,IAAI,EAAE,EAC/B,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,YAAY,GACtB,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TaskActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TaskActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAgC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TaskDetail as TaskDetailType } from '../../types';
|
|
2
|
+
export interface TaskDetailProps {
|
|
3
|
+
taskId: string;
|
|
4
|
+
onActionComplete?: (task: TaskDetailType, actionName: string) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function TaskDetail({ taskId, onActionComplete, className }: TaskDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TaskDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskDetail.d.ts","sourceRoot":"","sources":["../../../src/components/TaskDetail/TaskDetail.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAsB,MAAM,aAAa,CAAC;AASpF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmBD,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,eAAe,2CAuPlF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useRef, useEffect } from 'react';
|
|
3
|
+
import { useTask } from '../../hooks/useTask';
|
|
4
|
+
import { useTaskClaim } from '../../hooks/useTaskClaim';
|
|
5
|
+
import { useTaskAction } from '../../hooks/useTaskAction';
|
|
6
|
+
import { useWorkflowContext } from '../../provider/WorkflowProvider';
|
|
7
|
+
import { isApiError } from '@quanticjs/react-core';
|
|
8
|
+
import { WorkflowForm } from '../WorkflowForm';
|
|
9
|
+
import { TaskActions } from '../TaskActions';
|
|
10
|
+
import { ProcessTimeline } from '../ProcessTimeline';
|
|
11
|
+
import { TaskDetailHeader } from './TaskDetailHeader';
|
|
12
|
+
import { TaskDetailSkeleton } from './TaskDetailSkeleton';
|
|
13
|
+
import { TaskDetailNotFound } from './TaskDetailNotFound';
|
|
14
|
+
import { TaskDetailError } from './TaskDetailError';
|
|
15
|
+
function toFormSchema(task) {
|
|
16
|
+
return {
|
|
17
|
+
fields: task.formSchema.map((f) => ({
|
|
18
|
+
name: f.key,
|
|
19
|
+
type: f.type,
|
|
20
|
+
label: f.label,
|
|
21
|
+
required: f.required,
|
|
22
|
+
options: f.options,
|
|
23
|
+
validation: f.validation,
|
|
24
|
+
})),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function isNotFoundError(error) {
|
|
28
|
+
return isApiError(error) && error.status === 404;
|
|
29
|
+
}
|
|
30
|
+
export function TaskDetail({ taskId, onActionComplete, className }) {
|
|
31
|
+
const { userContext, toast } = useWorkflowContext();
|
|
32
|
+
const [activeAction, setActiveAction] = useState(null);
|
|
33
|
+
const [pendingSubmit, setPendingSubmit] = useState(false);
|
|
34
|
+
const formRef = useRef(null);
|
|
35
|
+
const { data: task, isLoading, isError, error, refetch } = useTask(taskId);
|
|
36
|
+
const { claim } = useTaskClaim(taskId);
|
|
37
|
+
const actionMutation = useTaskAction(taskId);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (pendingSubmit && activeAction && formRef.current) {
|
|
40
|
+
formRef.current.requestSubmit();
|
|
41
|
+
setPendingSubmit(false);
|
|
42
|
+
}
|
|
43
|
+
}, [pendingSubmit, activeAction]);
|
|
44
|
+
const handleClaim = useCallback(() => {
|
|
45
|
+
claim.mutate(undefined, {
|
|
46
|
+
onError: (err) => {
|
|
47
|
+
if (isApiError(err) && err.status === 409) {
|
|
48
|
+
toast({
|
|
49
|
+
title: 'Task was claimed by another user',
|
|
50
|
+
description: 'The task data has been refreshed.',
|
|
51
|
+
variant: 'destructive',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}, [claim, toast]);
|
|
57
|
+
const handleAction = useCallback((actionName) => {
|
|
58
|
+
setActiveAction(actionName);
|
|
59
|
+
if (formRef.current) {
|
|
60
|
+
setPendingSubmit(true);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
actionMutation.mutate({ actionName }, {
|
|
64
|
+
onSuccess: () => {
|
|
65
|
+
setActiveAction(null);
|
|
66
|
+
if (task)
|
|
67
|
+
onActionComplete?.(task, actionName);
|
|
68
|
+
},
|
|
69
|
+
onError: () => {
|
|
70
|
+
setActiveAction(null);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}, [actionMutation, task, onActionComplete]);
|
|
75
|
+
const handleFormSubmit = useCallback((data) => {
|
|
76
|
+
if (!activeAction)
|
|
77
|
+
return;
|
|
78
|
+
actionMutation.mutate({ actionName: activeAction, data }, {
|
|
79
|
+
onSuccess: () => {
|
|
80
|
+
const completedAction = activeAction;
|
|
81
|
+
setActiveAction(null);
|
|
82
|
+
if (task)
|
|
83
|
+
onActionComplete?.(task, completedAction);
|
|
84
|
+
},
|
|
85
|
+
onError: () => {
|
|
86
|
+
setActiveAction(null);
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}, [activeAction, actionMutation, task, onActionComplete]);
|
|
90
|
+
if (isLoading) {
|
|
91
|
+
return _jsx(TaskDetailSkeleton, { className: className });
|
|
92
|
+
}
|
|
93
|
+
if (isError) {
|
|
94
|
+
if (isNotFoundError(error)) {
|
|
95
|
+
return _jsx(TaskDetailNotFound, { className: className });
|
|
96
|
+
}
|
|
97
|
+
return _jsx(TaskDetailError, { error: error, onRetry: () => refetch(), className: className });
|
|
98
|
+
}
|
|
99
|
+
if (!task) {
|
|
100
|
+
return _jsx(TaskDetailNotFound, { className: className });
|
|
101
|
+
}
|
|
102
|
+
const isPending = task.status === 'pending';
|
|
103
|
+
const isInProgress = task.status === 'in_progress' || task.status === 'active';
|
|
104
|
+
const isCompleted = task.status === 'completed';
|
|
105
|
+
const isSuspended = task.status === 'suspended';
|
|
106
|
+
const isAssignee = task.assignedUser === userContext.userId;
|
|
107
|
+
const hasMatchingRole = userContext.roles.includes(task.assignedRole);
|
|
108
|
+
const filteredActions = task.actions.filter((action) => {
|
|
109
|
+
if (!action.roles || action.roles.length === 0)
|
|
110
|
+
return true;
|
|
111
|
+
return action.roles.some((role) => userContext.roles.includes(role));
|
|
112
|
+
});
|
|
113
|
+
const hasActions = filteredActions.length > 0;
|
|
114
|
+
return (_jsxs("div", { className: `space-y-4 ${className ?? ''}`, "data-component": "task-detail", "aria-live": "polite", children: [_jsx(TaskDetailHeader, { task: task }), isSuspended && (_jsx("div", { "data-slot": "suspended-message", role: "status", className: "rounded-2xl border border-border bg-muted/50 px-5 py-4 text-center text-sm text-muted-foreground shadow-sm", children: _jsx("p", { children: "Process suspended" }) })), isPending && hasMatchingRole && (_jsxs("div", { "data-slot": "claim-section", className: "flex flex-col items-center gap-3 rounded-2xl border border-dashed border-border bg-card px-6 py-8 text-center shadow-sm", children: [_jsx("svg", { className: "h-10 w-10 text-muted-foreground/50", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z" }) }), _jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Claim this task" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "This task is available for your role. Claim it to start working." }), _jsxs("button", { type: "button", onClick: handleClaim, disabled: claim.isPending, className: "mt-2 inline-flex items-center gap-2 rounded-xl bg-primary px-7 py-2.5 text-sm font-bold text-primary-foreground shadow-sm transition-colors hover:bg-primary/90 disabled:opacity-50", "data-variant": "primary", "aria-label": "Claim task", children: [claim.isPending && (_jsx("span", { role: "status", "aria-label": "Processing", "data-spinner": "true", className: "h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground border-t-transparent" })), "Claim"] })] })), isPending && !hasMatchingRole && (_jsx("div", { "data-slot": "no-permission", role: "status", className: "rounded-2xl border border-border bg-muted/50 px-5 py-4 text-center text-sm text-muted-foreground shadow-sm", children: _jsx("p", { children: "You don't have permission to claim this task" }) })), isInProgress && !isAssignee && (_jsx("div", { "data-slot": "claimed-by-other", role: "status", className: "rounded-2xl border border-border bg-muted/50 px-5 py-4 text-center text-sm text-muted-foreground shadow-sm", children: _jsxs("p", { children: ["Claimed by ", task.assignedUserDisplayName ?? task.assignedUser] }) })), isInProgress && isAssignee && (_jsxs(_Fragment, { children: [_jsxs("div", { "data-slot": "form-section", className: "overflow-hidden rounded-2xl border border-border bg-card shadow-sm", children: [_jsx("div", { className: "border-b border-border px-6 py-4", children: _jsx("p", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Task Details" }) }), _jsx("div", { className: "px-6 py-5", children: _jsx(WorkflowForm, { ref: formRef, schema: toFormSchema(task), initialValues: task.formData, onSubmit: handleFormSubmit, activeAction: activeAction ?? undefined }) })] }), hasActions ? (_jsx(TaskActions, { actions: task.actions, userRoles: userContext.roles, onAction: handleAction, loading: actionMutation.isPending })) : (_jsx("div", { "data-slot": "no-actions", role: "status", className: "rounded-2xl border border-border bg-muted/50 px-5 py-4 text-center text-sm text-muted-foreground shadow-sm", children: _jsx("p", { children: "No actions available for your role." }) }))] })), isCompleted && (_jsxs("div", { "data-slot": "completed-section", className: "space-y-4", children: [_jsx("span", { "data-badge": "outcome", className: "inline-flex items-center rounded-lg px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider bg-emerald-100 text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-400", children: "Completed" }), _jsxs("div", { className: "overflow-hidden rounded-2xl border border-border bg-card shadow-sm", children: [_jsx("div", { className: "border-b border-border px-6 py-4", children: _jsx("p", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Task Details" }) }), _jsx("div", { className: "px-6 py-5", children: _jsx(WorkflowForm, { schema: toFormSchema(task), initialValues: task.formData, readOnly: true }) })] })] })), _jsx(ProcessTimeline, { instanceId: task.instanceId })] }));
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=TaskDetail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskDetail.js","sourceRoot":"","sources":["../../../src/components/TaskDetail/TaskDetail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAA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AQ,EAAE,YAAY,EACtB,OAAO,EAAE,cAAc,CAAC,SAAS,GACjC,CACH,CAAC,CAAC,CAAC,CACF,2BACY,YAAY,EACtB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,4GAA4G,YAEtH,8DAA0C,GACtC,CACP,IACA,CACJ,EAEA,WAAW,IAAI,CACd,4BAAe,mBAAmB,EAAC,SAAS,EAAC,WAAW,aACtD,6BACa,SAAS,EACpB,SAAS,EAAC,6KAA6K,0BAGlL,EACP,eAAK,SAAS,EAAC,oEAAoE,aACjF,cAAK,SAAS,EAAC,kCAAkC,YAC/C,YAAG,SAAS,EAAC,mEAAmE,6BAE5E,GACA,EACN,cAAK,SAAS,EAAC,WAAW,YACxB,KAAC,YAAY,IAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,SAAG,GAC/E,IACF,IACF,CACP,EAED,KAAC,eAAe,IAAC,UAAU,EAAE,IAAI,CAAC,UAAU,GAAI,IAC5C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface TaskDetailErrorProps {
|
|
2
|
+
error: Error | null;
|
|
3
|
+
onRetry: () => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TaskDetailError: import("react").ForwardRefExoticComponent<TaskDetailErrorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
//# sourceMappingURL=TaskDetailError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskDetailError.d.ts","sourceRoot":"","sources":["../../../src/components/TaskDetail/TaskDetailError.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,iHA8B3B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { isApiError } from '@quanticjs/react-core';
|
|
4
|
+
export const TaskDetailError = forwardRef(function TaskDetailError({ error, onRetry, className }, ref) {
|
|
5
|
+
const correlationId = error && isApiError(error) ? error.correlationId : undefined;
|
|
6
|
+
return (_jsxs("div", { ref: ref, className: `rounded-2xl border border-destructive/30 bg-destructive/5 px-5 py-6 text-center shadow-sm ${className ?? ''}`, "data-component": "task-detail-error", role: "alert", children: [_jsx("p", { className: "text-sm font-medium text-destructive", children: "Something went wrong loading this task" }), correlationId && (_jsxs("p", { "data-field": "error-ref", className: "mt-1 text-xs text-muted-foreground", children: ["Reference: ", correlationId] })), _jsx("button", { type: "button", onClick: onRetry, "aria-label": "Retry loading task", className: "mt-4 rounded-md border border-destructive/30 bg-background px-4 py-1.5 text-sm font-medium text-destructive transition-colors hover:bg-destructive/10", children: "Retry" })] }));
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=TaskDetailError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskDetailError.js","sourceRoot":"","sources":["../../../src/components/TaskDetail/TaskDetailError.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQnD,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CACvC,SAAS,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG;IACzD,MAAM,aAAa,GAAG,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnF,OAAO,CACL,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,6FAA6F,SAAS,IAAI,EAAE,EAAE,oBAC1G,mBAAmB,EAClC,IAAI,EAAC,OAAO,aAEZ,YAAG,SAAS,EAAC,sCAAsC,uDAE/C,EACH,aAAa,IAAI,CAChB,2BAAc,WAAW,EAAC,SAAS,EAAC,oCAAoC,4BAC1D,aAAa,IACvB,CACL,EACD,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACL,oBAAoB,EAC/B,SAAS,EAAC,uJAAuJ,sBAG1J,IACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TaskDetail } from '../../types';
|
|
2
|
+
export interface TaskDetailHeaderProps {
|
|
3
|
+
task: TaskDetail;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TaskDetailHeader: import("react").ForwardRefExoticComponent<TaskDetailHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
//# sourceMappingURL=TaskDetailHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskDetailHeader.d.ts","sourceRoot":"","sources":["../../../src/components/TaskDetail/TaskDetailHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmCD,eAAO,MAAM,gBAAgB,kHA6E5B,CAAC"}
|