odaptos_design_system 1.4.132 → 1.4.133
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/Interviews/Chat.d.ts +4 -18
- package/dist/odaptos_design_system.cjs.development.js +23 -20
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +23 -20
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Interviews/Chat.tsx +32 -40
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
interface TaskItem {
|
|
3
|
-
_id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
url: string;
|
|
6
|
-
name: string;
|
|
7
|
-
index: number;
|
|
8
|
-
notes: string;
|
|
9
|
-
type: 'task' | 'question';
|
|
10
|
-
timedTask: boolean;
|
|
11
|
-
totalSeconds: number;
|
|
12
|
-
successSeconds: number;
|
|
13
|
-
failureSeconds: number;
|
|
14
|
-
}
|
|
15
2
|
export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
3
|
goBackText?: string;
|
|
17
4
|
goBack?: () => void;
|
|
@@ -21,10 +8,10 @@ export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
21
8
|
startInterviewTitle?: string;
|
|
22
9
|
startInterviewBtnTitle?: string;
|
|
23
10
|
startInterviewIcon?: JSX.Element;
|
|
24
|
-
startInterview?: (task:
|
|
25
|
-
tasks:
|
|
26
|
-
sendTask: (task:
|
|
27
|
-
currentTask?:
|
|
11
|
+
startInterview?: (task: any) => void;
|
|
12
|
+
tasks: any[];
|
|
13
|
+
sendTask: (task: any) => void;
|
|
14
|
+
currentTask?: any;
|
|
28
15
|
chatInputPlaceholder?: string;
|
|
29
16
|
chatInputValue?: string;
|
|
30
17
|
chatInputonChange?: (message: string) => void;
|
|
@@ -37,4 +24,3 @@ export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
37
24
|
idsTasksAlreadySent: string[];
|
|
38
25
|
}
|
|
39
26
|
export declare const Chat: ({ goBackText, goBack, chatTitle, welcomeTitle, welcomeDescription, startInterviewTitle, startInterviewBtnTitle, startInterviewIcon, startInterview, tasks, sendTask, currentTask, chatInputPlaceholder, chatInputValue, chatInputonChange, sendMessage, className, isTaskMode, isInterviewer, messages, idsTasksAlreadySent, ...props }: ChatProps) => React.JSX.Element;
|
|
40
|
-
export {};
|
|
@@ -9218,27 +9218,30 @@ const Chat = ({
|
|
|
9218
9218
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9219
9219
|
className: `${styles$d.tasks_container} ${styles$d.no_scrollbar}`
|
|
9220
9220
|
}, isTaskMode ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, tasks.map(task => {
|
|
9221
|
-
if (task.type === 'question' || task.type === 'task' || task.type === 'scenario' && isInterviewer)
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9221
|
+
if (task.type === 'question' || task.type === 'task' || task.type === 'scenario' && isInterviewer) {
|
|
9222
|
+
const realTask = JSON.parse(task.body);
|
|
9223
|
+
return /*#__PURE__*/React__default.createElement(Task, {
|
|
9224
|
+
key: realTask._id,
|
|
9225
|
+
taskNumber: `${realTask.type === 'task' ? 'Task' : realTask.type === 'question' ? 'Question' : 'Scenario'} #${realTask.index}`,
|
|
9226
|
+
taskTitle: realTask.description,
|
|
9227
|
+
url: realTask.url,
|
|
9228
|
+
notes: realTask.notes,
|
|
9229
|
+
state: idsTasksAlreadySent.includes(realTask._id) ? 'disabled' : currentTask && currentTask._id === realTask._id ? 'active' : 'idle',
|
|
9230
|
+
task: realTask,
|
|
9231
|
+
sendTask: () => {
|
|
9232
|
+
if (realTask.type === 'task' || realTask.type === 'question') sendTask(realTask);else if (startInterview && realTask.type === 'scenario') startInterview(realTask);else return;
|
|
9233
|
+
},
|
|
9234
|
+
isDone: false,
|
|
9235
|
+
isInterviewer: isInterviewer
|
|
9236
|
+
});
|
|
9237
|
+
} else if (task.type === 'scenario' && !isInterviewer) {
|
|
9238
|
+
const scenario = JSON.parse(task.body);
|
|
9236
9239
|
return /*#__PURE__*/React__default.createElement(Scenario, {
|
|
9237
|
-
title:
|
|
9238
|
-
description:
|
|
9239
|
-
buttonText:
|
|
9240
|
-
buttonIcon:
|
|
9241
|
-
url:
|
|
9240
|
+
title: scenario.name,
|
|
9241
|
+
description: scenario.description ?? '',
|
|
9242
|
+
buttonText: scenario.url ? startInterviewBtnTitle : undefined,
|
|
9243
|
+
buttonIcon: scenario.url ? startInterviewIcon : undefined,
|
|
9244
|
+
url: scenario.url
|
|
9242
9245
|
});
|
|
9243
9246
|
} else return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
9244
9247
|
})) : messages && messages.map(message => {
|