@bikdotai/bik-component-library 0.0.742-beta.18 → 0.0.742-beta.20

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../../../constants/Theme.js"),t=require("../../../hooks/useWindowSize.js"),s=require("../GiftedChat/types.js"),a=require("../GiftedChat/utils.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const r=l=>{var r,o,d,u;const{currentMessage:c,position:v,renderMessageText:g,renderTicks:f,renderTime:m,renderCustomView:b,isCustomViewBottom:h,isUnsatisfactoryMessageFn:y,messagesGroupedByAiTraceId:j,onPress:C,bubbleStyles:O,appType:S}=l,p=t.useWindowSize(),x=c,A=i.useMemo((()=>x.category===a.Constants.ChatActivity.Category.ACTIVITY&&x.activityType===a.Constants.ChatActivity.Type.PRIVATE_NOTE),[x.category,x.activityType]),T=i.useMemo((()=>{const[e,i]=a.isStringifiedArray(null==x?void 0:x.message);return e&&i&&Array.isArray(i)}),[null==x?void 0:x.message]),M=i.useMemo((()=>{var e,i,t;const a={borderRadius:8,minHeight:20,margin:0,flexGrow:p?1:0},l=(null==x?void 0:x.channelId)===s.MESSAGE_CHANNELS.GMAIL||(null==x?void 0:x.channelName)===s.MESSAGE_CHANNELS.GMAIL,r=(null==x?void 0:x.channelId)===s.MESSAGE_CHANNELS.SMTP||(null==x?void 0:x.channelName)===s.MESSAGE_CHANNELS.SMTP;let o={};if("left"===v)o="manifest"===S?O.left:Object.assign(Object.assign({},p||l||r?{maxWidth:"100%"}:{}),A?{background:(null===(e=null==x?void 0:x.meta)||void 0===e?void 0:e.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":n.COLORS.background.warning.light}:{backgroundColor:(null==x?void 0:x.isPrivateMail)?n.COLORS.background.blue.light:n.COLORS.surface.hovered});else if("right"===v)if("manifest"===S)o=O.right;else{const e=y&&y({aiTraceId:null===(i=x.eventProperties)||void 0===i?void 0:i.aiTraceId,messagesGroupedByAiTraceId:j});o=Object.assign(Object.assign({backgroundColor:"failed"===x.status||e?n.COLORS.background.negative.light:n.COLORS.background.brandVeryLight},A?{background:(null===(t=null==x?void 0:x.meta)||void 0===t?void 0:t.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":n.COLORS.background.warning.light}:{}),!p&&T?{maxWidth:500}:{})}return"manifest"===S?Object.assign({},o):Object.assign(Object.assign({},a),o)}),[null==x?void 0:x.channelId,null==x?void 0:x.channelName,null===(r=null==x?void 0:x.meta)||void 0===r?void 0:r.aiUsed,null==x?void 0:x.status,null===(o=null==x?void 0:x.eventProperties)||void 0===o?void 0:o.aiTraceId,v,p,A,T,y,j,null==x?void 0:x.isPrivateMail]),I=i.useCallback((()=>e.jsxs("div",{children:[!h&&(null==b?void 0:b(l)),null==g?void 0:g(l),h&&(null==b?void 0:b(l))]})),[h,b,g,l]);return e.jsx("div",Object.assign({style:Object.assign({display:"flex",marginTop:"manifest"===S?0:6,marginBottom:"manifest"===S?0:(null===(u=null===(d=null==c?void 0:c.messageInformation)||void 0===d?void 0:d.reactions)||void 0===u?void 0:u.length)>0?24:6,flexGrow:p?1:0},"manifest"===S?{cursor:"pointer",width:"100%",justifyContent:"flex-end"}:{})},"manifest"===S?{onClick:C}:{},{children:e.jsx("div",Object.assign({style:M},{children:e.jsxs("div",{children:[e.jsx("div",Object.assign({id:c.chatActivityId||`message-${c.psqlId}`},{children:I()})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"32px"}},{children:[null==m?void 0:m(l),null==f?void 0:f(c)]}))]})}))}))},o=l(i).default.memo(r);exports.Bubble=o,exports.default=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../../../constants/Theme.js"),t=require("../../../hooks/useWindowSize.js"),s=require("../GiftedChat/types.js"),a=require("../GiftedChat/utils.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const r=l=>{var r,o,d,u;const{currentMessage:c,position:g,renderMessageText:v,renderTicks:f,renderTime:m,renderCustomView:b,isCustomViewBottom:h,isUnsatisfactoryMessageFn:y,messagesGroupedByAiTraceId:j,onPress:O,containerStyle:C,bubbleStyles:S,appType:p}=l,x=t.useWindowSize(),A=c,T=i.useMemo((()=>A.category===a.Constants.ChatActivity.Category.ACTIVITY&&A.activityType===a.Constants.ChatActivity.Type.PRIVATE_NOTE),[A.category,A.activityType]),I=i.useMemo((()=>{const[e,i]=a.isStringifiedArray(null==A?void 0:A.message);return e&&i&&Array.isArray(i)}),[null==A?void 0:A.message]),M=i.useMemo((()=>{var e,i,t;const a={borderRadius:8,minHeight:20,margin:0,flexGrow:x?1:0},l=(null==A?void 0:A.channelId)===s.MESSAGE_CHANNELS.GMAIL||(null==A?void 0:A.channelName)===s.MESSAGE_CHANNELS.GMAIL,r=(null==A?void 0:A.channelId)===s.MESSAGE_CHANNELS.SMTP||(null==A?void 0:A.channelName)===s.MESSAGE_CHANNELS.SMTP;let o={};if("left"===g)o="manifest"===p?S.left:Object.assign(Object.assign({},x||l||r?{maxWidth:"100%"}:{}),T?{background:(null===(e=null==A?void 0:A.meta)||void 0===e?void 0:e.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":n.COLORS.background.warning.light}:{backgroundColor:(null==A?void 0:A.isPrivateMail)?n.COLORS.background.blue.light:n.COLORS.surface.hovered});else if("right"===g)if("manifest"===p)o=S.right;else{const e=y&&y({aiTraceId:null===(i=A.eventProperties)||void 0===i?void 0:i.aiTraceId,messagesGroupedByAiTraceId:j});o=Object.assign(Object.assign({backgroundColor:"failed"===A.status||e?n.COLORS.background.negative.light:n.COLORS.background.brandVeryLight},T?{background:(null===(t=null==A?void 0:A.meta)||void 0===t?void 0:t.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":n.COLORS.background.warning.light}:{}),!x&&I?{maxWidth:500}:{})}return"manifest"===p?Object.assign({},o):Object.assign(Object.assign({},a),o)}),[null==A?void 0:A.channelId,null==A?void 0:A.channelName,null===(r=null==A?void 0:A.meta)||void 0===r?void 0:r.aiUsed,null==A?void 0:A.status,null===(o=null==A?void 0:A.eventProperties)||void 0===o?void 0:o.aiTraceId,g,x,T,I,y,j,null==A?void 0:A.isPrivateMail]),E=i.useCallback((()=>e.jsxs("div",{children:[!h&&(null==b?void 0:b(l)),null==v?void 0:v(l),h&&(null==b?void 0:b(l))]})),[h,b,v,l]);return e.jsx("div",Object.assign({style:Object.assign(Object.assign(Object.assign({display:"flex",marginTop:"manifest"===p?0:6,marginBottom:"manifest"===p?0:(null===(u=null===(d=null==c?void 0:c.messageInformation)||void 0===d?void 0:d.reactions)||void 0===u?void 0:u.length)>0?24:6,flexGrow:x?1:0},"manifest"===p?Object.assign({alignItems:"flex-end"},"right"===g?{cursor:"pointer"}:{}):{}),"manifest"===p&&"left"===g&&(null==C?void 0:C.left)?C.left:{}),"manifest"===p&&"right"===g&&(null==C?void 0:C.right)?C.right:{})},"manifest"===p?{onClick:O}:{},{children:e.jsx("div",Object.assign({style:M},{children:e.jsxs("div",{children:[e.jsx("div",Object.assign({id:c.chatActivityId||`message-${c.psqlId}`},{children:E()})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"32px"}},{children:[null==m?void 0:m(l),null==f?void 0:f(c)]}))]})}))}))},o=l(i).default.memo(r);exports.Bubble=o,exports.default=o;
@@ -22,6 +22,7 @@ export interface BubbleProps<TMessage extends IMessage = IMessage> {
22
22
  messagesGroupedByAiTraceId?: any;
23
23
  }) => boolean;
24
24
  messagesGroupedByAiTraceId?: any;
25
+ containerStyle?: any;
25
26
  bubbleStyles?: any;
26
27
  appType?: string;
27
28
  }
@@ -14,11 +14,11 @@
14
14
  height: 100%; //calc(100% - 92px);
15
15
  overflow-y: scroll;
16
16
  padding-right: 8px;
17
- &::-webkit-scrollbar-thumb {
17
+ & div::-webkit-scrollbar-thumb {
18
18
  background: #888;
19
19
  border-radius: 8px;
20
20
  }
21
- &::-webkit-scrollbar {
21
+ & div::-webkit-scrollbar {
22
22
  width: 6px;
23
23
  display: block;
24
24
  }
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import n,{useMemo as t,useCallback as a}from"react";import{COLORS as s}from"../../../constants/Theme.js";import{useWindowSize as l}from"../../../hooks/useWindowSize.js";import{MESSAGE_CHANNELS as o}from"../GiftedChat/types.js";import{Constants as r,isStringifiedArray as d}from"../GiftedChat/utils.js";const c=n=>{var c,u,v,g;const{currentMessage:m,position:f,renderMessageText:h,renderTicks:b,renderTime:y,renderCustomView:p,isCustomViewBottom:T,isUnsatisfactoryMessageFn:j,messagesGroupedByAiTraceId:I,onPress:x,bubbleStyles:C,appType:O}=n,k=l(),A=m,w=t((()=>A.category===r.ChatActivity.Category.ACTIVITY&&A.activityType===r.ChatActivity.Type.PRIVATE_NOTE),[A.category,A.activityType]),M=t((()=>{const[e,i]=d(null==A?void 0:A.message);return e&&i&&Array.isArray(i)}),[null==A?void 0:A.message]),G=t((()=>{var e,i,n;const t={borderRadius:8,minHeight:20,margin:0,flexGrow:k?1:0},a=(null==A?void 0:A.channelId)===o.GMAIL||(null==A?void 0:A.channelName)===o.GMAIL,l=(null==A?void 0:A.channelId)===o.SMTP||(null==A?void 0:A.channelName)===o.SMTP;let r={};if("left"===f)r="manifest"===O?C.left:Object.assign(Object.assign({},k||a||l?{maxWidth:"100%"}:{}),w?{background:(null===(e=null==A?void 0:A.meta)||void 0===e?void 0:e.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":s.background.warning.light}:{backgroundColor:(null==A?void 0:A.isPrivateMail)?s.background.blue.light:s.surface.hovered});else if("right"===f)if("manifest"===O)r=C.right;else{const e=j&&j({aiTraceId:null===(i=A.eventProperties)||void 0===i?void 0:i.aiTraceId,messagesGroupedByAiTraceId:I});r=Object.assign(Object.assign({backgroundColor:"failed"===A.status||e?s.background.negative.light:s.background.brandVeryLight},w?{background:(null===(n=null==A?void 0:A.meta)||void 0===n?void 0:n.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":s.background.warning.light}:{}),!k&&M?{maxWidth:500}:{})}return"manifest"===O?Object.assign({},r):Object.assign(Object.assign({},t),r)}),[null==A?void 0:A.channelId,null==A?void 0:A.channelName,null===(c=null==A?void 0:A.meta)||void 0===c?void 0:c.aiUsed,null==A?void 0:A.status,null===(u=null==A?void 0:A.eventProperties)||void 0===u?void 0:u.aiTraceId,f,k,w,M,j,I,null==A?void 0:A.isPrivateMail]),P=a((()=>e("div",{children:[!T&&(null==p?void 0:p(n)),null==h?void 0:h(n),T&&(null==p?void 0:p(n))]})),[T,p,h,n]);return i("div",Object.assign({style:Object.assign({display:"flex",marginTop:"manifest"===O?0:6,marginBottom:"manifest"===O?0:(null===(g=null===(v=null==m?void 0:m.messageInformation)||void 0===v?void 0:v.reactions)||void 0===g?void 0:g.length)>0?24:6,flexGrow:k?1:0},"manifest"===O?{cursor:"pointer",width:"100%",justifyContent:"flex-end"}:{})},"manifest"===O?{onClick:x}:{},{children:i("div",Object.assign({style:G},{children:e("div",{children:[i("div",Object.assign({id:m.chatActivityId||`message-${m.psqlId}`},{children:P()})),e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"32px"}},{children:[null==y?void 0:y(n),null==b?void 0:b(m)]}))]})}))}))},u=n.memo(c);export{u as Bubble,u as default};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import n,{useMemo as t,useCallback as a}from"react";import{COLORS as l}from"../../../constants/Theme.js";import{useWindowSize as s}from"../../../hooks/useWindowSize.js";import{MESSAGE_CHANNELS as o}from"../GiftedChat/types.js";import{Constants as r,isStringifiedArray as d}from"../GiftedChat/utils.js";const c=n=>{var c,g,u,v;const{currentMessage:m,position:f,renderMessageText:h,renderTicks:b,renderTime:y,renderCustomView:p,isCustomViewBottom:j,isUnsatisfactoryMessageFn:T,messagesGroupedByAiTraceId:I,onPress:O,containerStyle:x,bubbleStyles:k,appType:C}=n,A=s(),M=m,w=t((()=>M.category===r.ChatActivity.Category.ACTIVITY&&M.activityType===r.ChatActivity.Type.PRIVATE_NOTE),[M.category,M.activityType]),G=t((()=>{const[e,i]=d(null==M?void 0:M.message);return e&&i&&Array.isArray(i)}),[null==M?void 0:M.message]),P=t((()=>{var e,i,n;const t={borderRadius:8,minHeight:20,margin:0,flexGrow:A?1:0},a=(null==M?void 0:M.channelId)===o.GMAIL||(null==M?void 0:M.channelName)===o.GMAIL,s=(null==M?void 0:M.channelId)===o.SMTP||(null==M?void 0:M.channelName)===o.SMTP;let r={};if("left"===f)r="manifest"===C?k.left:Object.assign(Object.assign({},A||a||s?{maxWidth:"100%"}:{}),w?{background:(null===(e=null==M?void 0:M.meta)||void 0===e?void 0:e.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":l.background.warning.light}:{backgroundColor:(null==M?void 0:M.isPrivateMail)?l.background.blue.light:l.surface.hovered});else if("right"===f)if("manifest"===C)r=k.right;else{const e=T&&T({aiTraceId:null===(i=M.eventProperties)||void 0===i?void 0:i.aiTraceId,messagesGroupedByAiTraceId:I});r=Object.assign(Object.assign({backgroundColor:"failed"===M.status||e?l.background.negative.light:l.background.brandVeryLight},w?{background:(null===(n=null==M?void 0:M.meta)||void 0===n?void 0:n.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":l.background.warning.light}:{}),!A&&G?{maxWidth:500}:{})}return"manifest"===C?Object.assign({},r):Object.assign(Object.assign({},t),r)}),[null==M?void 0:M.channelId,null==M?void 0:M.channelName,null===(c=null==M?void 0:M.meta)||void 0===c?void 0:c.aiUsed,null==M?void 0:M.status,null===(g=null==M?void 0:M.eventProperties)||void 0===g?void 0:g.aiTraceId,f,A,w,G,T,I,null==M?void 0:M.isPrivateMail]),S=a((()=>e("div",{children:[!j&&(null==p?void 0:p(n)),null==h?void 0:h(n),j&&(null==p?void 0:p(n))]})),[j,p,h,n]);return i("div",Object.assign({style:Object.assign(Object.assign(Object.assign({display:"flex",marginTop:"manifest"===C?0:6,marginBottom:"manifest"===C?0:(null===(v=null===(u=null==m?void 0:m.messageInformation)||void 0===u?void 0:u.reactions)||void 0===v?void 0:v.length)>0?24:6,flexGrow:A?1:0},"manifest"===C?Object.assign({alignItems:"flex-end"},"right"===f?{cursor:"pointer"}:{}):{}),"manifest"===C&&"left"===f&&(null==x?void 0:x.left)?x.left:{}),"manifest"===C&&"right"===f&&(null==x?void 0:x.right)?x.right:{})},"manifest"===C?{onClick:O}:{},{children:i("div",Object.assign({style:P},{children:e("div",{children:[i("div",Object.assign({id:m.chatActivityId||`message-${m.psqlId}`},{children:S()})),e("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"32px"}},{children:[null==y?void 0:y(n),null==b?void 0:b(m)]}))]})}))}))},g=n.memo(c);export{g as Bubble,g as default};
@@ -22,6 +22,7 @@ export interface BubbleProps<TMessage extends IMessage = IMessage> {
22
22
  messagesGroupedByAiTraceId?: any;
23
23
  }) => boolean;
24
24
  messagesGroupedByAiTraceId?: any;
25
+ containerStyle?: any;
25
26
  bubbleStyles?: any;
26
27
  appType?: string;
27
28
  }
@@ -14,11 +14,11 @@ import o from"styled-components";import{COLORS as r}from"../../constants/Theme.j
14
14
  height: 100%; //calc(100% - 92px);
15
15
  overflow-y: scroll;
16
16
  padding-right: 8px;
17
- &::-webkit-scrollbar-thumb {
17
+ & div::-webkit-scrollbar-thumb {
18
18
  background: #888;
19
19
  border-radius: 8px;
20
20
  }
21
- &::-webkit-scrollbar {
21
+ & div::-webkit-scrollbar {
22
22
  width: 6px;
23
23
  display: block;
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.742-beta.18",
3
+ "version": "0.0.742-beta.20",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",