@bikdotai/bik-component-library 0.0.703-beta.3 → 0.0.703-beta.5
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/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -5
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/feature-announcements/FeatureAnnouncement.types.d.ts +27 -0
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.d.ts +14 -0
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -0
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +13 -0
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -0
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +13 -0
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -0
- package/dist/cjs/components/feature-announcements/VideoModal.d.ts +8 -0
- package/dist/cjs/components/feature-announcements/VideoModal.js +1 -0
- package/dist/cjs/components/feature-announcements/index.d.ts +6 -0
- package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.d.ts +24 -0
- package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.js +1 -0
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +1 -5
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +1 -1
- package/dist/cjs/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +1 -3
- package/dist/cjs/components/template-context-mapper/styles/TemplateAnalyticsStyles.js +5 -6
- package/dist/cjs/components/template-context-mapper/utils/TemplateConstants.d.ts +3 -13
- package/dist/cjs/components/template-context-mapper/utils/TemplateConstants.js +1 -1
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +1 -7
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.js +1 -1
- package/dist/cjs/components/whats-new/WhatsNew.d.ts +18 -0
- package/dist/cjs/components/whats-new/WhatsNew.js +1 -0
- package/dist/cjs/components/whats-new/WhatsNew.styles.d.ts +11 -0
- package/dist/cjs/components/whats-new/WhatsNew.styles.js +196 -0
- package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +52 -0
- package/dist/cjs/components/whats-new/WhatsNewButton.d.ts +3 -0
- package/dist/cjs/components/whats-new/WhatsNewButton.js +1 -0
- package/dist/cjs/components/whats-new/WhatsNewPanel.d.ts +3 -0
- package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -0
- package/dist/cjs/components/whats-new/WhatsNewProvider.d.ts +4 -0
- package/dist/cjs/components/whats-new/WhatsNewProvider.js +1 -0
- package/dist/cjs/components/whats-new/index.d.ts +7 -0
- package/dist/cjs/components/whats-new/useWhatsNew.d.ts +9 -0
- package/dist/cjs/components/whats-new/useWhatsNew.js +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -5
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncement.types.d.ts +27 -0
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +14 -0
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -0
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +13 -0
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -0
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +13 -0
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -0
- package/dist/esm/components/feature-announcements/VideoModal.d.ts +8 -0
- package/dist/esm/components/feature-announcements/VideoModal.js +1 -0
- package/dist/esm/components/feature-announcements/index.d.ts +6 -0
- package/dist/esm/components/feature-announcements/useFeatureAnnouncements.d.ts +24 -0
- package/dist/esm/components/feature-announcements/useFeatureAnnouncements.js +1 -0
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +1 -5
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +1 -1
- package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +1 -3
- package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.js +5 -6
- package/dist/esm/components/template-context-mapper/utils/TemplateConstants.d.ts +3 -13
- package/dist/esm/components/template-context-mapper/utils/TemplateConstants.js +1 -1
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +1 -7
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.js +1 -1
- package/dist/esm/components/whats-new/WhatsNew.d.ts +18 -0
- package/dist/esm/components/whats-new/WhatsNew.js +1 -0
- package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +11 -0
- package/dist/esm/components/whats-new/WhatsNew.styles.js +196 -0
- package/dist/esm/components/whats-new/WhatsNew.types.d.ts +52 -0
- package/dist/esm/components/whats-new/WhatsNewButton.d.ts +3 -0
- package/dist/esm/components/whats-new/WhatsNewButton.js +1 -0
- package/dist/esm/components/whats-new/WhatsNewPanel.d.ts +3 -0
- package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -0
- package/dist/esm/components/whats-new/WhatsNewProvider.d.ts +4 -0
- package/dist/esm/components/whats-new/WhatsNewProvider.js +1 -0
- package/dist/esm/components/whats-new/index.d.ts +7 -0
- package/dist/esm/components/whats-new/useWhatsNew.d.ts +9 -0
- package/dist/esm/components/whats-new/useWhatsNew.js +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1 -1
- package/package.json +2 -1
- package/dist/cjs/assets/icons/speedometer.svg.js +0 -1
- package/dist/esm/assets/icons/speedometer.svg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";const t=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},n=n=>{let{feature:r,currentIndex:o,totalFeatures:i,onSkip:s,onExplore:l,onPrevious:a,onNext:c}=n;return e.jsx(e.Fragment,{children:e.jsxs("div",Object.assign({style:{width:"959px",height:"274px",display:"flex",backgroundColor:"#212121",borderRadius:"4px",overflow:"hidden",position:"relative"}},{children:[e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),s()},style:{position:"absolute",top:"10px",right:"10px",background:"transparent",border:"none",color:"#BDBDBD",fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:10,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f3f4f6",e.currentTarget.style.color="#374151"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="#6b7280"}},{children:"Skip"})),e.jsx("div",Object.assign({style:{backgroundColor:"#212121",width:"480px",height:"274px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"}},{children:r.displayImage?e.jsx("img",{src:r.displayImage,alt:r.title,style:{width:"464px",height:"258px",objectFit:"cover"},onError:e=>{r.image&&(e.target.src=r.image)}}):e.jsx("div",Object.assign({style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",width:"290px",height:"258px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:"Feature Preview"}))})),e.jsxs("div",Object.assign({style:{flex:1,display:"flex",margin:"0 8px 0 0",flexDirection:"column",justifyContent:"space-between",background:"transparent"}},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:{fontSize:"16px",fontWeight:"600",padding:"36px 0 0 0",color:"#fff",lineHeight:"1.25",textAlign:"left"}},{children:r.title})),e.jsx("div",{style:{fontSize:"14px",lineHeight:"1.5",color:"rgba(255, 255, 255, 0.8)",textAlign:"left"},dangerouslySetInnerHTML:{__html:t(r.content||r.body||"")}}),e.jsx("div",{children:e.jsx("button",Object.assign({onClick:()=>{l()},style:{backgroundColor:"transparent",border:"1px solid #FEC02D",color:"#FEC02D",borderRadius:"4px",fontSize:"14px",fontWeight:"500",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"16px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(254, 192, 45, 0.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},{children:r.buttonText||"Explore the feature"}))})]}),i>1&&e.jsxs("div",Object.assign({style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",gap:"8px",alignItems:"center"}},{children:[e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),a()},disabled:0===o,style:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:0===o?"#666":"#fff",fontSize:"20px",cursor:0===o?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{0!==o&&(e.currentTarget.style.color="#FEC02D")},onMouseLeave:e=>{0!==o&&(e.currentTarget.style.color="#fff")}},{children:"‹"})),e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),c()},disabled:o===i-1,style:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:o===i-1?"#666":"#fff",fontSize:"20px",cursor:o===i-1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{o!==i-1&&(e.currentTarget.style.color="#FEC02D")},onMouseLeave:e=>{o!==i-1&&(e.currentTarget.style.color="#fff")}},{children:"›"}))]}))]}))]}))})};export{n as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FeatureAnnouncement } from './FeatureAnnouncement.types';
|
|
3
|
+
interface MinorUpdatePopupProps {
|
|
4
|
+
feature: FeatureAnnouncement;
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
totalFeatures: number;
|
|
7
|
+
onSkip: () => void;
|
|
8
|
+
onExplore: () => void;
|
|
9
|
+
onPrevious: () => void;
|
|
10
|
+
onNext: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const MinorUpdatePopup: React.FC<MinorUpdatePopupProps>;
|
|
13
|
+
export default MinorUpdatePopup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";const t=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},i=i=>{let{feature:n,currentIndex:r,totalFeatures:o,onSkip:s,onExplore:l,onPrevious:a,onNext:x}=i;return e.jsx(e.Fragment,{children:e.jsxs("div",Object.assign({style:{width:"519px",height:"160px",display:"flex",backgroundColor:"#ffffff",borderRadius:"4px",overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)"}},{children:[e.jsx("div",Object.assign({style:{backgroundColor:"#f9fafb",borderRadius:"4px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:"13px 10px 13px 10px",width:"235px",minWidth:"235px",maxWidth:"235px",height:"134px"}},{children:n.displayImage?e.jsxs("div",Object.assign({style:{position:"relative",width:"235px",height:"134px"}},{children:[e.jsx("img",{src:n.displayImage,alt:n.title,style:{width:"235px",height:"134px",objectFit:"cover",borderRadius:"4px",display:"block"},onError:e=>{n.image&&(e.target.src=n.image)}}),e.jsx("div",Object.assign({style:{position:"absolute",top:"0px",left:"0px",right:"0px",height:"27px",backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px 4px 4px 4px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10}},{children:e.jsx("span",Object.assign({style:{color:"#ffffff",fontWeight:"400",fontSize:"14px"}},{children:"New feature"}))}))]})):e.jsx("div",Object.assign({style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f3f4f6",borderRadius:"4px"}},{children:"Feature Preview"}))})),e.jsxs("div",Object.assign({style:{flex:1,display:"flex",margin:"13px 13px 13px 3px",flexDirection:"column",justifyContent:"space-between",background:"transparent"}},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:"#212121",lineHeight:"1.25",textAlign:"left"}},{children:n.title})),e.jsx("div",{style:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:"#616161",textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},dangerouslySetInnerHTML:{__html:t(n.content||n.body||"")}})]}),e.jsxs("div",Object.assign({style:{position:"absolute",bottom:"13px",right:"10px",display:"flex",gap:"16px",alignItems:"center"}},{children:[e.jsx("span",Object.assign({onClick:s,style:{color:"#4B1583",fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"}},{children:"Understood"})),n.productVideo&&e.jsx("button",Object.assign({onClick:()=>{l()},style:{backgroundColor:"#4B1583",border:"none",color:"#ffffff",borderRadius:"4px",fontSize:"14px",fontWeight:"500",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}},{children:n.buttonText||"Explore the feature"}))]}))]}))]}))})};export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";const t=t=>{let{isOpen:o,videoUrl:r,onClose:i}=t;if(!o)return null;const s=r.includes("youtube.com")||r.includes("youtu.be")?r.replace("watch?v=","embed/").replace("youtu.be/","youtube.com/embed/"):r,n=r.includes("youtube.com")||r.includes("youtu.be");return e.jsx("div",Object.assign({style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.9)",zIndex:2e3,display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},onClick:e=>{e.target===e.currentTarget&&i()}},{children:e.jsxs("div",Object.assign({style:{position:"relative",width:"90vw",height:"90vh",maxWidth:"1200px",maxHeight:"800px",backgroundColor:"black",borderRadius:"12px",overflow:"hidden",boxShadow:"0 25px 50px rgba(0, 0, 0, 0.8)"},onClick:e=>e.stopPropagation()},{children:[e.jsx("button",Object.assign({onClick:i,style:{position:"absolute",top:"20px",right:"20px",background:"rgba(0, 0, 0, 0.7)",border:"none",color:"white",fontSize:"24px",width:"40px",height:"40px",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,transition:"background-color 0.2s"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="rgba(0, 0, 0, 0.9)"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="rgba(0, 0, 0, 0.7)"}},{children:"×"})),e.jsx("div",Object.assign({style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r?n?e.jsx("iframe",{width:"100%",height:"100%",src:s,title:"Product Video",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,style:{borderRadius:"12px"}}):e.jsxs("video",Object.assign({controls:!0,autoPlay:!0,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:"12px"}},{children:[e.jsx("source",{src:r,type:"video/mp4"}),e.jsx("source",{src:r,type:"video/webm"}),e.jsx("source",{src:r,type:"video/ogg"}),"Your browser does not support the video tag."]})):e.jsx("div",Object.assign({style:{color:"white",fontSize:"18px",textAlign:"center"}},{children:"No video available"}))}))]}))}))};export{t as VideoModal};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as FeatureAnnouncementProvider } from './FeatureAnnouncementProvider';
|
|
2
|
+
export { default as MajorUpdatePopup } from './MajorUpdatePopup';
|
|
3
|
+
export { default as MinorUpdatePopup } from './MinorUpdatePopup';
|
|
4
|
+
export { VideoModal } from './VideoModal';
|
|
5
|
+
export * from './useFeatureAnnouncements';
|
|
6
|
+
export * from './FeatureAnnouncement.types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FeatureAnnouncement } from './FeatureAnnouncement.types';
|
|
2
|
+
export interface FeatureAnnouncementRepoInjected {
|
|
3
|
+
fetchVisibleFeatures: (module?: string) => Promise<[any, FeatureAnnouncement[] | null]>;
|
|
4
|
+
getStoreFeatureProgress: (storeId: string) => Promise<[any, any | null]>;
|
|
5
|
+
fetchFeatureById: (featureId: string) => Promise<[any, FeatureAnnouncement | null]>;
|
|
6
|
+
markFeatureAsViewedForStore: (storeId: string, featureId: string) => Promise<[any]>;
|
|
7
|
+
isFeatureApplicableToCurrentPage: (feature: FeatureAnnouncement) => boolean;
|
|
8
|
+
module?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RouterProps {
|
|
11
|
+
pathname: string;
|
|
12
|
+
query: Record<string, string | string[] | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export declare const useFeatureAnnouncements: ({ fetchVisibleFeatures, getStoreFeatureProgress, fetchFeatureById, markFeatureAsViewedForStore, isFeatureApplicableToCurrentPage, module, router, }: FeatureAnnouncementRepoInjected & {
|
|
15
|
+
router?: RouterProps | undefined;
|
|
16
|
+
}) => {
|
|
17
|
+
features: FeatureAnnouncement[];
|
|
18
|
+
majorUpdateFeatures: FeatureAnnouncement[];
|
|
19
|
+
minorUpdateFeatures: FeatureAnnouncement[];
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
error: string | null;
|
|
22
|
+
markFeatureAsViewed: (featureId: string) => Promise<void>;
|
|
23
|
+
refetch: () => Promise<void>;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useState as t,useCallback as r,useEffect as o}from"react";const a=a=>{let{fetchVisibleFeatures:n,getStoreFeatureProgress:i,fetchFeatureById:l,markFeatureAsViewedForStore:u,isFeatureApplicableToCurrentPage:s,module:d,router:c}=a;const f=(()=>{const[e,r]=t(null);return o((()=>{if("undefined"!=typeof window){let e=null;try{if(e=localStorage.getItem("storeId")||localStorage.getItem("Bik/StoreId")||localStorage.getItem("currentStore")||localStorage.getItem("store"),!e){const t=localStorage.getItem("Bik/CurrentUser");t&&(e=JSON.parse(t).storeId)}e||(e=new URLSearchParams(window.location.search).get("storeId"))}catch(e){console.error("FeatureAnnouncements: Failed to get store ID",e)}r(e)}}),[]),e})(),[p,g]=t([]),[y,m]=t([]),[v,w]=t([]),[F,h]=t(!1),[D,U]=t(null),x=r((()=>e(void 0,void 0,void 0,(function*(){if(f){h(!0),U(null);try{const[e,t]=yield n(d);if(e||!t)return console.error("FeatureAnnouncements: Failed to fetch features",e),void U("Failed to fetch features");const[r,o]=yield i(f);r&&console.warn("FeatureAnnouncements: Progress fetch failed, treating all features as new",r);const a=new Date,l="undefined"!=typeof window?window.location.pathname:"",u=e=>{if(!e.expirationDate)return!0;let t;return"object"==typeof e.expirationDate&&null!==e.expirationDate&&("seconds"in e.expirationDate||"nanoseconds"in e.expirationDate)?t=new Date(1e3*e.expirationDate.seconds):"string"==typeof e.expirationDate?t=new Date(e.expirationDate):e.expirationDate instanceof Date&&(t=e.expirationDate),!(!t||isNaN(t.getTime()))&&a<t},c=e=>{if("Major"===e.featureUpdateType){let t=[];return Array.isArray(e.pageUrls)?t=e.pageUrls:"object"==typeof e.pageUrls&&null!==e.pageUrls&&"length"in e.pageUrls&&(t=Array.from(e.pageUrls)),t.includes(l)}return!0},p=t.filter((e=>{var t;return!((null===(t=null==o?void 0:o.viewedFeatures)||void 0===t?void 0:t[e.id])||!1)&&s(e)&&u(e)&&c(e)})),y=p.filter((e=>"Major"===e.featureUpdateType)),v=p.filter((e=>"Minor"===e.featureUpdateType));g(p),m(y),setTimeout((()=>{w(v)}),2e3)}catch(e){console.error("FeatureAnnouncements: Unexpected error in fetchFeatures",e),U("An unexpected error occurred")}finally{h(!1)}}}))),[f,n,i,s,d]),I=r((t=>e(void 0,void 0,void 0,(function*(){h(!0),U(null);try{const[e,r]=yield l(t);if(e||!r)return void U("Failed to fetch feature by ID");"Major"===r.featureUpdateType?m([r]):w([r]),g([r])}catch(e){U("An unexpected error occurred while fetching by ID")}finally{h(!1)}}))),[l]),A=r((t=>e(void 0,void 0,void 0,(function*(){if(!f)return;const[e]=yield u(f,t);e?(console.warn("FeatureAnnouncements: Failed to mark feature as viewed, removing from local state anyway",e),g((e=>e.filter((e=>e.id!==t)))),m((e=>e.filter((e=>e.id!==t)))),w((e=>e.filter((e=>e.id!==t))))):(g((e=>e.filter((e=>e.id!==t)))),m((e=>e.filter((e=>e.id!==t)))),w((e=>e.filter((e=>e.id!==t)))))}))),[f,u]);return o((()=>{if(!c)return void x();const e=c.query.featureId;e?I(e):x()}),[null==c?void 0:c.query,x,I]),{features:p,majorUpdateFeatures:y,minorUpdateFeatures:v,isLoading:F,error:D,markFeatureAsViewed:A,refetch:x}};export{a as useFeatureAnnouncements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{cloneDeep as l}from"lodash";import{useEffect as t,useState as o,useRef as i,useMemo as
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{cloneDeep as l}from"lodash";import{useEffect as t,useState as o,useRef as i,useMemo as r}from"react";import a from"../../utils/StringUtils.js";import{COLORS as s}from"../../constants/Theme.js";import{StyledModal as n}from"../modals/styledModal.js";import{determineCardIndex as d,isItCarousal as u,isRCSChannel as p}from"../template-preview/helpers/templateMiscHelper.js";import{CHANNEL_TYPE as c}from"../template-preview/models/Channels.js";import{TEMPLATE_QUALITY as m,POD as v}from"../template-preview/models/WhatsAppTemplate.js";import{TemplateModalContext as h}from"./context/templateModalContext.js";import b from"./modalElements/Footer.js";import{TemplateAnalyticsComponent as C}from"./modalElements/TemplateAnalyticsComponent.js";import f from"./modalElements/TemplateSelectModalContent.js";import{convertPlaceholdersToBikDropdown as x}from"./utils/convertPlaceholdersToBikDropdown.js";const g=g=>{var y,P,E,I,T,S,j,w;const{selectedTemplate:D,closeDialog:V,showVariableMapping:k,channel:L,htmlContent:A,templateVariables:B,onTemplateSelect:M,globalPlaceholders:F,showOnlyContent:H,whatsappSpecificPickerMeta:O,zIndex:W,showVariableModal:N,variableList:$,discountCode:z,setDiscountCode:_,onBackPress:Q,enabledCustomText:R,variableListForImage:U,showSampleValues:q,disableEditVariable:G,pod:J,extras:K,pickerConf:X,selectedCarouselProducts:Y,disableEditExpiry:Z,cardWidth:ee,onDeleteSelectedProducts:le,fileName:te,setFileName:oe,hideDeviceContainerInPreview:ie,maxCharLimit:re,onDefaultVariableSelect:ae,skipDefaultVariableContent:se,disableDatePicker:ne,disableCopyCode:de,initialExpiryDateTime:ue,showDiscountCodeExpiryInfo:pe,footerButtonText:ce,footerInfoText:me,templateAnalytics:ve}=g;t((()=>{Ee(A)}),[A]);const he=d(L),be=u(L,D),Ce=null==D?void 0:D.isProductCarouselType,[fe,xe]=o(L===c.EMAIL||L==c.WEBPUSH||be?"desktop":"mobile"),[ge,ye]=o(!1),[Pe,Ee]=o(A),[Ie,Te]=o(!1),[Se,je]=o([]),[we,De]=o({}),[Ve,ke]=o(D),[Le,Ae]=o([]),[Be,Me]=o(null),[Fe,He]=o(!1),[Oe,We]=o(null!=B?B:[]),[Ne,$e]=o(!1),[ze,_e]=o(be?(null===(P=null===(y=null==Ve?void 0:Ve.mapping)||void 0===y?void 0:y.body)||void 0===P?void 0:P.length)?-1:0:-1),[Qe,Re]=o([]),[Ue,qe]=o(void 0),Ge=i(null),[Je,Ke]=o(!1),[Xe,Ye]=o(!1),[Ze,el]=o(!1),[ll,tl]=o(!0),[ol,il]=o(!0),[rl,al]=o({});t((()=>{Y?Re(Y):Ce&&Re([])}),[Y]),t((()=>{var e;if(!Fe&&Ce&&(!Y||0===Re.length)){const l=null===(e=null==Ve?void 0:Ve.components)||void 0===e?void 0:e[he].cards,t=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,o,i;"HEADER"===e.type&&t.push(null!==(i=null===(o=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===o?void 0:o[0])&&void 0!==i?i:"")}))})),Ae(t),He(!0)}}),[Fe]);const sl=r((()=>x(F)),[F]);return t((()=>{qe(l($))}),[$]),(null==ve?void 0:ve.show)&&ll&&ve.templateQuality&&Object.values(m).find((e=>e===String(ve.templateQuality)))?e.jsx(C,{headingTitle:null==Ve?void 0:Ve.label,headingSubtitle:L===c.WHATSAPP?`${a.capitaliseFirstLetterOfString(null!==(E=null==Ve?void 0:Ve.category)&&void 0!==E?E:"")} • ${null!==(I=null==Ve?void 0:Ve.templateCategory)&&void 0!==I?I:""}`:"",templateAnalytics:ve,onClose:()=>{null==V||V(),tl(!1),il(!1)},onCancel:()=>{tl(!1),il(!1)},onProceed:()=>{tl(!1),il(!0)},templateId:(null==Ve?void 0:Ve.templateId)||""}):e.jsx(h.Provider,Object.assign({value:{hideFooterButton:Ze,setHideFooterButton:el,hideCrossButton:Xe,setHideCrossButton:Ye,variableList:Ue,setVariableList:qe,variableCallback:Be,setVariableCallback:Me,showVariablePicker:ge,setShowVariablePicker:ye,template:Ve,setTemplate:ke,device:fe,setDevice:xe,display_content:Pe,setDisplayContent:Ee,originalVariableList:Oe,setOriginalVariableList:We,isError:Ie,setIsError:Te,channel:L,globalNormalizedPlaceholders:sl,templateSelectionTriggered:Ne,setTemplateSelectionTriggered:$e,enabledCustomText:R,disableEditVariable:G,pod:J,extras:K,isWhatsappCarousel:be,selectedCarouselIndex:ze,setSelectedCarouselIndex:_e,isProductCarouselType:Ce,templateErrorIndexes:we,cardCount:be?null===(S=null===(T=D.components)||void 0===T?void 0:T[he].cards)||void 0===S?void 0:S.length:void 0,errorIndexes:Se,setErrorIndexes:je,pickerConf:X,carouselProducts:Qe,setCarouselProducts:Re,disableEditExpiry:Z,cardWidth:ee,cardImages:Le,onDeleteSelectedProducts:le,hideDeviceContainerInPreview:ie,sliderRef:Ge,isCarouselHovered:Je,setIsCarouselHovered:Ke,maxCharLimit:re,ctaOptionsErrors:rl,setCtaOptionsErrors:al,onDefaultVariableSelect:ae,disableDatePicker:ne,disableCopyCode:de,initialExpiryDateTime:ue,showDiscountCodeExpiryInfo:pe,cardIndex:he}},{children:H?e.jsx(f,{variableListFromProps:$,channel:c.EMAIL,hideHeader:!0}):e.jsxs(n,Object.assign({hideCrossButton:Xe,zIndex:W,centralContainerStyles:{width:be?900:L===c.EMAIL&&k?1e3:800},open:ol,onClose:()=>{il(!1),null==V||V()},headingTitle:null==Ve?void 0:Ve.label,headingSubtitle:L===c.WHATSAPP||p(L)?`${a.capitaliseFirstLetterOfString(null!==(j=null==Ve?void 0:Ve.category)&&void 0!==j?j:"")} • ${null!==(w=null==Ve?void 0:Ve.templateCategory)&&void 0!==w?w:""}`:"",onBackPress:()=>{if(null==ve?void 0:ve.show)return tl(!0),void il(!1);null==Q||Q()},modalHeaderStyles:{borderBottom:`1px solid ${s.stroke.primary}`}},{children:[e.jsx(f,{variableListFromProps:$,showSampleValues:q,showVariableMapping:k,channel:L,whatsappSpecificPickerMeta:O,showVariableModal:N,discountCode:z,setDiscountCode:_,variableListForImage:U&&(null==U?void 0:U.length)>0?U:Ue,fileName:te,setFileName:e=>{null==oe||oe(e)},skipDefaultVariableContent:se}),M?e.jsx(b,{isWhatsappCarousel:null!=be&&be,onSelect:function(){var e;if((null==Qe?void 0:Qe.length)<1&&Ce)return void Te(!0);if(Object.keys(rl).length>0&&J!==v.CHATBOT)return void Te(!0);const l=null==M?void 0:M(Ve,Oe,null!=Pe?Pe:"",Qe);De(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&je(l.errorIndexes),(null==l?void 0:l.error)&&Te(!!(null==l?void 0:l.error))):$e(!0)},footerButtonText:ce,footerInfoText:me}):e.jsx(e.Fragment,{})]}))}))};export{g as TemplateContextMapper};
|
package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TemplateAnalyticsComponentI, TemplateAnalyticsDataI } from "../../template-preview/models/WhatsAppTemplate";
|
|
2
2
|
export declare const TemplateAnalyticsComponent: (props: TemplateAnalyticsComponentI) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const RightPanelTemplateAnalytics: (props: {
|
|
4
4
|
analyticsData: TemplateAnalyticsDataI;
|
|
5
5
|
skipTitle?: boolean;
|
|
6
|
-
fullWidth?: boolean;
|
|
7
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export declare const AnalyticsItem: (props: {
|
|
9
8
|
icon: React.ElementType;
|
|
@@ -11,6 +10,3 @@ export declare const AnalyticsItem: (props: {
|
|
|
11
10
|
value: number;
|
|
12
11
|
percentValue?: number;
|
|
13
12
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const QualityTimelineChart: (props: {
|
|
15
|
-
qualityTimeLine: TEMPLATE_QUALITY[];
|
|
16
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../../../assets/icons/
|
|
1
|
+
import{j as e}from"../../../node_modules/react/jsx-runtime.js";import t from"../../../assets/icons/alert_triangle.svg.js";import n from"../../../assets/icons/click.svg.js";import{useState as s,useEffect as l,useMemo as i}from"react";import{StyledModal as a}from"../../modals/styledModal.js";import{Tag as c}from"../../tag/Tag.js";import{TEMPLATE_QUALITY as r}from"../../template-preview/models/WhatsAppTemplate.js";import{TitleRegular as o,TitleSmall as d,Caption as m}from"../../TypographyStyle.js";import{COLORS as j}from"../../../constants/Theme.js";import{TemplateContainer as p,LeftPanelContainer as u,RightPanelContainer as y,CustomTitleMedium as h}from"../styles/TemplateAnalyticsStyles.js";import{TEMPLATE_QUALITY_MAP as x,ANALYTICS_ENGAGEMENT_MAP as g}from"../utils/TemplateConstants.js";import{TemplateAnalyticsSkeleton as b}from"./TemplateAnalyticsSkeleton.js";const T=n=>{const{templateAnalytics:c,onClose:d,onProceed:y,onCancel:h,headingTitle:g,headingSubtitle:T,templateId:v}=n,{templateQuality:f=r.GREEN,fetchAnalytics:N}=c||{},{icon:O,title:C,subline:A,sublineTextType:B,sublineColor:w}=x[f||r.GREEN],[E,S]=s({}),[G,P]=s(!0);l((()=>{null==N||N(v||"").then((e=>{e.analytics&&S(e.analytics),P(!1)}))}),[]);const V=i((()=>f===r.GREEN?{primaryButton:{buttonText:"Proceed with selection",buttonType:"primary",onClick:y,disabled:G},secondaryButton:{buttonText:"Cancel",buttonType:"tertiaryGray",onClick:()=>{null==d||d(),null==h||h()},disabled:G}}:{primaryButton:{buttonText:"Cancel",buttonType:"primary",onClick:()=>{null==d||d(),null==h||h()},disabled:G},secondaryButton:{buttonText:"Proceed with selection",buttonType:"secondary",onClick:y,disabled:G}}),[f,G]),F=B||m;return e.jsx(a,Object.assign({open:!0,headingTitle:g,tintedHeader:!0,modalHeaderStyles:{backgroundColor:j.surface.subdued},onBackPress:()=>{null==d||d()},headingSubtitle:T,footerShadow:!0,primaryButton:V.primaryButton,secondaryButton:V.secondaryButton,onClose:()=>{null==d||d()},width:"700px"},{children:e.jsxs(p,{children:[e.jsx(u,{children:e.jsxs("div",Object.assign({className:"inside--container"},{children:[O&&e.jsx("div",Object.assign({className:"icon--container"},{children:e.jsx(t,{width:40,height:40,color:j.content.warning})})),C&&e.jsx(o,Object.assign({style:{textAlign:"center"}},{children:C})),e.jsx(F,Object.assign({style:{textAlign:"center",color:w||j.content.primary}},{children:A}))]}))}),G?e.jsx(b,{}):e.jsx(k,{analyticsData:E,skipTitle:f==r.GREEN})]})}))},k=t=>{const{analyticsData:s,skipTitle:l}=t;return e.jsxs(y,{children:[l?e.jsx(e.Fragment,{}):e.jsx(d,{children:"Here are your template's delivery & engagement stats for the last 30 days"}),e.jsx("div",Object.assign({className:"mt-3"},{children:g.map(((t,n)=>e.jsx(v,{icon:t.icon,title:t.title,value:s[t.valName]||0,percentValue:t.percentValName?s[t.percentValName]:null},n)))})),(null==s?void 0:s.clickAnalytics)&&Object.keys(null==s?void 0:s.clickAnalytics)&&Object.keys(null==s?void 0:s.clickAnalytics).length?e.jsxs(e.Fragment,{children:[e.jsx(d,Object.assign({color:j.content.secondary},{children:"Clicked"})),e.jsx("div",Object.assign({className:"mt-3"},{children:Object.entries(s.clickAnalytics).map(((t,s)=>{let[l,i]=t;return e.jsx(v,{icon:n,title:l,value:i.totalClicks||0,percentValue:i.clickPercentage},s)}))}))]}):e.jsx(e.Fragment,{})]})},v=t=>{const{icon:n,title:s,value:l,percentValue:i}=t;return e.jsxs("div",Object.assign({className:"each--analytics--container"},{children:[e.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[e.jsx("div",Object.assign({className:"each--icon--container"},{children:e.jsx(n,{width:"16px",height:"16px",color:j.background.brand})})),e.jsx(m,{children:s})]})),e.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[i?e.jsx(c,{tagText:`${i}%`||0,theme:"light",type:"neutral"}):e.jsx(e.Fragment,{}),e.jsx(h,{children:l})]}))]}))};export{v as AnalyticsItem,k as RightPanelTemplateAnalytics,T as TemplateAnalyticsComponent};
|
package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"../../../node_modules/react/jsx-runtime.js";import{BikShimmer as e}from"../../shimmer/ShimmerComponent/BikShimmer.js";import{RightPanelContainer as i}from"../styles/TemplateAnalyticsStyles.js";const t=t=>{const{skipTitleShimmer:h
|
|
1
|
+
import{j as s}from"../../../node_modules/react/jsx-runtime.js";import{BikShimmer as e}from"../../shimmer/ShimmerComponent/BikShimmer.js";import{RightPanelContainer as i}from"../styles/TemplateAnalyticsStyles.js";const t=t=>{const{skipTitleShimmer:h}=t;return s.jsxs(i,{children:[s.jsx("div",{children:h?s.jsx(s.Fragment,{}):s.jsx(e,{boxes:[{width:"76px",height:"18px"}]})}),s.jsx("div",Object.assign({className:"mt-3"},{children:[0,1,2].map((e=>s.jsx(x,{},e)))})),s.jsxs(s.Fragment,{children:[s.jsx("div",{children:s.jsx(e,{boxes:[{width:"76px",height:"18px"}]})}),s.jsx("div",Object.assign({className:"mt-3"},{children:s.jsx(x,{})}))]})]})},x=()=>s.jsxs("div",Object.assign({className:"each--analytics--container"},{children:[s.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[s.jsx(e,{boxes:[{width:"24px",height:"24px"}]}),s.jsx(e,{boxes:[{width:"69px",height:"11px"}]})]})),s.jsxs("div",Object.assign({className:"d-flex align--center",style:{gap:8}},{children:[s.jsx(e,{boxes:[{width:"43px",height:"18px"}]}),s.jsx(e,{boxes:[{width:"69px",height:"28px"}]})]}))]}));export{t as TemplateAnalyticsSkeleton};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare const TemplateContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const RightPanelContainer: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
-
fullWidth?: boolean | undefined;
|
|
4
|
-
}, never>;
|
|
2
|
+
export declare const RightPanelContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
3
|
export declare const LeftPanelContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
4
|
export declare const CustomTitleMedium: import("styled-components").StyledComponent<"div", any, {
|
|
7
5
|
numberOfLines?: number | undefined;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import e from"styled-components";import{TitleMedium as i}from"../../TypographyStyle.js";import{COLORS as t}from"../../../constants/Theme.js";const n=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
padding: 16px 0px;
|
|
4
|
-
`,
|
|
5
|
-
max-width:
|
|
4
|
+
`,r=e.div`
|
|
5
|
+
max-width: 450px;
|
|
6
6
|
height: 456px;
|
|
7
7
|
min-width: 358px;
|
|
8
8
|
overflow-y: auto;
|
|
9
|
-
border-left: ${
|
|
9
|
+
border-left: ${t.stroke.primary} 1px solid;
|
|
10
10
|
padding: 0px 23px 32px 23px;
|
|
11
11
|
gap: 16px;
|
|
12
|
-
${e=>e.fullWidth&&"flex: 1;"}
|
|
13
12
|
.each--analytics--container {
|
|
14
13
|
border: 1px solid ${t.background.inactive};
|
|
15
14
|
border-radius: 8px;
|
|
@@ -32,7 +31,7 @@ import e from"styled-components";import{TitleMedium as i}from"../../TypographySt
|
|
|
32
31
|
.align--center {
|
|
33
32
|
align-items: center;
|
|
34
33
|
}
|
|
35
|
-
`,
|
|
34
|
+
`,o=e.div`
|
|
36
35
|
padding: 0px 23px 32px 23px;
|
|
37
36
|
flex: 1;
|
|
38
37
|
height: 456px;
|
|
@@ -61,4 +60,4 @@ import e from"styled-components";import{TitleMedium as i}from"../../TypographySt
|
|
|
61
60
|
max-width: 161px;
|
|
62
61
|
overflow: hidden;
|
|
63
62
|
text-overflow: ellipsis;
|
|
64
|
-
`;export{p as CustomTitleMedium,
|
|
63
|
+
`;export{p as CustomTitleMedium,o as LeftPanelContainer,r as RightPanelContainer,n as TemplateContainer};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const TEMPLATE_QUALITY_MAP: {
|
|
3
3
|
YELLOW: {
|
|
4
|
-
|
|
4
|
+
icon: import("react").FunctionComponent<import("react").SVGAttributes<SVGElement>>;
|
|
5
5
|
title: string;
|
|
6
6
|
sublineTextType: import("styled-components").StyledComponent<"div", any, {
|
|
7
7
|
numberOfLines?: number | undefined;
|
|
@@ -11,7 +11,7 @@ export declare const TEMPLATE_QUALITY_MAP: {
|
|
|
11
11
|
subline: string;
|
|
12
12
|
};
|
|
13
13
|
RED: {
|
|
14
|
-
|
|
14
|
+
icon: import("react").FunctionComponent<import("react").SVGAttributes<SVGElement>>;
|
|
15
15
|
title: string;
|
|
16
16
|
sublineTextType: import("styled-components").StyledComponent<"div", any, {
|
|
17
17
|
numberOfLines?: number | undefined;
|
|
@@ -21,17 +21,7 @@ export declare const TEMPLATE_QUALITY_MAP: {
|
|
|
21
21
|
subline: string;
|
|
22
22
|
};
|
|
23
23
|
GREEN: {
|
|
24
|
-
|
|
25
|
-
title: string;
|
|
26
|
-
sublineTextType: import("styled-components").StyledComponent<"div", any, {
|
|
27
|
-
numberOfLines?: number | undefined;
|
|
28
|
-
color?: string | undefined;
|
|
29
|
-
}, never>;
|
|
30
|
-
sublineColor: string;
|
|
31
|
-
subline: string;
|
|
32
|
-
};
|
|
33
|
-
UNKNOWN: {
|
|
34
|
-
Icon: import("react").FunctionComponent<import("react").SVGAttributes<SVGElement>>;
|
|
24
|
+
icon: string;
|
|
35
25
|
title: string;
|
|
36
26
|
sublineTextType: import("styled-components").StyledComponent<"div", any, {
|
|
37
27
|
numberOfLines?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../assets/icons/alert_triangle.svg.js";import t from"../../../assets/icons/
|
|
1
|
+
import e from"../../../assets/icons/alert_triangle.svg.js";import t from"../../../assets/icons/send_template.svg.js";import a from"../../../assets/icons/tick.svg.js";import i from"../../../assets/icons/tick_double.svg.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as o}from"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{TEMPLATE_QUALITY as r}from"../../template-preview/models/WhatsAppTemplate.js";import"../../template-preview/models/Channels.js";import{Caption as n,TitleSmall as s}from"../../TypographyStyle.js";const l={[r.YELLOW]:{icon:e,title:"Medium quality template",sublineTextType:n,sublineColor:o.content.secondary,subline:"Meta has downgraded this template to a medium-quality rating due to negative feedback from multiple customers or low read rates. We recommend improving its content or choosing a different template to enhance delivery and engagement in your next campaign"},[r.RED]:{icon:e,title:"Low quality template",sublineTextType:n,sublineColor:o.content.secondary,subline:"Meta has downgraded this template to a low-quality rating due to negative feedback from multiple customers or low read rates. We recommend improving its content or choosing a different template to enhance delivery and engagement in your next campaign"},[r.GREEN]:{icon:"",title:"",sublineTextType:s,sublineColor:"",subline:"Here is your template's delivery and engagement stats from the last 30 days. Higher engagement today can lead to better delivery rates in the future."}},m=[{title:"Sent",icon:t,valName:"totalSent"},{title:"Delivered",icon:a,valName:"totalDelivered",percentValName:"deliveredPercentage"},{title:"Read",icon:i,valName:"totalReads",percentValName:"readPercentage"}];export{m as ANALYTICS_ENGAGEMENT_MAP,l as TEMPLATE_QUALITY_MAP};
|
|
@@ -210,8 +210,7 @@ export type WhatsappPreviewButtonType = {
|
|
|
210
210
|
export declare enum TEMPLATE_QUALITY {
|
|
211
211
|
GREEN = "GREEN",
|
|
212
212
|
YELLOW = "YELLOW",
|
|
213
|
-
RED = "RED"
|
|
214
|
-
UNKNOWN = "UNKNOWN"
|
|
213
|
+
RED = "RED"
|
|
215
214
|
}
|
|
216
215
|
export type WhatsappMeta = {
|
|
217
216
|
containerStyle?: React.CSSProperties | undefined;
|
|
@@ -306,7 +305,6 @@ export type TemplateAnalyticsI = {
|
|
|
306
305
|
fetchAnalytics?: (templateId: string) => Promise<TemplateAnalyticsResponseI>;
|
|
307
306
|
show?: boolean;
|
|
308
307
|
templateQuality?: TEMPLATE_QUALITY;
|
|
309
|
-
data?: TemplateAnalyticsDataI;
|
|
310
308
|
};
|
|
311
309
|
export type TemplateAnalyticsResponseI = {
|
|
312
310
|
success: boolean;
|
|
@@ -324,9 +322,6 @@ export interface TemplateAnalyticsDataI {
|
|
|
324
322
|
clickPercentage: number;
|
|
325
323
|
};
|
|
326
324
|
};
|
|
327
|
-
performance: {
|
|
328
|
-
qualityTimeLine: TEMPLATE_QUALITY[];
|
|
329
|
-
};
|
|
330
325
|
}
|
|
331
326
|
export interface TemplateAnalyticsComponentI {
|
|
332
327
|
templateAnalytics?: TemplateAnalyticsI;
|
|
@@ -336,5 +331,4 @@ export interface TemplateAnalyticsComponentI {
|
|
|
336
331
|
onCancel?: () => void;
|
|
337
332
|
headingTitle?: string;
|
|
338
333
|
headingSubtitle?: string;
|
|
339
|
-
analyticsData?: TemplateAnalyticsDataI;
|
|
340
334
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var N,
|
|
1
|
+
var E,N,O;!function(E){E.GREEN="GREEN",E.YELLOW="YELLOW",E.RED="RED"}(E||(E={})),function(E){E.QUICK_REPLY="QUICK_REPLY",E.URL="URL",E.PHONE_NUMBER="PHONE_NUMBER",E.COPY_CODE="COPY_CODE"}(N||(N={})),function(E){E.CHATBOT="CHATBOT",E.GROWTH="GROWTH",E.CAMPAIGN="CAMPAIGN",E.CRM="CRM",E.INTEGRATIONS="INTEGRATIONS",E.OPENAI="OPENAI",E.DM="DM",E.FRONTEND="FRONTEND"}(O||(O={}));export{N as BUTTON_TYPE,O as POD,E as TEMPLATE_QUALITY};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WhatsNewContent } from './WhatsNew.types';
|
|
3
|
+
interface WhatsNewProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
tooltip?: string;
|
|
6
|
+
searchPlaceholder?: string;
|
|
7
|
+
emptyStateTitle?: string;
|
|
8
|
+
emptyStateDescription?: string;
|
|
9
|
+
noResultsText?: string;
|
|
10
|
+
width?: string;
|
|
11
|
+
onContentClick?: (content: WhatsNewContent) => void;
|
|
12
|
+
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
13
|
+
buttonTestId?: string;
|
|
14
|
+
iconWidth?: number;
|
|
15
|
+
iconHeight?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const WhatsNew: React.FC<WhatsNewProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"../../node_modules/react/jsx-runtime.js";import{useState as e}from"react";import{WhatsNewButton as o}from"./WhatsNewButton.js";import{WhatsNewPanel as n}from"./WhatsNewPanel.js";import{useWhatsNewContext as s}from"./WhatsNewProvider.js";const i=i=>{let{title:r="What's new",tooltip:a="What's new",searchPlaceholder:h="Search posts",emptyStateTitle:c="Nothing new!",emptyStateDescription:l="There are no new updates or features at the moment. Check back soon!",noResultsText:m="Sorry, no results found.",width:d="480px",onContentClick:p,renderCustomContent:u,buttonTestId:C="whats-new-button",iconWidth:w=32,iconHeight:j=32}=i;const[x,f]=e(!1),{whatsNewContent:g,isLoading:W,newContentCount:S}=s();return t.jsxs(t.Fragment,{children:[t.jsx(o,{onClick:()=>f(!0),newContentCount:S,isOpen:x,isLoading:W,tooltip:a,testId:C,iconWidth:w,iconHeight:j}),t.jsx(n,{isOpen:x,onClose:()=>f(!1),content:g,isLoading:W,title:r,searchPlaceholder:h,emptyStateTitle:c,emptyStateDescription:l,noResultsText:m,width:d,onContentClick:t=>{p&&p(t)},renderCustomContent:u})]})};export{i as WhatsNew};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const WhatsNewIconContainer: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
count?: number | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const WhatsNewWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const MainContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const MainCardContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const BackgroundImageContainer: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
imageUrl: string;
|
|
9
|
+
height?: string | undefined;
|
|
10
|
+
width?: string | undefined;
|
|
11
|
+
}, never>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import e from"styled-components";import{COLORS as t}from"../../constants/Theme.js";const i=e.div`
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
position: relative;
|
|
4
|
+
|
|
5
|
+
.main-icon-class {
|
|
6
|
+
padding: 6px;
|
|
7
|
+
border-radius: 32px;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
transition: background-color 0.2s ease;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon-active {
|
|
15
|
+
background: ${t.background.brandLight};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.main-icon-class:hover {
|
|
19
|
+
background: ${t.background.base};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.notification--count {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 6px;
|
|
26
|
+
top: 4px;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
width: 14px;
|
|
29
|
+
height: 14px;
|
|
30
|
+
background: ${t.background.negative.vibrant};
|
|
31
|
+
border: 1.25px solid ${t.surface.standard};
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.count--text {
|
|
38
|
+
font-size: 8px;
|
|
39
|
+
line-height: 7.2px;
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
color: ${t.surface.standard};
|
|
42
|
+
}
|
|
43
|
+
`,n=e.div`
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
height: 100%;
|
|
48
|
+
max-height: calc(100vh - 60px);
|
|
49
|
+
|
|
50
|
+
&::-webkit-scrollbar {
|
|
51
|
+
display: block;
|
|
52
|
+
width: 6px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::-webkit-scrollbar-thumb {
|
|
56
|
+
background: ${t.content.inactive};
|
|
57
|
+
border-radius: 3px;
|
|
58
|
+
min-height: 30px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.icon--wrapper {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
width: 64px;
|
|
66
|
+
height: 64px;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
background: ${t.background.base};
|
|
69
|
+
margin-bottom: 16px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.no--data--found {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
align-items: center;
|
|
77
|
+
height: 300px;
|
|
78
|
+
text-align: center;
|
|
79
|
+
padding: 24px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.text--align {
|
|
83
|
+
text-align: center;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.scroller {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: 16px;
|
|
90
|
+
padding: 16px 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.full--width {
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.flex {
|
|
98
|
+
display: flex;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.flex--row {
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.flex--column {
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mt-8 {
|
|
110
|
+
margin-top: 8px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.mt-20 {
|
|
114
|
+
margin-top: 20px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.mt--8 {
|
|
118
|
+
margin-top: 8px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mt--12 {
|
|
122
|
+
margin-top: 12px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.mb-mt-8 {
|
|
126
|
+
margin-bottom: 8px;
|
|
127
|
+
margin-top: 8px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.padding--16 {
|
|
131
|
+
padding: 16px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.card--desc {
|
|
135
|
+
max-height: 200px;
|
|
136
|
+
overflow-y: auto;
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
color: ${t.content.secondary};
|
|
139
|
+
|
|
140
|
+
p {
|
|
141
|
+
margin-bottom: 0px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.created--at {
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: 4px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.new--content--tag {
|
|
151
|
+
padding: 2px 6px;
|
|
152
|
+
gap: 4px;
|
|
153
|
+
border-radius: 14px;
|
|
154
|
+
background: ${t.background.warning.vibrant};
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
align-items: center;
|
|
158
|
+
margin-right: 8px;
|
|
159
|
+
}
|
|
160
|
+
`,r=e.div`
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
height: 100%;
|
|
164
|
+
`,o=e.div`
|
|
165
|
+
background: ${t.surface.standard};
|
|
166
|
+
border-radius: 8px;
|
|
167
|
+
border: 1px solid ${t.stroke.primary};
|
|
168
|
+
padding: 16px;
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: 8px;
|
|
172
|
+
transition: all 0.2s ease;
|
|
173
|
+
|
|
174
|
+
&:hover {
|
|
175
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
176
|
+
}
|
|
177
|
+
`,a=e.div`
|
|
178
|
+
background-image: url(${e=>e.imageUrl});
|
|
179
|
+
background-size: cover;
|
|
180
|
+
background-position: center;
|
|
181
|
+
background-repeat: no-repeat;
|
|
182
|
+
height: ${e=>e.height||"200px"};
|
|
183
|
+
width: ${e=>e.width||"100%"};
|
|
184
|
+
border-radius: 4px;
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
|
|
189
|
+
&:empty::after {
|
|
190
|
+
content: '';
|
|
191
|
+
background: ${t.background.base};
|
|
192
|
+
width: 100%;
|
|
193
|
+
height: 100%;
|
|
194
|
+
border-radius: 4px;
|
|
195
|
+
}
|
|
196
|
+
`;export{a as BackgroundImageContainer,o as MainCardContainer,r as MainContainer,i as WhatsNewIconContainer,n as WhatsNewWrapper};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface WhatsNewContent {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
body: string;
|
|
6
|
+
content: string;
|
|
7
|
+
image: string;
|
|
8
|
+
buttonText: string;
|
|
9
|
+
redirectUrl: string;
|
|
10
|
+
docId?: string;
|
|
11
|
+
createdAt: any;
|
|
12
|
+
module: string[];
|
|
13
|
+
visibility: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface WhatsNewProviderProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
|
|
18
|
+
markContentAsViewed?: (contentId: string) => Promise<void>;
|
|
19
|
+
module?: string;
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface WhatsNewButtonProps {
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
newContentCount?: number;
|
|
25
|
+
isOpen?: boolean;
|
|
26
|
+
isLoading?: boolean;
|
|
27
|
+
tooltip?: string;
|
|
28
|
+
testId?: string;
|
|
29
|
+
iconWidth?: number;
|
|
30
|
+
iconHeight?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface WhatsNewPanelProps {
|
|
33
|
+
isOpen: boolean;
|
|
34
|
+
onClose: () => void;
|
|
35
|
+
content: WhatsNewContent[];
|
|
36
|
+
isLoading?: boolean;
|
|
37
|
+
title?: string;
|
|
38
|
+
searchPlaceholder?: string;
|
|
39
|
+
emptyStateTitle?: string;
|
|
40
|
+
emptyStateDescription?: string;
|
|
41
|
+
noResultsText?: string;
|
|
42
|
+
width?: string;
|
|
43
|
+
onContentClick?: (content: WhatsNewContent) => void;
|
|
44
|
+
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export interface WhatsNewHookReturn {
|
|
47
|
+
whatsNewContent: WhatsNewContent[];
|
|
48
|
+
isLoading: boolean;
|
|
49
|
+
newContentCount: number;
|
|
50
|
+
markAsViewed: (contentId: string) => Promise<void>;
|
|
51
|
+
refreshContent: () => Promise<void>;
|
|
52
|
+
}
|