@confidencesystemsinc/sdk 1.2.0 → 1.2.2
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/playbook/confidence-playbook.d.ts +12 -5
- package/dist/components/playbook/playbook-header.d.ts +3 -1
- package/dist/components/playbook-button/ConfidencePlaybookButton.d.ts +2 -1
- package/dist/components/task/confidence-task.d.ts +10 -3
- package/dist/components/task/task-buttons.d.ts +2 -1
- package/dist/components/task/task-expanded-content.d.ts +3 -0
- package/dist/components/ui/button.d.ts +1 -0
- package/dist/confidence_logo.png +0 -0
- package/dist/constants/settings.constants.d.ts +2 -2
- package/dist/context/confidence-context.d.ts +10 -0
- package/dist/hooks/task/useTaskDetails.d.ts +173 -0
- package/dist/hooks/usePlaybookExpandedTasks.d.ts +4 -0
- package/dist/hooks/useTaskButtons.d.ts +2 -1
- package/dist/index.cjs +15 -15
- package/dist/index.js +3587 -3317
- package/dist/services/task-details.service.d.ts +4 -0
- package/dist/stories/confidence-task.stories.d.ts +50 -0
- package/dist/theme.css +1 -1
- package/package.json +3 -2
- package/src/components/badge.tsx +116 -0
- package/src/components/initiate-playbook-modal/InitiatePlaybookModal.tsx +53 -0
- package/src/components/playbook/confidence-playbook.tsx +346 -0
- package/src/components/playbook/playbook-header.tsx +32 -0
- package/src/components/playbook-button/ConfidencePlaybookButton.tsx +79 -0
- package/src/components/task/confidence-task.tsx +297 -0
- package/src/components/task/task-buttons.tsx +35 -0
- package/src/components/task/task-dropdown-badge.tsx +118 -0
- package/src/components/task/task-expanded-content.tsx +46 -0
- package/src/components/task/task-left-panel.tsx +60 -0
- package/src/components/task/task-status-badge.tsx +23 -0
- package/src/components/ui/button.tsx +272 -0
- package/src/components/ui/input.tsx +39 -0
- package/src/components/ui/modal.tsx +88 -0
- package/src/components/ui/ui-wrapper.tsx +7 -0
- package/src/constants/settings.constants.ts +4 -0
- package/src/context/confidence-context.tsx +25 -0
- package/src/hooks/task/useCompleteTask.ts +32 -0
- package/src/hooks/task/useStartTask.ts +35 -0
- package/src/hooks/task/useTaskDetails.ts +42 -0
- package/src/hooks/usePlaybook.ts +54 -0
- package/src/hooks/usePlaybookActions.ts +69 -0
- package/src/hooks/usePlaybookExpandedTasks.ts +35 -0
- package/src/hooks/useTaskButtons.ts +47 -0
- package/src/index.ts +7 -0
- package/src/services/complete-task.service.ts +25 -0
- package/src/services/initiate-playbook.service.ts +26 -0
- package/src/services/start-task.services.ts +27 -0
- package/src/services/task-details.service.ts +17 -0
- package/src/stories/confidence-playbook.stories.tsx +124 -0
- package/src/stories/confidence-task.stories.tsx +63 -0
- package/src/stories/initiate-playbook-modal.stories.tsx +31 -0
- package/src/stories/modal.stories.tsx +50 -0
- package/src/task-description.css +629 -0
- package/src/theme.css +11 -0
- package/src/types/playbook.types.ts +22 -0
- package/src/types/task.types.ts +20 -0
- package/src/utils/cn.ts +6 -0
- package/src/vite-env.d.ts +1 -0
- package/dist/components/ui/header.d.ts +0 -1
- /package/dist/hooks/{task-events → task}/useCompleteTask.d.ts +0 -0
- /package/dist/hooks/{task-events → task}/useStartTask.d.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { TaskButton } from '../../hooks/useTaskButtons';
|
|
3
2
|
import { Playbook } from '../../types/playbook.types';
|
|
4
3
|
export interface ConfidencePlaybookStyleConfiguration {
|
|
@@ -6,6 +5,13 @@ export interface ConfidencePlaybookStyleConfiguration {
|
|
|
6
5
|
position?: "left" | "right";
|
|
7
6
|
width?: number | string;
|
|
8
7
|
height?: number | string;
|
|
8
|
+
right?: number;
|
|
9
|
+
left?: number;
|
|
10
|
+
};
|
|
11
|
+
whiteLabel?: {
|
|
12
|
+
titleBackgroundColor?: string;
|
|
13
|
+
titleTextColor?: string;
|
|
14
|
+
primaryColor?: string;
|
|
9
15
|
};
|
|
10
16
|
}
|
|
11
17
|
export declare const ConfidencePlaybook: {
|
|
@@ -14,13 +20,13 @@ export declare const ConfidencePlaybook: {
|
|
|
14
20
|
playbookMode: "list" | "card";
|
|
15
21
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
16
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
Context: ({ children }: {
|
|
18
|
-
children: ReactNode;
|
|
23
|
+
Context: ({ children, }: {
|
|
24
|
+
children: React.ReactNode;
|
|
19
25
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
26
|
View: ({ playbook, playbookMode, onTaskButtonClick, playbookStyle, }: {
|
|
21
27
|
playbookMode: "list" | "card";
|
|
22
28
|
playbook: Playbook;
|
|
23
|
-
onTaskButtonClick: (btn: TaskButton, taskId: number) => void
|
|
29
|
+
onTaskButtonClick: (btn: TaskButton, taskId: number) => Promise<void>;
|
|
24
30
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
25
31
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
32
|
AutoInstantiated: ({ email, playbookId, playbookMode, }: {
|
|
@@ -28,9 +34,10 @@ export declare const ConfidencePlaybook: {
|
|
|
28
34
|
playbookId: string;
|
|
29
35
|
playbookMode: "list" | "card";
|
|
30
36
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, }: {
|
|
37
|
+
WithInstantiateButton: ({ playbookId, playbookMode, playbookStyle, btnLabel, }: {
|
|
32
38
|
playbookId: string;
|
|
33
39
|
playbookMode?: "list" | "card";
|
|
34
40
|
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
41
|
+
btnLabel?: string;
|
|
35
42
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
43
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ConfidencePlaybookStyleConfiguration } from './confidence-playbook';
|
|
2
|
+
export declare const PlaybookHeader: ({ title, className, playbookStyle, ...props }: React.ComponentProps<"div"> & {
|
|
2
3
|
title: string;
|
|
4
|
+
playbookStyle?: ConfidencePlaybookStyleConfiguration;
|
|
3
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ButtonSizeType } from '../ui/button';
|
|
2
|
-
export declare const ConfidencePlaybookButton: ({ btnClassName, buttonNode, size, playbookId, onInitiated, disabled, }: {
|
|
2
|
+
export declare const ConfidencePlaybookButton: ({ btnClassName, buttonNode, size, playbookId, onInitiated, disabled, btnLabel, }: {
|
|
3
3
|
btnClassName?: string;
|
|
4
4
|
buttonNode?: React.ReactNode;
|
|
5
5
|
size?: ButtonSizeType;
|
|
6
6
|
playbookId: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
btnLabel?: string;
|
|
8
9
|
onInitiated: (playbookInstanceId: number) => void;
|
|
9
10
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,12 +6,19 @@ declare const TASK_VERIFICATION_TYPE: {
|
|
|
6
6
|
readonly SCREENSHOT: "screenshot";
|
|
7
7
|
};
|
|
8
8
|
export type TaskVerificationType = (typeof TASK_VERIFICATION_TYPE)[keyof typeof TASK_VERIFICATION_TYPE];
|
|
9
|
-
export declare const ConfidenceTask: ({ task, step, playbookType, onButtonClick,
|
|
9
|
+
export declare const ConfidenceTask: ({ task, step, playbookType, onButtonClick, viewMode, canStart, isExpanded, toggleExpanded, playbookId, taskStyle, listStickyTopBase, }: {
|
|
10
10
|
task: Task;
|
|
11
11
|
playbookType: PlaybookType;
|
|
12
12
|
step: number;
|
|
13
|
-
onButtonClick: (buttonType: TaskButton) => void
|
|
14
|
-
|
|
13
|
+
onButtonClick: (buttonType: TaskButton) => Promise<void>;
|
|
14
|
+
viewMode?: "card" | "list";
|
|
15
15
|
canStart?: boolean;
|
|
16
|
+
isExpanded?: boolean;
|
|
17
|
+
toggleExpanded?: (expand?: boolean) => void;
|
|
18
|
+
playbookId: number;
|
|
19
|
+
taskStyle?: {
|
|
20
|
+
titleColor?: string;
|
|
21
|
+
};
|
|
22
|
+
listStickyTopBase?: number;
|
|
16
23
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
24
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TaskButton } from '../../hooks/useTaskButtons';
|
|
2
|
-
export declare const TaskButtons: ({ buttons, onButtonClick, }: {
|
|
2
|
+
export declare const TaskButtons: ({ buttons, onButtonClick, disabled, }: {
|
|
3
3
|
buttons: TaskButton[];
|
|
4
4
|
onButtonClick: (buttonType: TaskButton) => void;
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,6 +33,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<Omit<HTMLButtonElement
|
|
|
33
33
|
dataCy?: string;
|
|
34
34
|
testingIdKey?: string;
|
|
35
35
|
style?: CSSProperties;
|
|
36
|
+
primaryColor?: string;
|
|
36
37
|
}
|
|
37
38
|
declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
38
39
|
export default Button;
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const CONFIDENCE_API_ENDPOINT: string;
|
|
2
|
+
export declare const DROPBOX_API_ENDPOINT: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
export declare const ConfidenceProvider: import('react').Provider<{
|
|
3
|
+
queryClient: QueryClient;
|
|
4
|
+
} | null>;
|
|
5
|
+
export declare const useConfidenceContext: () => {
|
|
6
|
+
queryClient: QueryClient;
|
|
7
|
+
};
|
|
8
|
+
export declare const ConfidenceContext: ({ children, }: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export declare const useTaskDetails: ({ taskId, playbookId, enabled, }: {
|
|
2
|
+
taskId: number | string;
|
|
3
|
+
playbookId: string | number;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
}) => {
|
|
6
|
+
data: any;
|
|
7
|
+
error: Error;
|
|
8
|
+
isError: true;
|
|
9
|
+
isPending: false;
|
|
10
|
+
isLoading: false;
|
|
11
|
+
isLoadingError: false;
|
|
12
|
+
isRefetchError: true;
|
|
13
|
+
isSuccess: false;
|
|
14
|
+
isPlaceholderData: false;
|
|
15
|
+
status: "error";
|
|
16
|
+
dataUpdatedAt: number;
|
|
17
|
+
errorUpdatedAt: number;
|
|
18
|
+
failureCount: number;
|
|
19
|
+
failureReason: Error | null;
|
|
20
|
+
errorUpdateCount: number;
|
|
21
|
+
isFetched: boolean;
|
|
22
|
+
isFetchedAfterMount: boolean;
|
|
23
|
+
isFetching: boolean;
|
|
24
|
+
isInitialLoading: boolean;
|
|
25
|
+
isPaused: boolean;
|
|
26
|
+
isRefetching: boolean;
|
|
27
|
+
isStale: boolean;
|
|
28
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<any, Error>>;
|
|
29
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
30
|
+
promise: Promise<any>;
|
|
31
|
+
taskDetails: any;
|
|
32
|
+
prefetchQuery: () => void;
|
|
33
|
+
} | {
|
|
34
|
+
data: any;
|
|
35
|
+
error: null;
|
|
36
|
+
isError: false;
|
|
37
|
+
isPending: false;
|
|
38
|
+
isLoading: false;
|
|
39
|
+
isLoadingError: false;
|
|
40
|
+
isRefetchError: false;
|
|
41
|
+
isSuccess: true;
|
|
42
|
+
isPlaceholderData: false;
|
|
43
|
+
status: "success";
|
|
44
|
+
dataUpdatedAt: number;
|
|
45
|
+
errorUpdatedAt: number;
|
|
46
|
+
failureCount: number;
|
|
47
|
+
failureReason: Error | null;
|
|
48
|
+
errorUpdateCount: number;
|
|
49
|
+
isFetched: boolean;
|
|
50
|
+
isFetchedAfterMount: boolean;
|
|
51
|
+
isFetching: boolean;
|
|
52
|
+
isInitialLoading: boolean;
|
|
53
|
+
isPaused: boolean;
|
|
54
|
+
isRefetching: boolean;
|
|
55
|
+
isStale: boolean;
|
|
56
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<any, Error>>;
|
|
57
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
58
|
+
promise: Promise<any>;
|
|
59
|
+
taskDetails: any;
|
|
60
|
+
prefetchQuery: () => void;
|
|
61
|
+
} | {
|
|
62
|
+
data: undefined;
|
|
63
|
+
error: Error;
|
|
64
|
+
isError: true;
|
|
65
|
+
isPending: false;
|
|
66
|
+
isLoading: false;
|
|
67
|
+
isLoadingError: true;
|
|
68
|
+
isRefetchError: false;
|
|
69
|
+
isSuccess: false;
|
|
70
|
+
isPlaceholderData: false;
|
|
71
|
+
status: "error";
|
|
72
|
+
dataUpdatedAt: number;
|
|
73
|
+
errorUpdatedAt: number;
|
|
74
|
+
failureCount: number;
|
|
75
|
+
failureReason: Error | null;
|
|
76
|
+
errorUpdateCount: number;
|
|
77
|
+
isFetched: boolean;
|
|
78
|
+
isFetchedAfterMount: boolean;
|
|
79
|
+
isFetching: boolean;
|
|
80
|
+
isInitialLoading: boolean;
|
|
81
|
+
isPaused: boolean;
|
|
82
|
+
isRefetching: boolean;
|
|
83
|
+
isStale: boolean;
|
|
84
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<any, Error>>;
|
|
85
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
86
|
+
promise: Promise<any>;
|
|
87
|
+
taskDetails: any;
|
|
88
|
+
prefetchQuery: () => void;
|
|
89
|
+
} | {
|
|
90
|
+
data: undefined;
|
|
91
|
+
error: null;
|
|
92
|
+
isError: false;
|
|
93
|
+
isPending: true;
|
|
94
|
+
isLoading: true;
|
|
95
|
+
isLoadingError: false;
|
|
96
|
+
isRefetchError: false;
|
|
97
|
+
isSuccess: false;
|
|
98
|
+
isPlaceholderData: false;
|
|
99
|
+
status: "pending";
|
|
100
|
+
dataUpdatedAt: number;
|
|
101
|
+
errorUpdatedAt: number;
|
|
102
|
+
failureCount: number;
|
|
103
|
+
failureReason: Error | null;
|
|
104
|
+
errorUpdateCount: number;
|
|
105
|
+
isFetched: boolean;
|
|
106
|
+
isFetchedAfterMount: boolean;
|
|
107
|
+
isFetching: boolean;
|
|
108
|
+
isInitialLoading: boolean;
|
|
109
|
+
isPaused: boolean;
|
|
110
|
+
isRefetching: boolean;
|
|
111
|
+
isStale: boolean;
|
|
112
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<any, Error>>;
|
|
113
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
114
|
+
promise: Promise<any>;
|
|
115
|
+
taskDetails: any;
|
|
116
|
+
prefetchQuery: () => void;
|
|
117
|
+
} | {
|
|
118
|
+
data: undefined;
|
|
119
|
+
error: null;
|
|
120
|
+
isError: false;
|
|
121
|
+
isPending: true;
|
|
122
|
+
isLoadingError: false;
|
|
123
|
+
isRefetchError: false;
|
|
124
|
+
isSuccess: false;
|
|
125
|
+
isPlaceholderData: false;
|
|
126
|
+
status: "pending";
|
|
127
|
+
dataUpdatedAt: number;
|
|
128
|
+
errorUpdatedAt: number;
|
|
129
|
+
failureCount: number;
|
|
130
|
+
failureReason: Error | null;
|
|
131
|
+
errorUpdateCount: number;
|
|
132
|
+
isFetched: boolean;
|
|
133
|
+
isFetchedAfterMount: boolean;
|
|
134
|
+
isFetching: boolean;
|
|
135
|
+
isLoading: boolean;
|
|
136
|
+
isInitialLoading: boolean;
|
|
137
|
+
isPaused: boolean;
|
|
138
|
+
isRefetching: boolean;
|
|
139
|
+
isStale: boolean;
|
|
140
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<any, Error>>;
|
|
141
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
142
|
+
promise: Promise<any>;
|
|
143
|
+
taskDetails: any;
|
|
144
|
+
prefetchQuery: () => void;
|
|
145
|
+
} | {
|
|
146
|
+
data: any;
|
|
147
|
+
isError: false;
|
|
148
|
+
error: null;
|
|
149
|
+
isPending: false;
|
|
150
|
+
isLoading: false;
|
|
151
|
+
isLoadingError: false;
|
|
152
|
+
isRefetchError: false;
|
|
153
|
+
isSuccess: true;
|
|
154
|
+
isPlaceholderData: true;
|
|
155
|
+
status: "success";
|
|
156
|
+
dataUpdatedAt: number;
|
|
157
|
+
errorUpdatedAt: number;
|
|
158
|
+
failureCount: number;
|
|
159
|
+
failureReason: Error | null;
|
|
160
|
+
errorUpdateCount: number;
|
|
161
|
+
isFetched: boolean;
|
|
162
|
+
isFetchedAfterMount: boolean;
|
|
163
|
+
isFetching: boolean;
|
|
164
|
+
isInitialLoading: boolean;
|
|
165
|
+
isPaused: boolean;
|
|
166
|
+
isRefetching: boolean;
|
|
167
|
+
isStale: boolean;
|
|
168
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<any, Error>>;
|
|
169
|
+
fetchStatus: import('@tanstack/react-query').FetchStatus;
|
|
170
|
+
promise: Promise<any>;
|
|
171
|
+
taskDetails: any;
|
|
172
|
+
prefetchQuery: () => void;
|
|
173
|
+
};
|
|
@@ -4,9 +4,10 @@ export declare const TASK_BUTTONS: {
|
|
|
4
4
|
readonly PAUSE: "PAUSE";
|
|
5
5
|
readonly RESUME: "RESUME";
|
|
6
6
|
readonly COMPLETE: "COMPLETE";
|
|
7
|
+
readonly EXPAND: "EXPAND";
|
|
7
8
|
};
|
|
8
9
|
export declare const TASK_BUTTONS_DISPLAY_TEXT: {
|
|
9
|
-
[key in TaskButton]
|
|
10
|
+
[key in TaskButton]?: string;
|
|
10
11
|
};
|
|
11
12
|
export type TaskButton = (typeof TASK_BUTTONS)[keyof typeof TASK_BUTTONS];
|
|
12
13
|
export declare const useTaskButtons: (args: {
|