odaptos_design_system 1.4.110 → 1.4.113

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.
@@ -7953,8 +7953,8 @@ const ControlsBar = ({
7953
7953
  }));
7954
7954
  };
7955
7955
 
7956
- var css_248z$b = ".Chat-modules_chatContainer__xzg50{align-items:flex-start;background:#fff;border-radius:.5rem;display:flex;flex-direction:column;gap:.5rem;height:100%;min-width:25rem;padding:1rem}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP{display:flex;flex-direction:column;gap:1rem;max-width:100%;width:100%}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh{display:flex;flex-direction:column;gap:1rem;max-height:70%;overflow-x:hidden;overflow-y:scroll}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_message_container__-ocjf{animation:Chat-modules_floatup__aU0gp .5s forwards;display:flex;flex-direction:row;gap:.5rem;justify-content:flex-end;margin:2rem 0;width:100%}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_message_container__-ocjf .Chat-modules_message__6y4CT p{margin-left:auto}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_text_message__T2wQS{align-items:flex-end;background:var(--color-primary-100,#e5f1ff);border:1px solid var(--color-primary-200,#99c9ff);border-radius:.5rem 0 .5rem .5rem;display:flex;flex-direction:column;gap:.5rem;margin-left:auto;max-width:100%;padding:1rem;white-space:break-spaces;width:-moz-fit-content;width:fit-content}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_text_message_username__CpwdY{display:flex;margin-left:auto;width:-moz-fit-content;width:fit-content}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_indicator__p0Ehc{align-items:center;background:var(--color-gradients-003,linear-gradient(135deg,#07f 0,#9024f6 100%));border-radius:.5rem .5rem .5rem 0;display:flex;height:2.75rem;justify-content:center;padding:.625rem .5625rem;width:2.75rem}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_indicator__p0Ehc p{padding:0}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_message_container_chatbot__s2mU6{animation:Chat-modules_floatup__aU0gp .5s forwards;display:flex;flex-direction:row;gap:.5rem;margin:auto 0 .5rem;width:100%}@keyframes Chat-modules_floatup__aU0gp{0%{opacity:0;transform:translateY(.875rem)}to{opacity:1;transform:translateY(0)}}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_bot_indicator__5-WNz{align-items:center;background:var(--color-gradients-003,linear-gradient(135deg,#07f 0,#9024f6 100%));border-radius:.5rem .5rem 0 .5rem;display:flex;height:2.75rem;justify-content:center;padding:.625rem .5625rem;width:2.75rem}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_bot_indicator__5-WNz p{padding:0}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_message_chatbot__X-4XW{display:flex;flex-direction:column;gap:.5rem;width:100%}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_text_message__suuTz{align-items:flex-start;background:var(--color-neutral-basics-white,#fff);border:1px solid var(--color-neutral-clear-shades-200,#e1e1e2);border-radius:0 .5rem .5rem .5rem;display:flex;flex-direction:column;gap:.5rem;max-width:100%;padding:1rem;position:relative;white-space:break-spaces;width:-moz-fit-content;width:fit-content}.Chat-modules_no_scrollbar__Ia2bX{-ms-overflow-style:none;scrollbar-width:none}.Chat-modules_no_scrollbar__Ia2bX::-webkit-scrollbar{display:none}";
7957
- var styles$b = {"chatContainer":"Chat-modules_chatContainer__xzg50","scrolling_content":"Chat-modules_scrolling_content__urvdP","tasks_container":"Chat-modules_tasks_container__Mg9Oh","message_chatbot":"Chat-modules_message_chatbot__X-4XW","user_message_container":"Chat-modules_user_message_container__-ocjf","floatup":"Chat-modules_floatup__aU0gp","message":"Chat-modules_message__6y4CT","user_text_message":"Chat-modules_user_text_message__T2wQS","user_text_message_username":"Chat-modules_user_text_message_username__CpwdY","user_indicator":"Chat-modules_user_indicator__p0Ehc","message_container_chatbot":"Chat-modules_message_container_chatbot__s2mU6","bot_indicator":"Chat-modules_bot_indicator__5-WNz","text_message":"Chat-modules_text_message__suuTz","no_scrollbar":"Chat-modules_no_scrollbar__Ia2bX"};
7956
+ var css_248z$b = ".Chat-modules_chatContainer__xzg50{align-items:flex-start;background:#fff;border-radius:.5rem;display:flex;flex-direction:column;gap:.5rem;height:100%;min-width:25rem;padding:1rem}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP{display:flex;flex-direction:column;gap:1rem;max-width:100%;width:100%}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh{display:flex;flex-direction:column;gap:1rem;max-height:70%;overflow-x:hidden;overflow-y:scroll}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_message_container__-ocjf{animation:Chat-modules_floatup__aU0gp .5s forwards;display:flex;flex-direction:row;gap:.5rem;justify-content:flex-end;margin:2rem 0;width:100%}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_message_container__-ocjf .Chat-modules_message__6y4CT p{margin-left:auto}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_text_message__T2wQS{align-items:flex-end;background:var(--color-primary-100,#e5f1ff);border:1px solid var(--color-primary-200,#99c9ff);border-radius:.5rem 0 .5rem .5rem;display:flex;flex-direction:column;gap:.5rem;margin-left:auto;max-width:100%;padding:1rem;white-space:break-spaces;width:-moz-fit-content;width:fit-content}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_text_message__T2wQS .Chat-modules_user_text__Mi5Mo{color:var(--Color-Neutral-Dark-Shades-950,#26292e);font-family:OpenSans;font-size:.875rem;font-style:normal;font-weight:400;line-height:1.225rem;margin:0}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_text_message__T2wQS .Chat-modules_blue__JjGi-{color:#004799}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_text_message_username__CpwdY{display:flex;margin-left:auto;width:-moz-fit-content;width:fit-content}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_indicator__p0Ehc{align-items:center;background:var(--color-gradients-003,linear-gradient(135deg,#07f 0,#9024f6 100%));border-radius:.5rem .5rem .5rem 0;display:flex;height:1.75rem;justify-content:center;padding:.625rem .5625rem;width:2rem}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_user_indicator__p0Ehc p{padding:0}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_message_container_chatbot__s2mU6{animation:Chat-modules_floatup__aU0gp .5s forwards;display:flex;flex-direction:row;gap:.5rem;margin:auto 0 .5rem;width:100%}@keyframes Chat-modules_floatup__aU0gp{0%{opacity:0;transform:translateY(.875rem)}to{opacity:1;transform:translateY(0)}}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_bot_indicator__5-WNz{align-items:center;background:var(--color-gradients-003,linear-gradient(135deg,#07f 0,#9024f6 100%));border-radius:.5rem .5rem 0 .5rem;display:flex;height:1.75rem;justify-content:center;padding:.625rem .5625rem;width:2rem}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_bot_indicator__5-WNz p{padding:0}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_message_chatbot__X-4XW{display:flex;flex-direction:column;gap:.25rem;width:100%}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_message_chatbot__X-4XW .Chat-modules_user_text__Mi5Mo{color:var(--Color-Neutral-Dark-Shades-950,#26292e);font-family:OpenSans;font-size:.875rem;font-style:normal;font-weight:400;line-height:1.225rem;margin:0}.Chat-modules_chatContainer__xzg50 .Chat-modules_scrolling_content__urvdP .Chat-modules_tasks_container__Mg9Oh .Chat-modules_text_message__suuTz{align-items:flex-start;background:var(--color-neutral-basics-white,#fff);border:1px solid var(--color-neutral-clear-shades-200,#e1e1e2);border-radius:0 .5rem .5rem .5rem;display:flex;flex-direction:column;gap:.5rem;max-width:100%;padding:1rem;position:relative;white-space:break-spaces;width:-moz-fit-content;width:fit-content}.Chat-modules_no_scrollbar__Ia2bX{-ms-overflow-style:none;scrollbar-width:none}.Chat-modules_no_scrollbar__Ia2bX::-webkit-scrollbar{display:none}";
7957
+ var styles$b = {"chatContainer":"Chat-modules_chatContainer__xzg50","scrolling_content":"Chat-modules_scrolling_content__urvdP","tasks_container":"Chat-modules_tasks_container__Mg9Oh","message_chatbot":"Chat-modules_message_chatbot__X-4XW","user_message_container":"Chat-modules_user_message_container__-ocjf","floatup":"Chat-modules_floatup__aU0gp","message":"Chat-modules_message__6y4CT","user_text_message":"Chat-modules_user_text_message__T2wQS","user_text":"Chat-modules_user_text__Mi5Mo","blue":"Chat-modules_blue__JjGi-","user_text_message_username":"Chat-modules_user_text_message_username__CpwdY","user_indicator":"Chat-modules_user_indicator__p0Ehc","message_container_chatbot":"Chat-modules_message_container_chatbot__s2mU6","bot_indicator":"Chat-modules_bot_indicator__5-WNz","text_message":"Chat-modules_text_message__suuTz","no_scrollbar":"Chat-modules_no_scrollbar__Ia2bX"};
7958
7958
  styleInject(css_248z$b);
7959
7959
 
7960
7960
  const Chat = ({
@@ -7980,6 +7980,25 @@ const Chat = ({
7980
7980
  messages,
7981
7981
  ...props
7982
7982
  }) => {
7983
+ const detectAndWrapLinks = text => {
7984
+ // Expression régulière pour détecter les URLs
7985
+ const urlRegex = /(?:https?:\/\/|www\.)[^\s]+/g;
7986
+ return text.split(urlRegex).map((part, index) => {
7987
+ if (index % 2 === 1) {
7988
+ // If the index is odd, it's a URL, wrap it in a <a> tag
7989
+ const url = part.startsWith('www.') ? `http://${part}` : part;
7990
+ return /*#__PURE__*/React__default.createElement("a", {
7991
+ key: index,
7992
+ href: url,
7993
+ target: "_blank",
7994
+ rel: "noopener noreferrer"
7995
+ }, part);
7996
+ } else {
7997
+ // Otherwise, simply display the text
7998
+ return part;
7999
+ }
8000
+ });
8001
+ };
7983
8002
  return /*#__PURE__*/React__default.createElement(Grid, Object.assign({
7984
8003
  container: true,
7985
8004
  item: true,
@@ -8019,72 +8038,69 @@ const Chat = ({
8019
8038
  sendTask: sendTask,
8020
8039
  isDone: isCompletedTask
8021
8040
  });
8022
- }) : messages.map(message => {
8023
- if (message.from.identify === 'interviewer' && isInterviewer) return /*#__PURE__*/React__default.createElement("div", {
8024
- className: styles$b.user_message_container
8025
- }, /*#__PURE__*/React__default.createElement("div", {
8026
- className: styles$b.message_chatbot
8027
- }, /*#__PURE__*/React__default.createElement("div", {
8028
- className: styles$b.user_text_message
8029
- }, /*#__PURE__*/React__default.createElement(Text, {
8030
- text: message.answer,
8031
- size: "sm",
8032
- color: "#004799"
8033
- })), /*#__PURE__*/React__default.createElement(Text, {
8034
- text: message.createdAt.toLocaleTimeString(),
8035
- size: "xs",
8036
- color: "grey",
8037
- className: styles$b.user_text_message_username
8038
- })), /*#__PURE__*/React__default.createElement("div", {
8039
- className: styles$b.user_indicator
8040
- }, /*#__PURE__*/React__default.createElement(Title, {
8041
- text: `${message.from.name.split(' ').map(n => n[0]).join('')}`,
8042
- weight: "bold",
8043
- color: "white",
8044
- size: "sm"
8045
- })));else if (message.from.identify === 'interviewee' && !isInterviewer) return /*#__PURE__*/React__default.createElement("div", {
8046
- className: styles$b.user_message_container
8047
- }, /*#__PURE__*/React__default.createElement("div", {
8048
- className: styles$b.message_chatbot
8049
- }, /*#__PURE__*/React__default.createElement("div", {
8050
- className: styles$b.user_text_message
8051
- }, /*#__PURE__*/React__default.createElement(Text, {
8052
- text: message.answer,
8053
- size: "sm",
8054
- color: "#004799"
8055
- })), /*#__PURE__*/React__default.createElement(Text, {
8056
- text: message.createdAt.toLocaleTimeString(),
8057
- size: "xs",
8058
- color: "grey",
8059
- className: styles$b.user_text_message_username
8060
- }), /*#__PURE__*/React__default.createElement("div", {
8061
- className: styles$b.user_indicator
8062
- }, /*#__PURE__*/React__default.createElement(Title, {
8063
- text: `${message.from.name.split(' ').map(n => n[0]).join('')}`,
8064
- weight: "bold",
8065
- color: "white",
8066
- size: "sm"
8067
- }))));else return /*#__PURE__*/React__default.createElement("div", {
8068
- className: styles$b.message_container_chatbot
8069
- }, /*#__PURE__*/React__default.createElement("div", {
8070
- className: styles$b.bot_indicator
8071
- }, /*#__PURE__*/React__default.createElement(Title, {
8072
- text: `${message.from.name.split(' ').map(n => n[0]).join('')}`,
8073
- weight: "bold",
8074
- color: "white",
8075
- size: "sm"
8076
- })), /*#__PURE__*/React__default.createElement("div", {
8077
- className: styles$b.message_chatbot
8078
- }, /*#__PURE__*/React__default.createElement("div", {
8079
- className: styles$b.text_message
8080
- }, /*#__PURE__*/React__default.createElement(Text, {
8081
- text: message.answer,
8082
- size: "sm"
8083
- })), /*#__PURE__*/React__default.createElement(Text, {
8084
- text: message.createdAt.toLocaleTimeString(),
8085
- size: "xs",
8086
- color: "grey"
8087
- })));
8041
+ }) : messages && messages.map(message => {
8042
+ if (message) {
8043
+ if (message.from && message.from.identify === 'interviewer' && isInterviewer) return /*#__PURE__*/React__default.createElement("div", {
8044
+ className: styles$b.user_message_container
8045
+ }, /*#__PURE__*/React__default.createElement("div", {
8046
+ className: styles$b.message_chatbot
8047
+ }, /*#__PURE__*/React__default.createElement("div", {
8048
+ className: styles$b.user_text_message
8049
+ }, /*#__PURE__*/React__default.createElement("p", {
8050
+ className: styles$b.user_text
8051
+ }, detectAndWrapLinks(message.body))), /*#__PURE__*/React__default.createElement(Text, {
8052
+ text: message.createdAt.toLocaleTimeString(),
8053
+ size: "xs",
8054
+ color: "grey",
8055
+ className: styles$b.user_text_message_username
8056
+ })), /*#__PURE__*/React__default.createElement("div", {
8057
+ className: styles$b.user_indicator
8058
+ }, /*#__PURE__*/React__default.createElement(Title, {
8059
+ text: `${message.from.name.split(' ').map(n => n[0]).join('')}`,
8060
+ weight: "bold",
8061
+ color: "white",
8062
+ size: "sm"
8063
+ })));else if (message.from && message.from.identify === 'interviewee' && !isInterviewer) return /*#__PURE__*/React__default.createElement("div", {
8064
+ className: styles$b.user_message_container
8065
+ }, /*#__PURE__*/React__default.createElement("div", {
8066
+ className: styles$b.message_chatbot
8067
+ }, /*#__PURE__*/React__default.createElement("div", {
8068
+ className: styles$b.user_text_message
8069
+ }, /*#__PURE__*/React__default.createElement("p", {
8070
+ className: styles$b.user_text
8071
+ }, detectAndWrapLinks(message.body))), /*#__PURE__*/React__default.createElement(Text, {
8072
+ text: message.createdAt.toLocaleTimeString(),
8073
+ size: "xs",
8074
+ color: "grey",
8075
+ className: styles$b.user_text_message_username
8076
+ }), /*#__PURE__*/React__default.createElement("div", {
8077
+ className: styles$b.user_indicator
8078
+ }, /*#__PURE__*/React__default.createElement(Title, {
8079
+ text: `${message.from.name.split(' ').map(n => n[0]).join('')}`,
8080
+ weight: "bold",
8081
+ color: "white",
8082
+ size: "sm"
8083
+ }))));else return /*#__PURE__*/React__default.createElement("div", {
8084
+ className: styles$b.message_container_chatbot
8085
+ }, /*#__PURE__*/React__default.createElement("div", {
8086
+ className: styles$b.bot_indicator
8087
+ }, /*#__PURE__*/React__default.createElement(Title, {
8088
+ text: `${message.from.name.split(' ').map(n => n[0]).join('')}`,
8089
+ weight: "bold",
8090
+ color: "white",
8091
+ size: "sm"
8092
+ })), /*#__PURE__*/React__default.createElement("div", {
8093
+ className: styles$b.message_chatbot
8094
+ }, /*#__PURE__*/React__default.createElement("div", {
8095
+ className: styles$b.text_message
8096
+ }, /*#__PURE__*/React__default.createElement("p", {
8097
+ className: styles$b.user_text
8098
+ }, detectAndWrapLinks(message.body))), /*#__PURE__*/React__default.createElement(Text, {
8099
+ text: message.createdAt.toLocaleTimeString(),
8100
+ size: "xs",
8101
+ color: "grey"
8102
+ })));
8103
+ } else return null;
8088
8104
  }))), !isTaskMode && chatInputPlaceholder && typeof chatInputValue === 'string' && chatInputonChange && /*#__PURE__*/React__default.createElement(ChatInput, {
8089
8105
  placeholder: chatInputPlaceholder,
8090
8106
  value: chatInputValue,