@bikdotai/bik-component-library 0.0.646-beta.5 → 0.0.646-beta.7
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.
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js +1 -1
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.d.ts +1 -0
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js +1 -1
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.d.ts +1 -0
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
- package/package.json +1 -1
package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../constants/Theme.js"),i=require("../button/Button.js"),n=require("../modals/styledModal.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../constants/Theme.js"),i=require("../button/Button.js"),n=require("../modals/styledModal.js"),l=require("../shimmer/ShimmerComponent/BikShimmer.js"),a=require("../TypographyStyle.js"),r=require("./UnsatisfactoryCountIntentWiseModal.style.js");exports.UnsatisfactoryCountIntentWiseModal=c=>{const{storeId:o,setShowUnsatisfactoryResponseModal:d,showUnsatisfactoryResponseModal:j,ChecklistType:h,UnsatisfactoryResponseIntentList:m,viewIntentWiseUnsatisfactoryResponse:b,IntentHeaderTitle:x,fetchUnsatisfactoryResponseCountIntentWise:y}=c,[g,p]=s.useState(),[O,u]=s.useState(!1);return s.useEffect((()=>{o&&(u(!0),console.log("KB storeId",o),y().then((e=>{console.log("KB response",e),p(e),u(!1)})))}),[o]),e.jsx(n.StyledModal,Object.assign({onClose:()=>d(!1),open:j,headingTitle:"Improve unsatisfactory response"},{children:e.jsxs(r.ModalBody,{children:[e.jsx("div",{children:e.jsx(a.BodyPrimary,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Intent wise distribution of unsatisfactory response"}))}),e.jsxs("div",Object.assign({className:"modal-table"},{children:[e.jsxs("div",Object.assign({className:"table-row header"},{children:[e.jsx("div",Object.assign({className:"table-cell"},{children:e.jsx(a.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Intent"}))})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Unsatisfactory response"}))})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Action"}))}))]})),O&&[0,1,2,3,4,5,6].map((s=>e.jsxs("div",Object.assign({className:"table-row"},{children:[e.jsx("div",Object.assign({className:"table-cell"},{children:e.jsx(l.BikShimmer,{boxes:[{width:"196px",height:"20px"}]})})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(l.BikShimmer,{boxes:[{width:"176px",height:"20px"}]})})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(l.BikShimmer,{boxes:[{width:"56px",height:"20px"}]})}))]}),s))),!O&&m.map((s=>e.jsxs("div",Object.assign({className:"table-row"},{children:[e.jsx("div",Object.assign({className:"table-cell"},{children:e.jsx(a.BodySecondary,Object.assign({style:{color:t.COLORS.content.primary}},{children:x[s]}))})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.BodySecondary,Object.assign({style:{color:t.COLORS.content.primary}},{children:(null==g?void 0:g[s])||"--"}))})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(i.Button,{buttonText:"Fix",buttonType:"tertiary",size:"small",onClick:()=>b(s),disabled:!(null==g?void 0:g[s])})}))]}),s)))]}))]})}))};
|
|
@@ -10,5 +10,6 @@ export interface UnsatisfactoryResponseListProps {
|
|
|
10
10
|
fetchUnsatisfactoryResponseCountIntentWise: () => Promise<{
|
|
11
11
|
[keys in string]?: number;
|
|
12
12
|
}>;
|
|
13
|
+
fetchUnsatisfactoryResponseCount: () => Promise<number>;
|
|
13
14
|
}
|
|
14
15
|
export declare const UnsatisfactoryResponseList: React.FC<UnsatisfactoryResponseListProps>;
|
|
@@ -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"),
|
|
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)))}))]})};
|
package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as t,useEffect as n}from"react";import{COLORS as i}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{StyledModal as a}from"../modals/styledModal.js";import{BikShimmer as c}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyPrimary as o,TitleSmall as r,BodySecondary as d}from"../TypographyStyle.js";import{ModalBody as m}from"./UnsatisfactoryCountIntentWiseModal.style.js";const h=h=>{const{storeId:b,setShowUnsatisfactoryResponseModal:p,showUnsatisfactoryResponseModal:g,ChecklistType:y,UnsatisfactoryResponseIntentList:j,viewIntentWiseUnsatisfactoryResponse:O,IntentHeaderTitle:f,fetchUnsatisfactoryResponseCountIntentWise:v}=h,[u,x]=t(),[N,w]=t(!1);return n((()=>{b&&(w(!0),console.log("KB storeId",b),v().then((e=>{console.log("KB response",e),x(e),w(!1)})))}),[b]),e(a,Object.assign({onClose:()=>p(!1),open:g,headingTitle:"Improve unsatisfactory response"},{children:s(m,{children:[e("div",{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Intent wise distribution of unsatisfactory response"}))}),s("div",Object.assign({className:"modal-table"},{children:[s("div",Object.assign({className:"table-row header"},{children:[e("div",Object.assign({className:"table-cell"},{children:e(r,Object.assign({style:{color:i.content.primary}},{children:"Intent"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(r,Object.assign({style:{color:i.content.primary}},{children:"Unsatisfactory response"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(r,Object.assign({style:{color:i.content.primary}},{children:"Action"}))}))]})),N&&[0,1,2,3,4,5,6].map((t=>s("div",Object.assign({className:"table-row"},{children:[e("div",Object.assign({className:"table-cell"},{children:e(c,{boxes:[{width:"196px",height:"20px"}]})})),e("div",Object.assign({className:"table-cell center-align"},{children:e(c,{boxes:[{width:"176px",height:"20px"}]})})),e("div",Object.assign({className:"table-cell center-align"},{children:e(c,{boxes:[{width:"56px",height:"20px"}]})}))]}),t))),!N&&j.map((t=>s("div",Object.assign({className:"table-row"},{children:[e("div",Object.assign({className:"table-cell"},{children:e(d,Object.assign({style:{color:i.content.primary}},{children:f[t]}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(d,Object.assign({style:{color:i.content.primary}},{children:(null==u?void 0:u[t])||"--"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(l,{buttonText:"Fix",buttonType:"tertiary",size:"small",onClick:()=>O(t),disabled:!(null==u?void 0:u[t])})}))]}),t)))]}))]})}))};export{h as UnsatisfactoryCountIntentWiseModal};
|
|
@@ -10,5 +10,6 @@ export interface UnsatisfactoryResponseListProps {
|
|
|
10
10
|
fetchUnsatisfactoryResponseCountIntentWise: () => Promise<{
|
|
11
11
|
[keys in string]?: number;
|
|
12
12
|
}>;
|
|
13
|
+
fetchUnsatisfactoryResponseCount: () => Promise<number>;
|
|
13
14
|
}
|
|
14
15
|
export declare const UnsatisfactoryResponseList: React.FC<UnsatisfactoryResponseListProps>;
|
|
@@ -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}from"react";import{COLORS as
|
|
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};
|