@bikdotai/bik-component-library 0.0.742-beta.21 → 0.0.742-beta.23
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"),s=require("../../../hooks/useWindowSize.js"),t=require("../GiftedChat/types.js"),l=require("../GiftedChat/utils.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const r=a=>{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,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../../../constants/Theme.js"),s=require("../../../hooks/useWindowSize.js"),t=require("../GiftedChat/types.js"),l=require("../GiftedChat/utils.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const r=a=>{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,messageSource:S,containerStyle:C,bubbleStyles:p,appType:x}=a,A=s.useWindowSize(),T=c,M=i.useMemo((()=>T.category===l.Constants.ChatActivity.Category.ACTIVITY&&T.activityType===l.Constants.ChatActivity.Type.PRIVATE_NOTE),[T.category,T.activityType]),I=i.useMemo((()=>{const[e,i]=l.isStringifiedArray(null==T?void 0:T.message);return e&&i&&Array.isArray(i)}),[null==T?void 0:T.message]),E=i.useMemo((()=>{var e,i,s;console.log("currentMessage",c),console.log("message",T),console.log("bubbleStyles",p);const l={borderRadius:8,minHeight:20,margin:0,flexGrow:A?1:0},a=(null==T?void 0:T.channelId)===t.MESSAGE_CHANNELS.GMAIL||(null==T?void 0:T.channelName)===t.MESSAGE_CHANNELS.GMAIL,r=(null==T?void 0:T.channelId)===t.MESSAGE_CHANNELS.SMTP||(null==T?void 0:T.channelName)===t.MESSAGE_CHANNELS.SMTP;let o={};if("left"===g)o="manifest"===x?p.left:Object.assign(Object.assign({},A||a||r?{maxWidth:"100%"}:{}),M?{background:(null===(e=null==T?void 0:T.meta)||void 0===e?void 0:e.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":n.COLORS.background.warning.light}:{backgroundColor:(null==T?void 0:T.isPrivateMail)?n.COLORS.background.blue.light:n.COLORS.surface.hovered});else if("right"===g)if("manifest"===x)o=p.right;else{const e=y&&y({aiTraceId:null===(i=T.eventProperties)||void 0===i?void 0:i.aiTraceId,messagesGroupedByAiTraceId:j});o=Object.assign(Object.assign({backgroundColor:"failed"===T.status||e?n.COLORS.background.negative.light:n.COLORS.background.brandVeryLight},M?{background:(null===(s=null==T?void 0:T.meta)||void 0===s?void 0:s.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":n.COLORS.background.warning.light}:{}),!A&&I?{maxWidth:500}:{})}return"manifest"===x?Object.assign({},o):Object.assign(Object.assign({},l),o)}),[null==T?void 0:T.channelId,null==T?void 0:T.channelName,null===(r=null==T?void 0:T.meta)||void 0===r?void 0:r.aiUsed,null==T?void 0:T.status,null===(o=null==T?void 0:T.eventProperties)||void 0===o?void 0:o.aiTraceId,g,A,M,I,y,j,null==T?void 0:T.isPrivateMail,S]),L=i.useCallback((()=>e.jsxs("div",{children:[!h&&(null==b?void 0:b(a)),null==v?void 0:v(a),h&&(null==b?void 0:b(a))]})),[h,b,v,a]);return e.jsx("div",Object.assign({style:Object.assign(Object.assign(Object.assign({display:"flex",marginTop:"manifest"===x?0:6,marginBottom:"manifest"===x?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:A?1:0},"manifest"===x?Object.assign({alignItems:"flex-end"},"right"===g?{cursor:"pointer"}:{}):{}),"manifest"===x&&"left"===g&&(null==C?void 0:C.left)?C.left:{}),"manifest"===x&&"right"===g&&(null==C?void 0:C.right)?C.right:{})},"manifest"===x?{onClick:O}:{},{children:e.jsx("div",Object.assign({style:E},{children:e.jsxs("div",{children:[e.jsx("div",Object.assign({id:c.chatActivityId||`message-${c.psqlId}`},{children:L()})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"32px"}},{children:[null==m?void 0:m(a),null==f?void 0:f(c)]}))]})}))}))},o=a(i).default.memo(r);exports.Bubble=o,exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import n,{useMemo as t,useCallback as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import n,{useMemo as t,useCallback as s}from"react";import{COLORS as l}from"../../../constants/Theme.js";import{useWindowSize as a}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,messageSource:x,containerStyle:k,bubbleStyles:C,appType:A}=n,M=a(),w=m,G=t((()=>w.category===r.ChatActivity.Category.ACTIVITY&&w.activityType===r.ChatActivity.Type.PRIVATE_NOTE),[w.category,w.activityType]),P=t((()=>{const[e,i]=d(null==w?void 0:w.message);return e&&i&&Array.isArray(i)}),[null==w?void 0:w.message]),S=t((()=>{var e,i,n;console.log("currentMessage",m),console.log("message",w),console.log("bubbleStyles",C);const t={borderRadius:8,minHeight:20,margin:0,flexGrow:M?1:0},s=(null==w?void 0:w.channelId)===o.GMAIL||(null==w?void 0:w.channelName)===o.GMAIL,a=(null==w?void 0:w.channelId)===o.SMTP||(null==w?void 0:w.channelName)===o.SMTP;let r={};if("left"===f)r="manifest"===A?C.left:Object.assign(Object.assign({},M||s||a?{maxWidth:"100%"}:{}),G?{background:(null===(e=null==w?void 0:w.meta)||void 0===e?void 0:e.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":l.background.warning.light}:{backgroundColor:(null==w?void 0:w.isPrivateMail)?l.background.blue.light:l.surface.hovered});else if("right"===f)if("manifest"===A)r=C.right;else{const e=T&&T({aiTraceId:null===(i=w.eventProperties)||void 0===i?void 0:i.aiTraceId,messagesGroupedByAiTraceId:I});r=Object.assign(Object.assign({backgroundColor:"failed"===w.status||e?l.background.negative.light:l.background.brandVeryLight},G?{background:(null===(n=null==w?void 0:w.meta)||void 0===n?void 0:n.aiUsed)?"linear-gradient(90deg, #ffe6ee 0%, #fff0e7 100%)":l.background.warning.light}:{}),!M&&P?{maxWidth:500}:{})}return"manifest"===A?Object.assign({},r):Object.assign(Object.assign({},t),r)}),[null==w?void 0:w.channelId,null==w?void 0:w.channelName,null===(c=null==w?void 0:w.meta)||void 0===c?void 0:c.aiUsed,null==w?void 0:w.status,null===(g=null==w?void 0:w.eventProperties)||void 0===g?void 0:g.aiTraceId,f,M,G,P,T,I,null==w?void 0:w.isPrivateMail,x]),V=s((()=>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"===A?0:6,marginBottom:"manifest"===A?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:M?1:0},"manifest"===A?Object.assign({alignItems:"flex-end"},"right"===f?{cursor:"pointer"}:{}):{}),"manifest"===A&&"left"===f&&(null==k?void 0:k.left)?k.left:{}),"manifest"===A&&"right"===f&&(null==k?void 0:k.right)?k.right:{})},"manifest"===A?{onClick:O}:{},{children:i("div",Object.assign({style:S},{children:e("div",{children:[i("div",Object.assign({id:m.chatActivityId||`message-${m.psqlId}`},{children:V()})),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};
|