@bikdotai/bik-component-library 0.0.646-beta.11 → 0.0.646-beta.12

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.
@@ -6,6 +6,7 @@ export interface UnsatisfactoryResponseListProps {
6
6
  setShowIncorrectReplies: (show: boolean) => void;
7
7
  ChecklistType: Record<string, string>;
8
8
  IntentHeaderTitle: Record<string, string>;
9
+ IntentWiseUnsatisfactoryResponse: string[];
9
10
  redirectToUnsatisfactoryResponse: (intent: string) => void;
10
11
  fetchUnsatisfactoryResponseCountIntentWise: () => Promise<{
11
12
  [keys in string]?: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/cross.svg.js"),t=require("../../assets/icons/info.svg.js"),n=require("date-fns"),r=require("react"),a=require("../../constants/Theme.js"),i=require("../avatar/Avatar.js"),o=require("../avatar/AvatarHelper.js"),c=require("../button/Button.js"),l=require("../states/StateComponent.js");require("../../_virtual/_tslib.js");var d=require("../TypographyStyle.js"),u=require("./UnsatisfactoryCountIntentWiseModal.js"),y=require("./UnsatisfactoryResponseList.style.js");exports.UnsatisfactoryResponseList=p=>{const{storeId:j,incorrectMessages:h,onIncorrectMessageBubbleClick:f,setShowIncorrectReplies:g,ChecklistType:x,IntentHeaderTitle:v,redirectToUnsatisfactoryResponse:b,fetchUnsatisfactoryResponseCountIntentWise:C,fetchUnsatisfactoryResponseCount:I}=p,[O,R]=r.useState(""),[S,m]=r.useState((null==h?void 0:h.length)>0),[w,U]=r.useState(!1);return r.useEffect((()=>{S||I().then((e=>{e>0&&m(!0),0===e&&g(!1)}))}),[]),e.jsxs(y.IncorrectRepliesStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsx(d.TitleRegular,{children:"Unsatifactory responses"}),e.jsx("div",Object.assign({style:{cursor:"pointer"},onClick:()=>g(!1)},{children:e.jsx(s.default,{height:16,width:16,color:a.COLORS.content.primary})}))]})),e.jsx(d.BodySecondary,Object.assign({style:{color:a.COLORS.content.secondary}},{children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."}))]})),!(null==h?void 0:h.length)&&e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:e.jsx(l.StateComponent,{states:l.StateInterface.WARNING,heading:"No unsatisfactory responses",subline:"As of now, all responses are correct",isButtonEnabled:!1,width:0,size:o.SIZE.SMALL,icon:e.jsx(i.Avatar,{type:o.AVATAR_TYPES.ICON,size:o.SIZE.MEDIUM,background:o.AVATAR_BACKGROUND.LIGHT,icon:()=>e.jsx(t.default,{width:16,height:16,color:a.COLORS.content.warning})})})})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:(null==h?void 0:h.length)?"flex-start":"center"}},{children:e.jsx(c.Button,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{U(!0)},disabled:!S})})),e.jsx(u.UnsatisfactoryCountIntentWiseModal,{storeId:j,setShowUnsatisfactoryResponseModal:U,showUnsatisfactoryResponseModal:w,ChecklistType:x,UnsatisfactoryResponseIntentList:[],IntentHeaderTitle:v,fetchUnsatisfactoryResponseCountIntentWise:C,viewIntentWiseUnsatisfactoryResponse:b}),!!(null==h?void 0:h.length)&&e.jsx("div",Object.assign({className:"wrapper"},{children:h.map(((s,t)=>e.jsxs("div",Object.assign({className:"bubble",onClick:()=>{f(s.messageId),R(s.messageId)},style:O===s.messageId?{backgroundColor:a.COLORS.surface.hovered}:{}},{children:[e.jsx(d.BodySecondary,Object.assign({style:{color:a.COLORS.content.primary}},{children:s.message})),e.jsx("div",{children:e.jsxs(d.Caption,Object.assign({style:{color:a.COLORS.content.secondary}},{children:[n.format(new Date(null==s?void 0:s.date),"hh:mm a")," |"," ",n.format(new Date(null==s?void 0:s.date),"dd/MM/yyyy")]}))})]}),"incorrect-reply-"+t)))}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/cross.svg.js"),t=require("../../assets/icons/info.svg.js"),n=require("date-fns"),r=require("react"),a=require("../../constants/Theme.js"),i=require("../avatar/Avatar.js"),o=require("../avatar/AvatarHelper.js"),c=require("../button/Button.js"),l=require("../states/StateComponent.js");require("../../_virtual/_tslib.js");var d=require("../TypographyStyle.js"),u=require("./UnsatisfactoryCountIntentWiseModal.js"),y=require("./UnsatisfactoryResponseList.style.js");exports.UnsatisfactoryResponseList=p=>{const{storeId:j,incorrectMessages:f,onIncorrectMessageBubbleClick:h,setShowIncorrectReplies:g,ChecklistType:x,IntentWiseUnsatisfactoryResponse:v,IntentHeaderTitle:b,redirectToUnsatisfactoryResponse:C,fetchUnsatisfactoryResponseCountIntentWise:I,fetchUnsatisfactoryResponseCount:O}=p,[R,S]=r.useState(""),[m,U]=r.useState((null==f?void 0:f.length)>0),[w,q]=r.useState(!1);return r.useEffect((()=>{m||O().then((e=>{e>0&&U(!0),0===e&&g(!1)}))}),[]),e.jsxs(y.IncorrectRepliesStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsx(d.TitleRegular,{children:"Unsatifactory responses"}),e.jsx("div",Object.assign({style:{cursor:"pointer"},onClick:()=>g(!1)},{children:e.jsx(s.default,{height:16,width:16,color:a.COLORS.content.primary})}))]})),e.jsx(d.BodySecondary,Object.assign({style:{color:a.COLORS.content.secondary}},{children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."}))]})),!(null==f?void 0:f.length)&&e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:e.jsx(l.StateComponent,{states:l.StateInterface.WARNING,heading:"No unsatisfactory responses",subline:"As of now, all responses are correct",isButtonEnabled:!1,width:0,size:o.SIZE.SMALL,icon:e.jsx(i.Avatar,{type:o.AVATAR_TYPES.ICON,size:o.SIZE.MEDIUM,background:o.AVATAR_BACKGROUND.LIGHT,icon:()=>e.jsx(t.default,{width:16,height:16,color:a.COLORS.content.warning})})})})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:(null==f?void 0:f.length)?"flex-start":"center"}},{children:e.jsx(c.Button,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{q(!0)},disabled:!m})})),e.jsx(u.UnsatisfactoryCountIntentWiseModal,{storeId:j,setShowUnsatisfactoryResponseModal:q,showUnsatisfactoryResponseModal:w,ChecklistType:x,UnsatisfactoryResponseIntentList:v,IntentHeaderTitle:b,fetchUnsatisfactoryResponseCountIntentWise:I,viewIntentWiseUnsatisfactoryResponse:C}),!!(null==f?void 0:f.length)&&e.jsx("div",Object.assign({className:"wrapper"},{children:f.map(((s,t)=>e.jsxs("div",Object.assign({className:"bubble",onClick:()=>{h(s.messageId),S(s.messageId)},style:R===s.messageId?{backgroundColor:a.COLORS.surface.hovered}:{}},{children:[e.jsx(d.BodySecondary,Object.assign({style:{color:a.COLORS.content.primary}},{children:s.message})),e.jsx("div",{children:e.jsxs(d.Caption,Object.assign({style:{color:a.COLORS.content.secondary}},{children:[n.format(new Date(null==s?void 0:s.date),"hh:mm a")," |"," ",n.format(new Date(null==s?void 0:s.date),"dd/MM/yyyy")]}))})]}),"incorrect-reply-"+t)))}))]})};
@@ -6,6 +6,7 @@ export interface UnsatisfactoryResponseListProps {
6
6
  setShowIncorrectReplies: (show: boolean) => void;
7
7
  ChecklistType: Record<string, string>;
8
8
  IntentHeaderTitle: Record<string, string>;
9
+ IntentWiseUnsatisfactoryResponse: string[];
9
10
  redirectToUnsatisfactoryResponse: (intent: string) => void;
10
11
  fetchUnsatisfactoryResponseCountIntentWise: () => Promise<{
11
12
  [keys in string]?: number;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import s from"../../assets/icons/cross.svg.js";import n from"../../assets/icons/info.svg.js";import{format as o}from"date-fns";import{useState as i,useEffect as r}from"react";import{COLORS as a}from"../../constants/Theme.js";import{Avatar as c}from"../avatar/Avatar.js";import{SIZE as l,AVATAR_TYPES as d,AVATAR_BACKGROUND as p}from"../avatar/AvatarHelper.js";import{Button as y}from"../button/Button.js";import{StateComponent as m,StateInterface as f}from"../states/StateComponent.js";import"../../_virtual/_tslib.js";import{TitleRegular as h,BodySecondary as g,Caption as u}from"../TypographyStyle.js";import{UnsatisfactoryCountIntentWiseModal as v}from"./UnsatisfactoryCountIntentWiseModal.js";import{IncorrectRepliesStyle as b}from"./UnsatisfactoryResponseList.style.js";const j=j=>{const{storeId:I,incorrectMessages:C,onIncorrectMessageBubbleClick:w,setShowIncorrectReplies:U,ChecklistType:x,IntentHeaderTitle:O,redirectToUnsatisfactoryResponse:R,fetchUnsatisfactoryResponseCountIntentWise:M,fetchUnsatisfactoryResponseCount:T}=j,[k,N]=i(""),[S,A]=i((null==C?void 0:C.length)>0),[L,W]=i(!1);return r((()=>{S||T().then((e=>{e>0&&A(!0),0===e&&U(!1)}))}),[]),e(b,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[t(h,{children:"Unsatifactory responses"}),t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>U(!1)},{children:t(s,{height:16,width:16,color:a.content.primary})}))]})),t(g,Object.assign({style:{color:a.content.secondary}},{children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."}))]})),!(null==C?void 0:C.length)&&t("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t(m,{states:f.WARNING,heading:"No unsatisfactory responses",subline:"As of now, all responses are correct",isButtonEnabled:!1,width:0,size:l.SMALL,icon:t(c,{type:d.ICON,size:l.MEDIUM,background:p.LIGHT,icon:()=>t(n,{width:16,height:16,color:a.content.warning})})})})),t("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:(null==C?void 0:C.length)?"flex-start":"center"}},{children:t(y,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{W(!0)},disabled:!S})})),t(v,{storeId:I,setShowUnsatisfactoryResponseModal:W,showUnsatisfactoryResponseModal:L,ChecklistType:x,UnsatisfactoryResponseIntentList:[],IntentHeaderTitle:O,fetchUnsatisfactoryResponseCountIntentWise:M,viewIntentWiseUnsatisfactoryResponse:R}),!!(null==C?void 0:C.length)&&t("div",Object.assign({className:"wrapper"},{children:C.map(((s,n)=>e("div",Object.assign({className:"bubble",onClick:()=>{w(s.messageId),N(s.messageId)},style:k===s.messageId?{backgroundColor:a.surface.hovered}:{}},{children:[t(g,Object.assign({style:{color:a.content.primary}},{children:s.message})),t("div",{children:e(u,Object.assign({style:{color:a.content.secondary}},{children:[o(new Date(null==s?void 0:s.date),"hh:mm a")," |"," ",o(new Date(null==s?void 0:s.date),"dd/MM/yyyy")]}))})]}),"incorrect-reply-"+n)))}))]})};export{j as UnsatisfactoryResponseList};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import s from"../../assets/icons/cross.svg.js";import n from"../../assets/icons/info.svg.js";import{format as o}from"date-fns";import{useState as i,useEffect as r}from"react";import{COLORS as a}from"../../constants/Theme.js";import{Avatar as c}from"../avatar/Avatar.js";import{SIZE as l,AVATAR_TYPES as d,AVATAR_BACKGROUND as p}from"../avatar/AvatarHelper.js";import{Button as y}from"../button/Button.js";import{StateComponent as m,StateInterface as f}from"../states/StateComponent.js";import"../../_virtual/_tslib.js";import{TitleRegular as h,BodySecondary as g,Caption as u}from"../TypographyStyle.js";import{UnsatisfactoryCountIntentWiseModal as v}from"./UnsatisfactoryCountIntentWiseModal.js";import{IncorrectRepliesStyle as b}from"./UnsatisfactoryResponseList.style.js";const j=j=>{const{storeId:I,incorrectMessages:C,onIncorrectMessageBubbleClick:w,setShowIncorrectReplies:U,ChecklistType:R,IntentWiseUnsatisfactoryResponse:x,IntentHeaderTitle:O,redirectToUnsatisfactoryResponse:M,fetchUnsatisfactoryResponseCountIntentWise:T,fetchUnsatisfactoryResponseCount:k}=j,[N,S]=i(""),[W,A]=i((null==C?void 0:C.length)>0),[L,D]=i(!1);return r((()=>{W||k().then((e=>{e>0&&A(!0),0===e&&U(!1)}))}),[]),e(b,{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[t(h,{children:"Unsatifactory responses"}),t("div",Object.assign({style:{cursor:"pointer"},onClick:()=>U(!1)},{children:t(s,{height:16,width:16,color:a.content.primary})}))]})),t(g,Object.assign({style:{color:a.content.secondary}},{children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."}))]})),!(null==C?void 0:C.length)&&t("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t(m,{states:f.WARNING,heading:"No unsatisfactory responses",subline:"As of now, all responses are correct",isButtonEnabled:!1,width:0,size:l.SMALL,icon:t(c,{type:d.ICON,size:l.MEDIUM,background:p.LIGHT,icon:()=>t(n,{width:16,height:16,color:a.content.warning})})})})),t("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:(null==C?void 0:C.length)?"flex-start":"center"}},{children:t(y,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{D(!0)},disabled:!W})})),t(v,{storeId:I,setShowUnsatisfactoryResponseModal:D,showUnsatisfactoryResponseModal:L,ChecklistType:R,UnsatisfactoryResponseIntentList:x,IntentHeaderTitle:O,fetchUnsatisfactoryResponseCountIntentWise:T,viewIntentWiseUnsatisfactoryResponse:M}),!!(null==C?void 0:C.length)&&t("div",Object.assign({className:"wrapper"},{children:C.map(((s,n)=>e("div",Object.assign({className:"bubble",onClick:()=>{w(s.messageId),S(s.messageId)},style:N===s.messageId?{backgroundColor:a.surface.hovered}:{}},{children:[t(g,Object.assign({style:{color:a.content.primary}},{children:s.message})),t("div",{children:e(u,Object.assign({style:{color:a.content.secondary}},{children:[o(new Date(null==s?void 0:s.date),"hh:mm a")," |"," ",o(new Date(null==s?void 0:s.date),"dd/MM/yyyy")]}))})]}),"incorrect-reply-"+n)))}))]})};export{j as UnsatisfactoryResponseList};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.646-beta.11",
3
+ "version": "0.0.646-beta.12",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",