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