odaptos_design_system 1.4.132 → 1.4.134

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.
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  interface RowCellProps {
3
- prefix: string;
4
- value: string;
5
- sufix: string;
3
+ prefix?: string;
4
+ value?: string;
5
+ sufix?: string;
6
6
  }
7
7
  export declare const RowCell: ({ prefix, value, sufix }: RowCellProps) => React.JSX.Element;
8
8
  export {};
@@ -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: TaskItem) => void;
25
- tasks: TaskItem[];
26
- sendTask: (task: TaskItem) => void;
27
- currentTask?: TaskItem;
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 {};
@@ -8893,8 +8893,8 @@ const RowCell = ({
8893
8893
  }) => {
8894
8894
  const yesValues = ['yes', 'oui', 'sí', 'si', 'ja'];
8895
8895
  const noValues = ['no', 'non', 'nein', 'não', 'nao'];
8896
- const showCheckmark = yesValues.includes(value.toLowerCase());
8897
- const hideCheckmark = noValues.includes(value.toLowerCase());
8896
+ const showCheckmark = value ? yesValues.includes(value.toLowerCase()) : false;
8897
+ const hideCheckmark = value ? noValues.includes(value.toLowerCase()) : false;
8898
8898
  return /*#__PURE__*/React__default.createElement("div", {
8899
8899
  className: styles$a.rowCell
8900
8900
  }, prefix && /*#__PURE__*/React__default.createElement(Text, {
@@ -8903,7 +8903,7 @@ const RowCell = ({
8903
8903
  text: prefix
8904
8904
  }), showCheckmark ? /*#__PURE__*/React__default.createElement(CheckedIcon, {
8905
8905
  className: styles$a.checkedIcon
8906
- }) : hideCheckmark ? null : /*#__PURE__*/React__default.createElement(Text, {
8906
+ }) : hideCheckmark || !value ? null : /*#__PURE__*/React__default.createElement(Text, {
8907
8907
  size: "sm",
8908
8908
  weight: "bold",
8909
8909
  text: value
@@ -9070,12 +9070,17 @@ const FeatureRow = ({
9070
9070
  variant: "tertiary",
9071
9071
  size: "xxs",
9072
9072
  className: styles$a.tooltipButton
9073
- }))), tierList.map((tier, index) => /*#__PURE__*/React__default.createElement(RowCell, {
9074
- key: `${feature.Name}-${index}`,
9075
- prefix: feature[tier].Prefix,
9076
- value: feature[tier].Value,
9077
- sufix: feature[tier].Sufix
9078
- })));
9073
+ }))), tierList.map((tier, index) => {
9074
+ const tierPrefix = feature[tier] ? feature[tier].Prefix : undefined;
9075
+ const tierValue = feature[tier] ? feature[tier].Value : undefined;
9076
+ const tierSufix = feature[tier] ? feature[tier].Sufix : undefined;
9077
+ return /*#__PURE__*/React__default.createElement(RowCell, {
9078
+ key: `${feature.Name}-${index}`,
9079
+ prefix: tierPrefix,
9080
+ value: tierValue,
9081
+ sufix: tierSufix
9082
+ });
9083
+ }));
9079
9084
  };
9080
9085
 
9081
9086
  const SectionTitleRow = ({
@@ -9218,27 +9223,30 @@ const Chat = ({
9218
9223
  }), /*#__PURE__*/React__default.createElement("div", {
9219
9224
  className: `${styles$d.tasks_container} ${styles$d.no_scrollbar}`
9220
9225
  }, isTaskMode ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, tasks.map(task => {
9221
- if (task.type === 'question' || task.type === 'task' || task.type === 'scenario' && isInterviewer) return /*#__PURE__*/React__default.createElement(Task, {
9222
- key: task._id,
9223
- taskNumber: `${task.type === 'task' ? 'Task' : task.type === 'question' ? 'Question' : 'Scenario'} #${task.index}`,
9224
- taskTitle: task.description,
9225
- url: task.url,
9226
- notes: task.notes,
9227
- state: idsTasksAlreadySent.includes(task._id) ? 'disabled' : currentTask && currentTask._id === task._id ? 'active' : 'idle',
9228
- task: task,
9229
- sendTask: () => {
9230
- if (task.type === 'task' || task.type === 'question') sendTask(task);else if (startInterview && task.type === 'scenario') startInterview(task);else return;
9231
- },
9232
- isDone: false,
9233
- isInterviewer: isInterviewer
9234
- });else if (task.type === 'scenario' && !isInterviewer) {
9235
- console.log('task', task);
9226
+ if (task.type === 'question' || task.type === 'task' || task.type === 'scenario' && isInterviewer) {
9227
+ const realTask = isInterviewer ? task : JSON.parse(task.body);
9228
+ return /*#__PURE__*/React__default.createElement(Task, {
9229
+ key: realTask._id,
9230
+ taskNumber: `${realTask.type === 'task' ? 'Task' : realTask.type === 'question' ? 'Question' : 'Scenario'} #${realTask.index}`,
9231
+ taskTitle: realTask.description,
9232
+ url: realTask.url,
9233
+ notes: realTask.notes,
9234
+ state: idsTasksAlreadySent.includes(realTask._id) ? 'disabled' : currentTask && currentTask._id === realTask._id ? 'active' : 'idle',
9235
+ task: realTask,
9236
+ sendTask: () => {
9237
+ if (realTask.type === 'task' || realTask.type === 'question') sendTask(realTask);else if (startInterview && realTask.type === 'scenario') startInterview(realTask);else return;
9238
+ },
9239
+ isDone: false,
9240
+ isInterviewer: isInterviewer
9241
+ });
9242
+ } else if (task.type === 'scenario' && !isInterviewer) {
9243
+ const scenario = isInterviewer ? task : JSON.parse(task.body);
9236
9244
  return /*#__PURE__*/React__default.createElement(Scenario, {
9237
- title: task.name,
9238
- description: task.description ?? '',
9239
- buttonText: task.url ? startInterviewBtnTitle : undefined,
9240
- buttonIcon: task.url ? startInterviewIcon : undefined,
9241
- url: task.url
9245
+ title: scenario.name,
9246
+ description: scenario.description ?? '',
9247
+ buttonText: scenario.url ? startInterviewBtnTitle : undefined,
9248
+ buttonIcon: scenario.url ? startInterviewIcon : undefined,
9249
+ url: scenario.url
9242
9250
  });
9243
9251
  } else return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
9244
9252
  })) : messages && messages.map(message => {