@bikdotai/bik-component-library 0.0.654 → 0.0.655-0
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/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/data-source-panel/DataSourcePanel.d.ts +7 -5
- package/dist/cjs/components/data-source-panel/DataSourcePanel.js +1 -1
- package/dist/cjs/components/data-source-panel/model.d.ts +4 -0
- package/dist/cjs/components/data-source-panel/model.js +1 -1
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.d.ts +4 -4
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js +1 -1
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.d.ts +7 -5
- package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/data-source-panel/DataSourcePanel.d.ts +7 -5
- package/dist/esm/components/data-source-panel/DataSourcePanel.js +1 -1
- package/dist/esm/components/data-source-panel/model.d.ts +4 -0
- package/dist/esm/components/data-source-panel/model.js +1 -1
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.d.ts +4 -4
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js +1 -1
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.d.ts +7 -5
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AllSourceInfoDetailsCustomDataModel, CustomDataType, DataSourcePanelZeroState, footerButtonOptionModel, InfoContent, MessageSource } from './model';
|
|
2
|
+
import { AllSourceInfoDetailsCustomDataModel, AppType, CustomDataType, DataSourcePanelZeroState, footerButtonOptionModel, InfoContent, MessageSource } from './model';
|
|
3
3
|
export interface DataSourcePanelProps {
|
|
4
4
|
storeId: string;
|
|
5
|
+
appType: AppType;
|
|
5
6
|
messageSource: MessageSource;
|
|
6
7
|
setMessageSourcePanel: (source?: MessageSource) => void;
|
|
7
8
|
hideCloseButton?: boolean;
|
|
8
9
|
title?: string;
|
|
9
10
|
allSourceInfoDetail: AllSourceInfoDetailsCustomDataModel;
|
|
10
11
|
isSourceInfoFetched?: boolean;
|
|
11
|
-
faqCount: number;
|
|
12
12
|
editableSources: CustomDataType[];
|
|
13
13
|
redirect: (sourceInfo: InfoContent) => void;
|
|
14
|
-
|
|
14
|
+
preFillTrainingSourceCount?: {
|
|
15
15
|
[k in string]: number;
|
|
16
16
|
};
|
|
17
17
|
zeroStateButton: DataSourcePanelZeroState;
|
|
18
18
|
ChecklistType: Record<string, string>;
|
|
19
|
-
IntentComponentMap: Record<string, JSX.Element>;
|
|
20
|
-
ShowTrainingDataSource: Record<string, string>;
|
|
21
19
|
footerButtonOption?: footerButtonOptionModel;
|
|
20
|
+
fetchTrainingSourceCount: (storeId: string) => Promise<{
|
|
21
|
+
[k in string]: number;
|
|
22
|
+
}>;
|
|
23
|
+
fetchProductFAQCount: (storeId: string, productIds?: string[]) => Promise<number>;
|
|
22
24
|
}
|
|
23
25
|
export declare const DataSourcePanel: React.FC<DataSourcePanelProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/boxV2.svg.js"),s=require("../../assets/icons/cross.svg.js"),i=require("../../assets/icons/edit.svg.js"),o=require("../../assets/icons/filePdf.svg.js"),n=require("../../assets/icons/help.svg.js"),a=require("../../assets/icons/info.svg.js"),r=require("../../assets/icons/openai.svg.js"),l=require("../../assets/icons/plus.svg.js"),d=require("../../assets/icons/redirect.svg.js"),c=require("../../assets/icons/text_t9.svg.js"),u=require("../../assets/icons/website.svg.js"),p=require("react"),h=require("../../constants/Theme.js"),g=require("../button/Button.js"),x=require("../icon-button/IconButton.js"),C=require("../shimmer/ShimmerComponent/BikShimmer.js"),y=require("../tag/Tag.js"),j=require("../tooltips/Tooltip.js"),v=require("../TypographyStyle.js"),m=require("./DataSourceInfoFooter.js"),f=require("./DataSourcePanel.style.js"),L=require("./model.js");exports.DataSourcePanel=O=>{var S,T;const{storeId:I,messageSource:b,setMessageSourcePanel:w,hideCloseButton:E,faqCount:D=0,isSourceInfoFetched:q,allSourceInfoDetail:B,ChecklistType:N,IntentComponentMap:k,title:R,zeroStateButton:F,editableSources:_,redirect:A,trainingSourceCount:P,ShowTrainingDataSource:K,footerButtonOption:W}=O,{sources:M}=b,H=["blog","article","page","policy"],[Q,$]=p.useState(!1),[U,X]=p.useState(!1);p.useEffect((()=>{var e,t,s,i;(null==b?void 0:b.messageId)&&($(!0),setTimeout((()=>$(!1)),200),X(!1!==(null===(t=null===(e=b.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(i=null===(s=b.sources)||void 0===s?void 0:s[0])||void 0===i?void 0:i.insights)))}),[null==b?void 0:b.messageId]);const z=e=>!(0!==e.length&&!(null==b?void 0:b.isUnsatisfactoryAnswer)),G=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var s;return"custom"==e?e=L.CustomDataType.FILES:H.includes(e)?e=L.CustomDataType.FETCHED_LINKS:"url"==e?e=L.CustomDataType.WEBSITE_LINKS:"text"===e?e=L.CustomDataType.TEXTS:"faq"===e&&(e=L.CustomDataType.FAQ),t?e:null===(s=null==e?void 0:e.toLowerCase())||void 0===s?void 0:s.replace(/_/g," ")};return Q||!q?e.jsx(f.SourceInfoDetailsStyle,{children:e.jsx(C.BikShimmer,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})}):e.jsx(e.Fragment,{children:e.jsx(f.SourceInfoDetailsStyle,{children:!!(null==M?void 0:M.length)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",paddingBottom:"12px"}},{children:[!!R&&e.jsx(v.TitleSmall,{children:R}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:"Intent"})),null!==(S=k[b.intent])&&void 0!==S?S:k.GENERIC,!E&&e.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>w(void 0)},{children:e.jsx(s.default,{height:20,width:20,color:h.COLORS.content.secondary})}))]})),z(M)?e.jsx("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,s;return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${h.COLORS.background.negative.light}`,borderRadius:"100px"}},{children:e.jsx(a.default,{width:24,height:24,color:h.COLORS.stroke.negative.vibrant})})),e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e.jsx(v.TitleSmall,{children:"Insufficient data"})})),e.jsx(v.BodySecondary,Object.assign({color:h.COLORS.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),F&&e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(g.Button,{LeadingIcon:null!==(t=F.leadingIcon)&&void 0!==t?t:l.default,buttonText:null!==(s=F.title)&&void 0!==s?s:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{F.onClick()}})}))]}))})()})):e.jsx(y.Tag,{LeadingIcon:a.default,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:b.isEditable?"If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in Manifest.":"Edit the original source and save again to update the response"})]})),!z(M)&&e.jsx("div",Object.assign({className:"info-container"},{children:e.jsx("div",Object.assign({style:{padding:"0 8px",maxWidth:"100%"}},{children:M.map(((s,a)=>{var l,p,g,C,y,m,f,O,S,T,I,b,w,E;const D=G(s.type||s.subTitle||"OpenAI"),q=G(s.type||s.subTitle||"OpenAI",!0),k=(R=D)?"faq"==R.toLocaleLowerCase()?"FAQ":"openai"==R.toLocaleLowerCase()?"OPENAI":"files"==R.toLocaleLowerCase()?"PDF":"texts"==R.toLocaleLowerCase()?"Custom text":((R=(R=R.charAt(0).toUpperCase()+R.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(R=R.slice(0,-1)),R.replace("Website","Manual")):"";var R;const F=null==_?void 0:_.includes(q),P="Products"===s.subTitle?B[null!==(l=s.productId)&&void 0!==l?l:"Products"]:B[null!==(p=s.docId)&&void 0!==p?p:""],K=q.toLowerCase()===(null===(g=L.CustomDataType.FAQ)||void 0===g?void 0:g.toLowerCase())?"faq"===(null===(C=s.title)||void 0===C?void 0:C.toLowerCase())?s.subTitle:s.title:q.toLowerCase()===(null===(y=L.CustomDataType.FILES)||void 0===y?void 0:y.toLowerCase())||q.toLowerCase()===(null===(m=L.CustomDataType.FETCHED_LINKS)||void 0===m?void 0:m.toLowerCase())||q.toLowerCase()===(null===(f=L.CustomDataType.TEXTS)||void 0===f?void 0:f.toLowerCase())?s.title:q.toLowerCase()===(null===(O=L.CustomDataType.WEBSITE_LINKS)||void 0===O?void 0:O.toLowerCase())?s.title.split("/")[s.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,s)=>t.toUpperCase()+s)):s.intent===N.EMAIL_COLLECTION?k:s.title,W="faq"===q.toLowerCase()?null===(S=null==P?void 0:P.data)||void 0===S?void 0:S.answer:q.toLowerCase()===(null===(T=L.CustomDataType.FETCHED_LINKS)||void 0===T?void 0:T.toLowerCase())||q.toLowerCase()===(null===(I=L.CustomDataType.WEBSITE_LINKS)||void 0===I?void 0:I.toLowerCase())||q.toLowerCase()===(null===(b=L.CustomDataType.TEXTS)||void 0===b?void 0:b.toLowerCase())?null!==(E=null===(w=null==P?void 0:P.data)||void 0===w?void 0:w.fileContentText)&&void 0!==E?E:"":s.intent===N.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"24px 0px",borderBottom:`1px solid ${h.COLORS.stroke.primary}`}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(j.Tooltip,Object.assign({body:K,placement:"top"},{children:e.jsx(v.BodySecondary,Object.assign({style:q==L.CustomDataType.FETCHED_LINKS||q==L.CustomDataType.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:h.COLORS.content.primary,className:"clamp-title",onClick:()=>q==L.CustomDataType.FETCHED_LINKS||q==L.CustomDataType.WEBSITE_LINKS?A(s):{}},{children:K}))}))})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[s.intent!==N.EMAIL_COLLECTION&&e.jsxs(e.Fragment,{children:[(H=D,"products"==H?e.jsx(t.default,{height:16,width:16,color:h.COLORS.content.secondary}):"files"==H?e.jsx(o.default,{height:16,width:16,color:h.COLORS.content.secondary}):"website links"==H||"fetched links"==H?e.jsx(u.default,{height:16,width:16,color:h.COLORS.content.secondary}):"faq"==H?e.jsx(n.default,{height:16,width:16,color:h.COLORS.content.secondary}):"texts"==H?e.jsx(c.default,{height:16,width:16,color:h.COLORS.content.secondary}):e.jsx(r.default,{height:16,width:16,color:h.COLORS.content.secondary})),e.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.secondary},{children:k}))]}),(s.link||s.docId)&&e.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"4px"}},{children:F?e.jsx(x.IconButton,{Icon:i.default,height:16,width:16,bordered:!0,onClick:()=>null==P?void 0:P.onEditClick(P.data,P.type),disabled:!P,disabledTooltip:"This source is deleted"}):e.jsx(x.IconButton,{Icon:d.default,height:16,width:16,bordered:!0,disabled:"custom"===s.type&&!P,disabledTooltip:"This source is deleted",onClick:()=>A(s)})}))]}))]})),(null!=W?W:"").trim()&&e.jsx("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${h.COLORS.stroke.primary}`,borderRadius:"4px",backgroundColor:h.COLORS.surface.subdued}},{children:e.jsx(v.BodyCaption,Object.assign({color:h.COLORS.content.primary,className:"clamp-description"},{children:(M=null!=W?W:"",M.replace(/(<([^>]+)>)/gi,"")).trim()}))}))]}),`info-${a}`);var M,H}))}))})),U&&!z(M)&&e.jsx("div",Object.assign({className:"footer"},{children:e.jsx(m.default,{storeId:I,messageSource:b,sourceIntent:null!==(T=b.intent)&&void 0!==T?T:N.GENERIC,faqCount:D,trainingSourceCount:P,ShowTrainingDataSource:K,ChecklistType:N,footerButtonOption:W})}))]})})})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/boxV2.svg.js"),i=require("../../assets/icons/cross.svg.js"),o=require("../../assets/icons/edit.svg.js"),s=require("../../assets/icons/filePdf.svg.js"),n=require("../../assets/icons/help.svg.js"),a=require("../../assets/icons/info.svg.js"),r=require("../../assets/icons/openai.svg.js"),l=require("../../assets/icons/plus.svg.js"),d=require("../../assets/icons/redirect.svg.js"),c=require("../../assets/icons/text_t9.svg.js"),u=require("../../assets/icons/website.svg.js"),p=require("react"),y=require("../../constants/Theme.js"),g=require("../button/Button.js"),C=require("../icon-button/IconButton.js"),T=require("../shimmer/ShimmerComponent/BikShimmer.js"),h=require("../tag/Tag.js"),x=require("../tooltips/Tooltip.js"),O=require("../TypographyStyle.js"),S=require("./DataSourceInfoFooter.js"),I=require("./DataSourcePanel.style.js"),v=require("./model.js");exports.DataSourcePanel=E=>{var j,f;const{storeId:m,messageSource:L,setMessageSourcePanel:b,hideCloseButton:N,isSourceInfoFetched:R,allSourceInfoDetail:_,ChecklistType:D,title:A,zeroStateButton:w,editableSources:k,preFillTrainingSourceCount:F,redirect:P,footerButtonOption:q,fetchTrainingSourceCount:U,fetchProductFAQCount:B}=E,{sources:M}=L,H=["blog","article","page","policy"],[K,Q]=p.useState(!1),[G,Y]=p.useState(!1),[W,$]=p.useState(0),[z,X]=p.useState(null!=F?F:{}),V={};[{key:"GENERIC",type:"neutral",tagText:"Generic"},{key:"STORE_INFORMATION",type:"blue",tagText:"Store information"},{key:"SHIPPING_POLICY",type:"positive",tagText:"Shipping policy"},{key:"RETURN_AND_REFUND",type:"purple",tagText:"Returns & refund policy"},{key:"CONTACT_INFO",type:"warning",tagText:"Contact details"},{key:"STORE_LOCATION",type:"grey",tagText:"Store location"},{key:"SALES_AND_OFFERS",type:"purple",tagText:"Offers & rewards"},{key:"PRODUCT_CUSTOMISATION",type:"blue",tagText:"Product customisation"},{key:"PRODUCT_DETAILS",type:"blue",tagText:"Product details"},{key:"PAYMENT_METHODS",type:"positive",tagText:"Payment methods"},{key:"ORDER_TRACKING",type:"warning",tagText:"Order tracking"},{key:"PRODUCT_SEARCH",type:"neutral",tagText:"Product search"},{key:"PURCHASE",type:"blue",tagText:"Purchase"},{key:"CONNECT_TO_AGENT",type:"purple",tagText:"Talk to a person"},{key:"CHECKOUT_ENQUIRY",type:"purple",tagText:"Checkout enquiry"},{key:"ORDER_CANCELLATION",type:"positive",tagText:"Order cancellation"},{key:"ORDER_ENQUIRY",type:"neutral",tagText:"Order enquiry"},{key:"ORDER_MODIFICATION",type:"blue",tagText:"Order modification"},{key:"SUBSCRIPTION_ENQUIRY",type:"warning",tagText:"Subscription enquiry"},{key:"SALES_AND_OFFERS_ISSUES",type:"grey",tagText:"Offer-related enquiries"},{key:"COLLABORATION",type:"positive",tagText:"Collaboration"},{key:"QUIZ_GENERATION",type:"warning",tagText:"Start the quiz"},{key:"SIMILAR_PRODUCT",type:"blue",tagText:"Similar Product"},{key:"EMAIL_COLLECTION",type:"warning",tagText:"Email Collection"},{key:"ADD_TO_CART_SUCCESS",type:"blue",tagText:"Add to Cart Success"},{key:"ADD_TO_CART_SUCCESS_MESSAGE",type:"blue",tagText:"Add to Cart Success Message"},{key:"FEEDBACK",type:"blue",tagText:"Feedback"},{key:"PHONE_NUMBER_COLLECTION",type:"blue",tagText:"Phone no. collection"}].forEach((t=>{let{key:i,type:o,tagText:s}=t;D[i]&&(V[D[i]]=e.jsx(h.Tag,{theme:"light",type:o,tagText:s,cursor:"pointer"}))}));const Z=p.useMemo((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{D[t]&&(e[D[t]]=D[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[]);p.useEffect((()=>{var e,t,i,o;if(!(null==L?void 0:L.messageId))return;Q(!0),Y(!1!==(null===(t=null===(e=L.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(o=null===(i=L.sources)||void 0===i?void 0:i[0])||void 0===o?void 0:o.insights));const s=L.sources.filter((e=>!!e.productId)).map((e=>e.productId)),n=Array.from(new Set(s)).filter((e=>!!e));B(m,n).then((e=>$(e))).then((()=>{F||U(m).then((e=>X(e)))})).finally((()=>setTimeout((()=>Q(!1)),100)))}),[null==L?void 0:L.messageId,L.sources,F,m]);const J=e=>!(0!==e.length&&!(null==L?void 0:L.isUnsatisfactoryAnswer)),ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i;return"custom"==e?e=v.CustomDataType.FILES:H.includes(e)?e=v.CustomDataType.FETCHED_LINKS:"url"==e?e=v.CustomDataType.WEBSITE_LINKS:"text"===e?e=v.CustomDataType.TEXTS:"faq"===e&&(e=v.CustomDataType.FAQ),t?e:null===(i=null==e?void 0:e.toLowerCase())||void 0===i?void 0:i.replace(/_/g," ")};return K||!R?e.jsx(I.SourceInfoDetailsStyle,{children:e.jsx(T.BikShimmer,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})}):e.jsx(e.Fragment,{children:e.jsx(I.SourceInfoDetailsStyle,{children:!!(null==M?void 0:M.length)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",paddingBottom:"12px"}},{children:[!!A&&e.jsx(O.TitleSmall,{children:A}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e.jsx(O.BodyCaption,Object.assign({color:y.COLORS.content.secondary},{children:"Intent"})),null!==(j=V[L.intent])&&void 0!==j?j:V.GENERIC,!N&&e.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>b(void 0)},{children:e.jsx(i.default,{height:20,width:20,color:y.COLORS.content.secondary})}))]})),J(M)?e.jsx("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,i;return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${y.COLORS.background.negative.light}`,borderRadius:"100px"}},{children:e.jsx(a.default,{width:24,height:24,color:y.COLORS.stroke.negative.vibrant})})),e.jsx("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e.jsx(O.TitleSmall,{children:"Insufficient data"})})),e.jsx(O.BodySecondary,Object.assign({color:y.COLORS.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),w&&e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(g.Button,{LeadingIcon:null!==(t=w.leadingIcon)&&void 0!==t?t:l.default,buttonText:null!==(i=w.title)&&void 0!==i?i:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{w.onClick()}})}))]}))})()})):e.jsx(h.Tag,{LeadingIcon:a.default,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:L.isEditable?"If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in Manifest.":"Edit the original source and save again to update the response"})]})),!J(M)&&e.jsx("div",Object.assign({className:"info-container"},{children:e.jsx("div",Object.assign({style:{padding:"0 8px",maxWidth:"100%"}},{children:M.map(((i,a)=>{var l,p,g,T,h,S,I,E,j,f,m,L,b,N,R,A,w;const F=ee(i.type||i.subTitle||"OpenAI"),q=ee(i.type||i.subTitle||"OpenAI",!0),U=(B=F)?"faq"==B.toLocaleLowerCase()?"FAQ":"openai"==B.toLocaleLowerCase()?"OPENAI":"files"==B.toLocaleLowerCase()?"PDF":"texts"==B.toLocaleLowerCase()?"Custom text":((B=(B=B.charAt(0).toUpperCase()+B.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(B=B.slice(0,-1)),B.replace("Website","Manual")):"";var B;const M=null==k?void 0:k.includes(q),H="Products"===i.subTitle?_[null!==(l=i.productId)&&void 0!==l?l:"Products"]:_[null!==(p=i.docId)&&void 0!==p?p:""],K=q.toLowerCase()===(null===(g=v.CustomDataType.FAQ)||void 0===g?void 0:g.toLowerCase())?"faq"===(null===(T=i.title)||void 0===T?void 0:T.toLowerCase())?i.subTitle:i.title:q.toLowerCase()===(null===(h=v.CustomDataType.FILES)||void 0===h?void 0:h.toLowerCase())||q.toLowerCase()===(null===(S=v.CustomDataType.FETCHED_LINKS)||void 0===S?void 0:S.toLowerCase())||q.toLowerCase()===(null===(I=v.CustomDataType.TEXTS)||void 0===I?void 0:I.toLowerCase())?i.title:q.toLowerCase()===(null===(E=v.CustomDataType.WEBSITE_LINKS)||void 0===E?void 0:E.toLowerCase())?i.title.split("/")[i.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,i)=>t.toUpperCase()+i)):i.intent===D.EMAIL_COLLECTION?U:i.title,Q="faq"===q.toLowerCase()?null!==(m=null!==(j=null==H?void 0:H.content)&&void 0!==j?j:null===(f=null==H?void 0:H.data)||void 0===f?void 0:f.answer)&&void 0!==m?m:"":q.toLowerCase()===(null===(L=v.CustomDataType.FETCHED_LINKS)||void 0===L?void 0:L.toLowerCase())||q.toLowerCase()===(null===(b=v.CustomDataType.WEBSITE_LINKS)||void 0===b?void 0:b.toLowerCase())||q.toLowerCase()===(null===(N=v.CustomDataType.TEXTS)||void 0===N?void 0:N.toLowerCase())?null!==(w=null!==(R=null==H?void 0:H.content)&&void 0!==R?R:null===(A=null==H?void 0:H.data)||void 0===A?void 0:A.fileContentText)&&void 0!==w?w:"":i.intent===D.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"24px 0px",borderBottom:`1px solid ${y.COLORS.stroke.primary}`}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(x.Tooltip,Object.assign({body:K,placement:"top"},{children:e.jsx(O.BodySecondary,Object.assign({style:q==v.CustomDataType.FETCHED_LINKS||q==v.CustomDataType.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:y.COLORS.content.primary,className:"clamp-title",onClick:()=>q==v.CustomDataType.FETCHED_LINKS||q==v.CustomDataType.WEBSITE_LINKS?P(i):{}},{children:K}))}))})),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[i.intent!==D.EMAIL_COLLECTION&&e.jsxs(e.Fragment,{children:[(Y=F,"products"==Y||"product"==Y?e.jsx(t.default,{height:16,width:16,color:y.COLORS.content.secondary}):"files"==Y?e.jsx(s.default,{height:16,width:16,color:y.COLORS.content.secondary}):"website links"==Y||"fetched links"==Y?e.jsx(u.default,{height:16,width:16,color:y.COLORS.content.secondary}):"faq"==Y?e.jsx(n.default,{height:16,width:16,color:y.COLORS.content.secondary}):"texts"==Y?e.jsx(c.default,{height:16,width:16,color:y.COLORS.content.secondary}):e.jsx(r.default,{height:16,width:16,color:y.COLORS.content.secondary})),e.jsx(O.BodyCaption,Object.assign({color:y.COLORS.content.secondary},{children:U}))]}),(i.link||i.docId)&&e.jsx("div",Object.assign({style:{cursor:"pointer",marginLeft:"4px"}},{children:M?e.jsx(C.IconButton,{Icon:o.default,height:16,width:16,bordered:!0,onClick:()=>null==H?void 0:H.onEditClick(H.data,H.type),disabled:!H,disabledTooltip:"This source is deleted"}):e.jsx(C.IconButton,{Icon:d.default,height:16,width:16,bordered:!0,disabled:"custom"===i.type&&!H,disabledTooltip:"This source is deleted",onClick:()=>P(i)})}))]}))]})),(null!=Q?Q:"").trim()&&e.jsx("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${y.COLORS.stroke.primary}`,borderRadius:"4px",backgroundColor:y.COLORS.surface.subdued}},{children:e.jsx(O.BodyCaption,Object.assign({color:y.COLORS.content.primary,className:"clamp-description"},{children:(G=null!=Q?Q:"",G.replace(/(<([^>]+)>)/gi,"")).trim()}))}))]}),`info-${a}`);var G,Y}))}))})),G&&!J(M)&&e.jsx("div",Object.assign({className:"footer"},{children:e.jsx(S.default,{storeId:m,messageSource:L,sourceIntent:null!==(f=L.intent)&&void 0!==f?f:D.GENERIC,faqCount:W,trainingSourceCount:z,ShowTrainingDataSource:Z,ChecklistType:D,footerButtonOption:q})}))]})})})};
|
|
@@ -133,3 +133,7 @@ export interface footerButtonOptionModel {
|
|
|
133
133
|
navigate?: (pagePathKey: Record<string, string>, params?: object, queryParam?: object, openInNewTab?: boolean) => void;
|
|
134
134
|
onClick: () => void;
|
|
135
135
|
}
|
|
136
|
+
export declare enum AppType {
|
|
137
|
+
MANIFEST = "MANIFEST",
|
|
138
|
+
BIK = "BIK"
|
|
139
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t,
|
|
1
|
+
"use strict";var e,t,o;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomDataCategories=void 0,(e=exports.CustomDataCategories||(exports.CustomDataCategories={})).PAGE="page",e.POLICY="policy",e.ARTICLE="article",e.UPLOADED="uploaded",e.TEXT="text",exports.CustomDataType=void 0,(t=exports.CustomDataType||(exports.CustomDataType={})).FAQ="FAQ",t.FILES="FILES",t.WEBSITE_LINKS="WEBSITE_LINKS",t.TEXTS="TEXTS",t.FETCHED_LINKS="FETCHED_LINKS",t.URL="URL",t.TRAINING_TEMPLATE="TRAINING_TEMPLATE",exports.AppType=void 0,(o=exports.AppType||(exports.AppType={})).MANIFEST="MANIFEST",o.BIK="BIK";
|
package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export interface UnsatisfactoryCountIntentWiseProps {
|
|
|
4
4
|
showUnsatisfactoryResponseModal: boolean;
|
|
5
5
|
setShowUnsatisfactoryResponseModal: (value: boolean) => void;
|
|
6
6
|
ChecklistType: Record<string, string>;
|
|
7
|
-
UnsatisfactoryResponseIntentList
|
|
8
|
-
IntentHeaderTitle
|
|
9
|
-
viewIntentWiseUnsatisfactoryResponse
|
|
10
|
-
fetchUnsatisfactoryResponseCountIntentWise
|
|
7
|
+
UnsatisfactoryResponseIntentList?: string[];
|
|
8
|
+
IntentHeaderTitle?: Record<string, string>;
|
|
9
|
+
viewIntentWiseUnsatisfactoryResponse?: (intent: string) => void;
|
|
10
|
+
fetchUnsatisfactoryResponseCountIntentWise?: () => Promise<{
|
|
11
11
|
[keys in string]?: number;
|
|
12
12
|
}>;
|
|
13
13
|
}
|
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"),a=require("../shimmer/ShimmerComponent/BikShimmer.js"),l=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,[O,p]=s.useState(),[g,u]=s.useState(!1);return s.useEffect((()=>{o&&(u(!0),y().then((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(l.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(l.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Intent"}))})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(l.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(l.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Action"}))}))]})),g&&[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(a.BikShimmer,{boxes:[{width:"196px",height:"20px"}]})})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.BikShimmer,{boxes:[{width:"176px",height:"20px"}]})})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.BikShimmer,{boxes:[{width:"56px",height:"20px"}]})}))]}),s))),!g&&m.map((s=>e.jsxs("div",Object.assign({className:"table-row"},{children:[e.jsx("div",Object.assign({className:"table-cell"},{children:e.jsx(l.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(l.BodySecondary,Object.assign({style:{color:t.COLORS.content.primary}},{children:(null==O?void 0:O[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==O?void 0:O[s])})}))]}),s)))]}))]})}))};
|
|
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"),a=require("../shimmer/ShimmerComponent/BikShimmer.js"),l=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,[O,p]=s.useState(),[g,u]=s.useState(!1);return s.useEffect((()=>{o&&y&&(u(!0),y().then((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(l.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(l.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Intent"}))})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(l.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(l.TitleSmall,Object.assign({style:{color:t.COLORS.content.primary}},{children:"Action"}))}))]})),g&&[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(a.BikShimmer,{boxes:[{width:"196px",height:"20px"}]})})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.BikShimmer,{boxes:[{width:"176px",height:"20px"}]})})),e.jsx("div",Object.assign({className:"table-cell center-align"},{children:e.jsx(a.BikShimmer,{boxes:[{width:"56px",height:"20px"}]})}))]}),s))),!g&&m&&x&&b&&m.map((s=>e.jsxs("div",Object.assign({className:"table-row"},{children:[e.jsx("div",Object.assign({className:"table-cell"},{children:e.jsx(l.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(l.BodySecondary,Object.assign({style:{color:t.COLORS.content.primary}},{children:(null==O?void 0:O[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==O?void 0:O[s])})}))]}),s)))]}))]})}))};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AppType } from '../data-source-panel/model';
|
|
2
3
|
export interface UnsatisfactoryResponseListProps {
|
|
3
4
|
storeId?: string;
|
|
5
|
+
appType: AppType;
|
|
4
6
|
incorrectMessages: any;
|
|
5
7
|
onIncorrectMessageBubbleClick: (messageId: string) => void;
|
|
6
8
|
setShowIncorrectReplies: (show: boolean) => void;
|
|
7
9
|
ChecklistType: Record<string, string>;
|
|
8
|
-
IntentHeaderTitle
|
|
9
|
-
IntentWiseUnsatisfactoryResponse
|
|
10
|
-
redirectToUnsatisfactoryResponse
|
|
11
|
-
fetchUnsatisfactoryResponseCountIntentWise
|
|
10
|
+
IntentHeaderTitle?: Record<string, string>;
|
|
11
|
+
IntentWiseUnsatisfactoryResponse?: string[];
|
|
12
|
+
redirectToUnsatisfactoryResponse?: (intent: string) => void;
|
|
13
|
+
fetchUnsatisfactoryResponseCountIntentWise?: () => Promise<{
|
|
12
14
|
[keys in string]?: number;
|
|
13
15
|
}>;
|
|
14
|
-
fetchUnsatisfactoryResponseCount
|
|
16
|
+
fetchUnsatisfactoryResponseCount?: () => Promise<number>;
|
|
15
17
|
}
|
|
16
18
|
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"),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
|
|
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("../data-source-panel/model.js"),d=require("../states/StateComponent.js");require("../../_virtual/_tslib.js");var y=require("../TypographyStyle.js"),u=require("./UnsatisfactoryCountIntentWiseModal.js"),p=require("./UnsatisfactoryResponseList.style.js");exports.UnsatisfactoryResponseList=j=>{const{storeId:f,appType:h,incorrectMessages:g,onIncorrectMessageBubbleClick:v,setShowIncorrectReplies:x,ChecklistType:I,IntentWiseUnsatisfactoryResponse:b,IntentHeaderTitle:C,redirectToUnsatisfactoryResponse:O,fetchUnsatisfactoryResponseCountIntentWise:S,fetchUnsatisfactoryResponseCount:R}=j,[m,T]=r.useState(""),[A,w]=r.useState((null==g?void 0:g.length)>0),[U,q]=r.useState(!1);return r.useEffect((()=>{!A&&R&&R().then((e=>{e>0&&w(!0),0===e&&x(!1)}))}),[]),e.jsx("div",Object.assign({style:{overflow:"scroll"}},{children:e.jsxs(p.IncorrectRepliesStyle,{children:[h==l.AppType.MANIFEST&&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(y.TitleRegular,{children:"Unsatifactory responses"}),e.jsx("div",Object.assign({style:{cursor:"pointer"},onClick:()=>x(!1)},{children:e.jsx(s.default,{height:16,width:16,color:a.COLORS.content.primary})}))]})),e.jsx(y.BodySecondary,Object.assign({style:{color:a.COLORS.content.secondary}},{children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."}))]})),!(null==g?void 0:g.length)&&e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:e.jsx(d.StateComponent,{states:d.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})})})})),h==l.AppType.MANIFEST&&e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:(null==g?void 0:g.length)?"flex-start":"center"}},{children:e.jsx(c.Button,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{q(!0)},disabled:!A})})),e.jsx(u.UnsatisfactoryCountIntentWiseModal,{storeId:f,setShowUnsatisfactoryResponseModal:q,showUnsatisfactoryResponseModal:U,ChecklistType:I,UnsatisfactoryResponseIntentList:b,IntentHeaderTitle:C,fetchUnsatisfactoryResponseCountIntentWise:S,viewIntentWiseUnsatisfactoryResponse:O}),!!(null==g?void 0:g.length)&&e.jsx("div",Object.assign({className:"wrapper"},{children:g.map(((s,t)=>e.jsxs("div",Object.assign({className:"bubble",onClick:()=>{v(s.messageId),T(s.messageId)},style:m===s.messageId?{backgroundColor:a.COLORS.surface.hovered}:{}},{children:[e.jsx(y.BodySecondary,Object.assign({style:{color:a.COLORS.content.primary}},{children:s.message})),e.jsx("div",{children:e.jsxs(y.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,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AllSourceInfoDetailsCustomDataModel, CustomDataType, DataSourcePanelZeroState, footerButtonOptionModel, InfoContent, MessageSource } from './model';
|
|
2
|
+
import { AllSourceInfoDetailsCustomDataModel, AppType, CustomDataType, DataSourcePanelZeroState, footerButtonOptionModel, InfoContent, MessageSource } from './model';
|
|
3
3
|
export interface DataSourcePanelProps {
|
|
4
4
|
storeId: string;
|
|
5
|
+
appType: AppType;
|
|
5
6
|
messageSource: MessageSource;
|
|
6
7
|
setMessageSourcePanel: (source?: MessageSource) => void;
|
|
7
8
|
hideCloseButton?: boolean;
|
|
8
9
|
title?: string;
|
|
9
10
|
allSourceInfoDetail: AllSourceInfoDetailsCustomDataModel;
|
|
10
11
|
isSourceInfoFetched?: boolean;
|
|
11
|
-
faqCount: number;
|
|
12
12
|
editableSources: CustomDataType[];
|
|
13
13
|
redirect: (sourceInfo: InfoContent) => void;
|
|
14
|
-
|
|
14
|
+
preFillTrainingSourceCount?: {
|
|
15
15
|
[k in string]: number;
|
|
16
16
|
};
|
|
17
17
|
zeroStateButton: DataSourcePanelZeroState;
|
|
18
18
|
ChecklistType: Record<string, string>;
|
|
19
|
-
IntentComponentMap: Record<string, JSX.Element>;
|
|
20
|
-
ShowTrainingDataSource: Record<string, string>;
|
|
21
19
|
footerButtonOption?: footerButtonOptionModel;
|
|
20
|
+
fetchTrainingSourceCount: (storeId: string) => Promise<{
|
|
21
|
+
[k in string]: number;
|
|
22
|
+
}>;
|
|
23
|
+
fetchProductFAQCount: (storeId: string, productIds?: string[]) => Promise<number>;
|
|
22
24
|
}
|
|
23
25
|
export declare const DataSourcePanel: React.FC<DataSourcePanelProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import o from"../../assets/icons/boxV2.svg.js";import s from"../../assets/icons/cross.svg.js";import n from"../../assets/icons/edit.svg.js";import r from"../../assets/icons/filePdf.svg.js";import l from"../../assets/icons/help.svg.js";import a from"../../assets/icons/info.svg.js";import d from"../../assets/icons/openai.svg.js";import c from"../../assets/icons/plus.svg.js";import p from"../../assets/icons/redirect.svg.js";import u from"../../assets/icons/text_t9.svg.js";import g from"../../assets/icons/website.svg.js";import{useState as h,useEffect as m}from"react";import{COLORS as v}from"../../constants/Theme.js";import{Button as f}from"../button/Button.js";import{IconButton as y}from"../icon-button/IconButton.js";import{BikShimmer as C}from"../shimmer/ShimmerComponent/BikShimmer.js";import{Tag as x}from"../tag/Tag.js";import{Tooltip as b}from"../tooltips/Tooltip.js";import{TitleSmall as I,BodyCaption as L,BodySecondary as j}from"../TypographyStyle.js";import w from"./DataSourceInfoFooter.js";import{SourceInfoDetailsStyle as T}from"./DataSourcePanel.style.js";import{CustomDataType as E}from"./model.js";const S=S=>{var O,N;const{storeId:k,messageSource:D,setMessageSourcePanel:A,hideCloseButton:_,faqCount:B=0,isSourceInfoFetched:F,allSourceInfoDetail:K,ChecklistType:P,IntentComponentMap:W,title:q,zeroStateButton:M,editableSources:H,redirect:Q,trainingSourceCount:$,ShowTrainingDataSource:R,footerButtonOption:U}=S,{sources:X}=D,z=["blog","article","page","policy"],[G,V]=h(!1),[J,Y]=h(!1);m((()=>{var e,t,i,o;(null==D?void 0:D.messageId)&&(V(!0),setTimeout((()=>V(!1)),200),Y(!1!==(null===(t=null===(e=D.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(o=null===(i=D.sources)||void 0===i?void 0:i[0])||void 0===o?void 0:o.insights)))}),[null==D?void 0:D.messageId]);const Z=e=>!(0!==e.length&&!(null==D?void 0:D.isUnsatisfactoryAnswer)),ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i;return"custom"==e?e=E.FILES:z.includes(e)?e=E.FETCHED_LINKS:"url"==e?e=E.WEBSITE_LINKS:"text"===e?e=E.TEXTS:"faq"===e&&(e=E.FAQ),t?e:null===(i=null==e?void 0:e.toLowerCase())||void 0===i?void 0:i.replace(/_/g," ")};return G||!F?e(T,{children:e(C,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})}):e(t,{children:e(T,{children:!!(null==X?void 0:X.length)&&i(t,{children:[i("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",paddingBottom:"12px"}},{children:[!!q&&e(I,{children:q}),i("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e(L,Object.assign({color:v.content.secondary},{children:"Intent"})),null!==(O=W[D.intent])&&void 0!==O?O:W.GENERIC,!_&&e("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>A(void 0)},{children:e(s,{height:20,width:20,color:v.content.secondary})}))]})),Z(X)?e("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,o;return i("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${v.background.negative.light}`,borderRadius:"100px"}},{children:e(a,{width:24,height:24,color:v.stroke.negative.vibrant})})),e("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e(I,{children:"Insufficient data"})})),e(j,Object.assign({color:v.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),M&&e("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e(f,{LeadingIcon:null!==(t=M.leadingIcon)&&void 0!==t?t:c,buttonText:null!==(o=M.title)&&void 0!==o?o:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{M.onClick()}})}))]}))})()})):e(x,{LeadingIcon:a,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:D.isEditable?"If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in Manifest.":"Edit the original source and save again to update the response"})]})),!Z(X)&&e("div",Object.assign({className:"info-container"},{children:e("div",Object.assign({style:{padding:"0 8px",maxWidth:"100%"}},{children:X.map(((s,a)=>{var c,h,m,f,C,x,I,w,T,S,O,N,k,D;const A=ee(s.type||s.subTitle||"OpenAI"),_=ee(s.type||s.subTitle||"OpenAI",!0),B=(F=A)?"faq"==F.toLocaleLowerCase()?"FAQ":"openai"==F.toLocaleLowerCase()?"OPENAI":"files"==F.toLocaleLowerCase()?"PDF":"texts"==F.toLocaleLowerCase()?"Custom text":((F=(F=F.charAt(0).toUpperCase()+F.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(F=F.slice(0,-1)),F.replace("Website","Manual")):"";var F;const W=null==H?void 0:H.includes(_),q="Products"===s.subTitle?K[null!==(c=s.productId)&&void 0!==c?c:"Products"]:K[null!==(h=s.docId)&&void 0!==h?h:""],M=_.toLowerCase()===(null===(m=E.FAQ)||void 0===m?void 0:m.toLowerCase())?"faq"===(null===(f=s.title)||void 0===f?void 0:f.toLowerCase())?s.subTitle:s.title:_.toLowerCase()===(null===(C=E.FILES)||void 0===C?void 0:C.toLowerCase())||_.toLowerCase()===(null===(x=E.FETCHED_LINKS)||void 0===x?void 0:x.toLowerCase())||_.toLowerCase()===(null===(I=E.TEXTS)||void 0===I?void 0:I.toLowerCase())?s.title:_.toLowerCase()===(null===(w=E.WEBSITE_LINKS)||void 0===w?void 0:w.toLowerCase())?s.title.split("/")[s.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,i)=>t.toUpperCase()+i)):s.intent===P.EMAIL_COLLECTION?B:s.title,$="faq"===_.toLowerCase()?null===(T=null==q?void 0:q.data)||void 0===T?void 0:T.answer:_.toLowerCase()===(null===(S=E.FETCHED_LINKS)||void 0===S?void 0:S.toLowerCase())||_.toLowerCase()===(null===(O=E.WEBSITE_LINKS)||void 0===O?void 0:O.toLowerCase())||_.toLowerCase()===(null===(N=E.TEXTS)||void 0===N?void 0:N.toLowerCase())?null!==(D=null===(k=null==q?void 0:q.data)||void 0===k?void 0:k.fileContentText)&&void 0!==D?D:"":s.intent===P.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"24px 0px",borderBottom:`1px solid ${v.stroke.primary}`}},{children:[i("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e("div",Object.assign({style:{flex:1}},{children:e(b,Object.assign({body:M,placement:"top"},{children:e(j,Object.assign({style:_==E.FETCHED_LINKS||_==E.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:v.content.primary,className:"clamp-title",onClick:()=>_==E.FETCHED_LINKS||_==E.WEBSITE_LINKS?Q(s):{}},{children:M}))}))})),i("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[s.intent!==P.EMAIL_COLLECTION&&i(t,{children:[(U=A,e("products"==U?o:"files"==U?r:"website links"==U||"fetched links"==U?g:"faq"==U?l:"texts"==U?u:d,{height:16,width:16,color:v.content.secondary})),e(L,Object.assign({color:v.content.secondary},{children:B}))]}),(s.link||s.docId)&&e("div",Object.assign({style:{cursor:"pointer",marginLeft:"4px"}},{children:e(y,W?{Icon:n,height:16,width:16,bordered:!0,onClick:()=>null==q?void 0:q.onEditClick(q.data,q.type),disabled:!q,disabledTooltip:"This source is deleted"}:{Icon:p,height:16,width:16,bordered:!0,disabled:"custom"===s.type&&!q,disabledTooltip:"This source is deleted",onClick:()=>Q(s)})}))]}))]})),(null!=$?$:"").trim()&&e("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${v.stroke.primary}`,borderRadius:"4px",backgroundColor:v.surface.subdued}},{children:e(L,Object.assign({color:v.content.primary,className:"clamp-description"},{children:(R=null!=$?$:"",R.replace(/(<([^>]+)>)/gi,"")).trim()}))}))]}),`info-${a}`);var R,U}))}))})),J&&!Z(X)&&e("div",Object.assign({className:"footer"},{children:e(w,{storeId:k,messageSource:D,sourceIntent:null!==(N=D.intent)&&void 0!==N?N:P.GENERIC,faqCount:B,trainingSourceCount:$,ShowTrainingDataSource:R,ChecklistType:P,footerButtonOption:U})}))]})})})};export{S as DataSourcePanel};
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import o from"../../assets/icons/boxV2.svg.js";import n from"../../assets/icons/cross.svg.js";import s from"../../assets/icons/edit.svg.js";import r from"../../assets/icons/filePdf.svg.js";import l from"../../assets/icons/help.svg.js";import a from"../../assets/icons/info.svg.js";import c from"../../assets/icons/openai.svg.js";import d from"../../assets/icons/plus.svg.js";import p from"../../assets/icons/redirect.svg.js";import u from"../../assets/icons/text_t9.svg.js";import g from"../../assets/icons/website.svg.js";import{useState as y,useMemo as h,useEffect as T}from"react";import{COLORS as C}from"../../constants/Theme.js";import{Button as m}from"../button/Button.js";import{IconButton as I}from"../icon-button/IconButton.js";import{BikShimmer as v}from"../shimmer/ShimmerComponent/BikShimmer.js";import{Tag as f}from"../tag/Tag.js";import{Tooltip as O}from"../tooltips/Tooltip.js";import{TitleSmall as E,BodyCaption as x,BodySecondary as S}from"../TypographyStyle.js";import L from"./DataSourceInfoFooter.js";import{SourceInfoDetailsStyle as b}from"./DataSourcePanel.style.js";import{CustomDataType as N}from"./model.js";const _=_=>{var A,w;const{storeId:R,messageSource:k,setMessageSourcePanel:j,hideCloseButton:D,isSourceInfoFetched:F,allSourceInfoDetail:P,ChecklistType:U,title:B,zeroStateButton:M,editableSources:H,preFillTrainingSourceCount:K,redirect:Q,footerButtonOption:q,fetchTrainingSourceCount:G,fetchProductFAQCount:Y}=_,{sources:W}=k,$=["blog","article","page","policy"],[z,X]=y(!1),[V,Z]=y(!1),[J,ee]=y(0),[te,ie]=y(null!=K?K:{}),oe={};[{key:"GENERIC",type:"neutral",tagText:"Generic"},{key:"STORE_INFORMATION",type:"blue",tagText:"Store information"},{key:"SHIPPING_POLICY",type:"positive",tagText:"Shipping policy"},{key:"RETURN_AND_REFUND",type:"purple",tagText:"Returns & refund policy"},{key:"CONTACT_INFO",type:"warning",tagText:"Contact details"},{key:"STORE_LOCATION",type:"grey",tagText:"Store location"},{key:"SALES_AND_OFFERS",type:"purple",tagText:"Offers & rewards"},{key:"PRODUCT_CUSTOMISATION",type:"blue",tagText:"Product customisation"},{key:"PRODUCT_DETAILS",type:"blue",tagText:"Product details"},{key:"PAYMENT_METHODS",type:"positive",tagText:"Payment methods"},{key:"ORDER_TRACKING",type:"warning",tagText:"Order tracking"},{key:"PRODUCT_SEARCH",type:"neutral",tagText:"Product search"},{key:"PURCHASE",type:"blue",tagText:"Purchase"},{key:"CONNECT_TO_AGENT",type:"purple",tagText:"Talk to a person"},{key:"CHECKOUT_ENQUIRY",type:"purple",tagText:"Checkout enquiry"},{key:"ORDER_CANCELLATION",type:"positive",tagText:"Order cancellation"},{key:"ORDER_ENQUIRY",type:"neutral",tagText:"Order enquiry"},{key:"ORDER_MODIFICATION",type:"blue",tagText:"Order modification"},{key:"SUBSCRIPTION_ENQUIRY",type:"warning",tagText:"Subscription enquiry"},{key:"SALES_AND_OFFERS_ISSUES",type:"grey",tagText:"Offer-related enquiries"},{key:"COLLABORATION",type:"positive",tagText:"Collaboration"},{key:"QUIZ_GENERATION",type:"warning",tagText:"Start the quiz"},{key:"SIMILAR_PRODUCT",type:"blue",tagText:"Similar Product"},{key:"EMAIL_COLLECTION",type:"warning",tagText:"Email Collection"},{key:"ADD_TO_CART_SUCCESS",type:"blue",tagText:"Add to Cart Success"},{key:"ADD_TO_CART_SUCCESS_MESSAGE",type:"blue",tagText:"Add to Cart Success Message"},{key:"FEEDBACK",type:"blue",tagText:"Feedback"},{key:"PHONE_NUMBER_COLLECTION",type:"blue",tagText:"Phone no. collection"}].forEach((t=>{let{key:i,type:o,tagText:n}=t;U[i]&&(oe[U[i]]=e(f,{theme:"light",type:o,tagText:n,cursor:"pointer"}))}));const ne=h((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{U[t]&&(e[U[t]]=U[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[]);T((()=>{var e,t,i,o;if(!(null==k?void 0:k.messageId))return;X(!0),Z(!1!==(null===(t=null===(e=k.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(o=null===(i=k.sources)||void 0===i?void 0:i[0])||void 0===o?void 0:o.insights));const n=k.sources.filter((e=>!!e.productId)).map((e=>e.productId)),s=Array.from(new Set(n)).filter((e=>!!e));Y(R,s).then((e=>ee(e))).then((()=>{K||G(R).then((e=>ie(e)))})).finally((()=>setTimeout((()=>X(!1)),100)))}),[null==k?void 0:k.messageId,k.sources,K,R]);const se=e=>!(0!==e.length&&!(null==k?void 0:k.isUnsatisfactoryAnswer)),re=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i;return"custom"==e?e=N.FILES:$.includes(e)?e=N.FETCHED_LINKS:"url"==e?e=N.WEBSITE_LINKS:"text"===e?e=N.TEXTS:"faq"===e&&(e=N.FAQ),t?e:null===(i=null==e?void 0:e.toLowerCase())||void 0===i?void 0:i.replace(/_/g," ")};return z||!F?e(b,{children:e(v,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})}):e(t,{children:e(b,{children:!!(null==W?void 0:W.length)&&i(t,{children:[i("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",paddingBottom:"12px"}},{children:[!!B&&e(E,{children:B}),i("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e(x,Object.assign({color:C.content.secondary},{children:"Intent"})),null!==(A=oe[k.intent])&&void 0!==A?A:oe.GENERIC,!D&&e("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>j(void 0)},{children:e(n,{height:20,width:20,color:C.content.secondary})}))]})),se(W)?e("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var t,o;return i("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${C.background.negative.light}`,borderRadius:"100px"}},{children:e(a,{width:24,height:24,color:C.stroke.negative.vibrant})})),e("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e(E,{children:"Insufficient data"})})),e(S,Object.assign({color:C.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),M&&e("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e(m,{LeadingIcon:null!==(t=M.leadingIcon)&&void 0!==t?t:d,buttonText:null!==(o=M.title)&&void 0!==o?o:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{M.onClick()}})}))]}))})()})):e(f,{LeadingIcon:a,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:k.isEditable?"If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in Manifest.":"Edit the original source and save again to update the response"})]})),!se(W)&&e("div",Object.assign({className:"info-container"},{children:e("div",Object.assign({style:{padding:"0 8px",maxWidth:"100%"}},{children:W.map(((n,a)=>{var d,y,h,T,m,v,f,E,L,b,_,A,w,R,k,j,D;const F=re(n.type||n.subTitle||"OpenAI"),B=re(n.type||n.subTitle||"OpenAI",!0),M=(K=F)?"faq"==K.toLocaleLowerCase()?"FAQ":"openai"==K.toLocaleLowerCase()?"OPENAI":"files"==K.toLocaleLowerCase()?"PDF":"texts"==K.toLocaleLowerCase()?"Custom text":((K=(K=K.charAt(0).toUpperCase()+K.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(K=K.slice(0,-1)),K.replace("Website","Manual")):"";var K;const q=null==H?void 0:H.includes(B),G="Products"===n.subTitle?P[null!==(d=n.productId)&&void 0!==d?d:"Products"]:P[null!==(y=n.docId)&&void 0!==y?y:""],Y=B.toLowerCase()===(null===(h=N.FAQ)||void 0===h?void 0:h.toLowerCase())?"faq"===(null===(T=n.title)||void 0===T?void 0:T.toLowerCase())?n.subTitle:n.title:B.toLowerCase()===(null===(m=N.FILES)||void 0===m?void 0:m.toLowerCase())||B.toLowerCase()===(null===(v=N.FETCHED_LINKS)||void 0===v?void 0:v.toLowerCase())||B.toLowerCase()===(null===(f=N.TEXTS)||void 0===f?void 0:f.toLowerCase())?n.title:B.toLowerCase()===(null===(E=N.WEBSITE_LINKS)||void 0===E?void 0:E.toLowerCase())?n.title.split("/")[n.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,i)=>t.toUpperCase()+i)):n.intent===U.EMAIL_COLLECTION?M:n.title,W="faq"===B.toLowerCase()?null!==(_=null!==(L=null==G?void 0:G.content)&&void 0!==L?L:null===(b=null==G?void 0:G.data)||void 0===b?void 0:b.answer)&&void 0!==_?_:"":B.toLowerCase()===(null===(A=N.FETCHED_LINKS)||void 0===A?void 0:A.toLowerCase())||B.toLowerCase()===(null===(w=N.WEBSITE_LINKS)||void 0===w?void 0:w.toLowerCase())||B.toLowerCase()===(null===(R=N.TEXTS)||void 0===R?void 0:R.toLowerCase())?null!==(D=null!==(k=null==G?void 0:G.content)&&void 0!==k?k:null===(j=null==G?void 0:G.data)||void 0===j?void 0:j.fileContentText)&&void 0!==D?D:"":n.intent===U.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"24px 0px",borderBottom:`1px solid ${C.stroke.primary}`}},{children:[i("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[e("div",Object.assign({style:{flex:1}},{children:e(O,Object.assign({body:Y,placement:"top"},{children:e(S,Object.assign({style:B==N.FETCHED_LINKS||B==N.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:C.content.primary,className:"clamp-title",onClick:()=>B==N.FETCHED_LINKS||B==N.WEBSITE_LINKS?Q(n):{}},{children:Y}))}))})),i("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[n.intent!==U.EMAIL_COLLECTION&&i(t,{children:[(z=F,e("products"==z||"product"==z?o:"files"==z?r:"website links"==z||"fetched links"==z?g:"faq"==z?l:"texts"==z?u:c,{height:16,width:16,color:C.content.secondary})),e(x,Object.assign({color:C.content.secondary},{children:M}))]}),(n.link||n.docId)&&e("div",Object.assign({style:{cursor:"pointer",marginLeft:"4px"}},{children:e(I,q?{Icon:s,height:16,width:16,bordered:!0,onClick:()=>null==G?void 0:G.onEditClick(G.data,G.type),disabled:!G,disabledTooltip:"This source is deleted"}:{Icon:p,height:16,width:16,bordered:!0,disabled:"custom"===n.type&&!G,disabledTooltip:"This source is deleted",onClick:()=>Q(n)})}))]}))]})),(null!=W?W:"").trim()&&e("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${C.stroke.primary}`,borderRadius:"4px",backgroundColor:C.surface.subdued}},{children:e(x,Object.assign({color:C.content.primary,className:"clamp-description"},{children:($=null!=W?W:"",$.replace(/(<([^>]+)>)/gi,"")).trim()}))}))]}),`info-${a}`);var $,z}))}))})),V&&!se(W)&&e("div",Object.assign({className:"footer"},{children:e(L,{storeId:R,messageSource:k,sourceIntent:null!==(w=k.intent)&&void 0!==w?w:U.GENERIC,faqCount:J,trainingSourceCount:te,ShowTrainingDataSource:ne,ChecklistType:U,footerButtonOption:q})}))]})})})};export{_ as DataSourcePanel};
|
|
@@ -133,3 +133,7 @@ export interface footerButtonOptionModel {
|
|
|
133
133
|
navigate?: (pagePathKey: Record<string, string>, params?: object, queryParam?: object, openInNewTab?: boolean) => void;
|
|
134
134
|
onClick: () => void;
|
|
135
135
|
}
|
|
136
|
+
export declare enum AppType {
|
|
137
|
+
MANIFEST = "MANIFEST",
|
|
138
|
+
BIK = "BIK"
|
|
139
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E,T;!function(E){E.PAGE="page",E.POLICY="policy",E.ARTICLE="article",E.UPLOADED="uploaded",E.TEXT="text"}(E||(E={})),function(E){E.FAQ="FAQ",E.FILES="FILES",E.WEBSITE_LINKS="WEBSITE_LINKS",E.TEXTS="TEXTS",E.FETCHED_LINKS="FETCHED_LINKS",E.URL="URL",E.TRAINING_TEMPLATE="TRAINING_TEMPLATE"}(T||(T={}));export{E as CustomDataCategories,T as CustomDataType};
|
|
1
|
+
var E,T,I;!function(E){E.PAGE="page",E.POLICY="policy",E.ARTICLE="article",E.UPLOADED="uploaded",E.TEXT="text"}(E||(E={})),function(E){E.FAQ="FAQ",E.FILES="FILES",E.WEBSITE_LINKS="WEBSITE_LINKS",E.TEXTS="TEXTS",E.FETCHED_LINKS="FETCHED_LINKS",E.URL="URL",E.TRAINING_TEMPLATE="TRAINING_TEMPLATE"}(T||(T={})),function(E){E.MANIFEST="MANIFEST",E.BIK="BIK"}(I||(I={}));export{I as AppType,E as CustomDataCategories,T as CustomDataType};
|
package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export interface UnsatisfactoryCountIntentWiseProps {
|
|
|
4
4
|
showUnsatisfactoryResponseModal: boolean;
|
|
5
5
|
setShowUnsatisfactoryResponseModal: (value: boolean) => void;
|
|
6
6
|
ChecklistType: Record<string, string>;
|
|
7
|
-
UnsatisfactoryResponseIntentList
|
|
8
|
-
IntentHeaderTitle
|
|
9
|
-
viewIntentWiseUnsatisfactoryResponse
|
|
10
|
-
fetchUnsatisfactoryResponseCountIntentWise
|
|
7
|
+
UnsatisfactoryResponseIntentList?: string[];
|
|
8
|
+
IntentHeaderTitle?: Record<string, string>;
|
|
9
|
+
viewIntentWiseUnsatisfactoryResponse?: (intent: string) => void;
|
|
10
|
+
fetchUnsatisfactoryResponseCountIntentWise?: () => Promise<{
|
|
11
11
|
[keys in string]?: number;
|
|
12
12
|
}>;
|
|
13
13
|
}
|
package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as s,useEffect as n}from"react";import{COLORS as i}from"../../constants/Theme.js";import{Button as a}from"../button/Button.js";import{StyledModal as l}from"../modals/styledModal.js";import{BikShimmer as c}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyPrimary as r,TitleSmall as o,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]=s(),[N,w]=s(!1);return n((()=>{b&&(w(!0),v().then((e=>{x(e),w(!1)})))}),[b]),e(l,Object.assign({onClose:()=>p(!1),open:g,headingTitle:"Improve unsatisfactory response"},{children:t(m,{children:[e("div",{children:e(r,Object.assign({style:{color:i.content.primary}},{children:"Intent wise distribution of unsatisfactory response"}))}),t("div",Object.assign({className:"modal-table"},{children:[t("div",Object.assign({className:"table-row header"},{children:[e("div",Object.assign({className:"table-cell"},{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Intent"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Unsatisfactory response"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Action"}))}))]})),N&&[0,1,2,3,4,5,6].map((s=>t("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"}]})}))]}),s))),!N&&j.map((s=>t("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[s]}))})),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[s])||"--"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(a,{buttonText:"Fix",buttonType:"tertiary",size:"small",onClick:()=>O(s),disabled:!(null==u?void 0:u[s])})}))]}),s)))]}))]})}))};export{h as UnsatisfactoryCountIntentWiseModal};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as s,useEffect as n}from"react";import{COLORS as i}from"../../constants/Theme.js";import{Button as a}from"../button/Button.js";import{StyledModal as l}from"../modals/styledModal.js";import{BikShimmer as c}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyPrimary as r,TitleSmall as o,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]=s(),[N,w]=s(!1);return n((()=>{b&&v&&(w(!0),v().then((e=>{x(e),w(!1)})))}),[b]),e(l,Object.assign({onClose:()=>p(!1),open:g,headingTitle:"Improve unsatisfactory response"},{children:t(m,{children:[e("div",{children:e(r,Object.assign({style:{color:i.content.primary}},{children:"Intent wise distribution of unsatisfactory response"}))}),t("div",Object.assign({className:"modal-table"},{children:[t("div",Object.assign({className:"table-row header"},{children:[e("div",Object.assign({className:"table-cell"},{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Intent"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Unsatisfactory response"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(o,Object.assign({style:{color:i.content.primary}},{children:"Action"}))}))]})),N&&[0,1,2,3,4,5,6].map((s=>t("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"}]})}))]}),s))),!N&&j&&f&&O&&j.map((s=>t("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[s]}))})),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[s])||"--"}))})),e("div",Object.assign({className:"table-cell center-align"},{children:e(a,{buttonText:"Fix",buttonType:"tertiary",size:"small",onClick:()=>O(s),disabled:!(null==u?void 0:u[s])})}))]}),s)))]}))]})}))};export{h as UnsatisfactoryCountIntentWiseModal};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AppType } from '../data-source-panel/model';
|
|
2
3
|
export interface UnsatisfactoryResponseListProps {
|
|
3
4
|
storeId?: string;
|
|
5
|
+
appType: AppType;
|
|
4
6
|
incorrectMessages: any;
|
|
5
7
|
onIncorrectMessageBubbleClick: (messageId: string) => void;
|
|
6
8
|
setShowIncorrectReplies: (show: boolean) => void;
|
|
7
9
|
ChecklistType: Record<string, string>;
|
|
8
|
-
IntentHeaderTitle
|
|
9
|
-
IntentWiseUnsatisfactoryResponse
|
|
10
|
-
redirectToUnsatisfactoryResponse
|
|
11
|
-
fetchUnsatisfactoryResponseCountIntentWise
|
|
10
|
+
IntentHeaderTitle?: Record<string, string>;
|
|
11
|
+
IntentWiseUnsatisfactoryResponse?: string[];
|
|
12
|
+
redirectToUnsatisfactoryResponse?: (intent: string) => void;
|
|
13
|
+
fetchUnsatisfactoryResponseCountIntentWise?: () => Promise<{
|
|
12
14
|
[keys in string]?: number;
|
|
13
15
|
}>;
|
|
14
|
-
fetchUnsatisfactoryResponseCount
|
|
16
|
+
fetchUnsatisfactoryResponseCount?: () => Promise<number>;
|
|
15
17
|
}
|
|
16
18
|
export declare const UnsatisfactoryResponseList: React.FC<UnsatisfactoryResponseListProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs 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 r,useEffect as i}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{AppType as m}from"../data-source-panel/model.js";import{StateComponent as f,StateInterface as h}from"../states/StateComponent.js";import"../../_virtual/_tslib.js";import{TitleRegular as g,BodySecondary as u,Caption as v}from"../TypographyStyle.js";import{UnsatisfactoryCountIntentWiseModal as j}from"./UnsatisfactoryCountIntentWiseModal.js";import{IncorrectRepliesStyle as b}from"./UnsatisfactoryResponseList.style.js";const I=I=>{const{storeId:w,appType:C,incorrectMessages:T,onIncorrectMessageBubbleClick:U,setShowIncorrectReplies:M,ChecklistType:O,IntentWiseUnsatisfactoryResponse:R,IntentHeaderTitle:x,redirectToUnsatisfactoryResponse:k,fetchUnsatisfactoryResponseCountIntentWise:N,fetchUnsatisfactoryResponseCount:S}=I,[A,W]=r(""),[L,D]=r((null==T?void 0:T.length)>0),[E,H]=r(!1);return i((()=>{!L&&S&&S().then((e=>{e>0&&D(!0),0===e&&M(!1)}))}),[]),e("div",Object.assign({style:{overflow:"scroll"}},{children:t(b,{children:[C==m.MANIFEST&&t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px"}},{children:[t("div",Object.assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[e(g,{children:"Unsatifactory responses"}),e("div",Object.assign({style:{cursor:"pointer"},onClick:()=>M(!1)},{children:e(s,{height:16,width:16,color:a.content.primary})}))]})),e(u,Object.assign({style:{color:a.content.secondary}},{children:"Spot unsatisfactory replies, dive deeper, and enhance with relevant data for improved responses."}))]})),!(null==T?void 0:T.length)&&e("div",Object.assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:e(f,{states:h.WARNING,heading:"No unsatisfactory responses",subline:"As of now, all responses are correct",isButtonEnabled:!1,width:0,size:l.SMALL,icon:e(c,{type:d.ICON,size:l.MEDIUM,background:p.LIGHT,icon:()=>e(n,{width:16,height:16,color:a.content.warning})})})})),C==m.MANIFEST&&e("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:(null==T?void 0:T.length)?"flex-start":"center"}},{children:e(y,{buttonText:"Fix all unsatisfactory responses",buttonType:"tertiary",size:"small",onClick:()=>{H(!0)},disabled:!L})})),e(j,{storeId:w,setShowUnsatisfactoryResponseModal:H,showUnsatisfactoryResponseModal:E,ChecklistType:O,UnsatisfactoryResponseIntentList:R,IntentHeaderTitle:x,fetchUnsatisfactoryResponseCountIntentWise:N,viewIntentWiseUnsatisfactoryResponse:k}),!!(null==T?void 0:T.length)&&e("div",Object.assign({className:"wrapper"},{children:T.map(((s,n)=>t("div",Object.assign({className:"bubble",onClick:()=>{U(s.messageId),W(s.messageId)},style:A===s.messageId?{backgroundColor:a.surface.hovered}:{}},{children:[e(u,Object.assign({style:{color:a.content.primary}},{children:s.message})),e("div",{children:t(v,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{I as UnsatisfactoryResponseList};
|