@bikdotai/bik-component-library 0.0.725 → 0.0.726-beta.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/assets/icons/searchIcon.svg.js +1 -0
- package/dist/cjs/assets/icons/whatsNew.svg.js +1 -0
- 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/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +2 -0
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +2 -2
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -0
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.d.ts +4 -0
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -0
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +4 -0
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -0
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +4 -0
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -0
- package/dist/cjs/components/feature-announcements/VideoModal.d.ts +3 -0
- package/dist/cjs/components/feature-announcements/VideoModal.js +1 -0
- package/dist/cjs/components/feature-announcements/constants/animations.d.ts +27 -0
- package/dist/cjs/components/feature-announcements/constants/animations.js +1 -0
- package/dist/cjs/components/feature-announcements/constants/dimensions.d.ts +56 -0
- package/dist/cjs/components/feature-announcements/constants/dimensions.js +1 -0
- package/dist/cjs/components/feature-announcements/constants/index.d.ts +19 -0
- package/dist/cjs/components/feature-announcements/constants/index.js +1 -0
- package/dist/cjs/components/feature-announcements/constants/localStorageKeys.d.ts +18 -0
- package/dist/cjs/components/feature-announcements/constants/localStorageKeys.js +1 -0
- package/dist/cjs/components/feature-announcements/constants/selectors.d.ts +21 -0
- package/dist/cjs/components/feature-announcements/constants/selectors.js +1 -0
- package/dist/cjs/components/feature-announcements/constants/zIndex.d.ts +10 -0
- package/dist/cjs/components/feature-announcements/constants/zIndex.js +1 -0
- package/dist/cjs/components/feature-announcements/hooks/index.d.ts +1 -0
- package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +13 -0
- package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.js +1 -0
- package/dist/cjs/components/feature-announcements/index.d.ts +7 -0
- package/dist/cjs/components/feature-announcements/styles/index.d.ts +4 -0
- package/dist/cjs/components/feature-announcements/styles/joyride.styles.d.ts +125 -0
- package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.d.ts +23 -0
- package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.js +1 -0
- package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.d.ts +16 -0
- package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.js +1 -0
- package/dist/cjs/components/feature-announcements/styles/videoModal.styles.d.ts +13 -0
- package/dist/cjs/components/feature-announcements/styles/videoModal.styles.js +1 -0
- package/dist/cjs/components/feature-announcements/types/feature.types.d.ts +41 -0
- package/dist/cjs/components/feature-announcements/types/index.d.ts +4 -0
- package/dist/cjs/components/feature-announcements/types/props.types.d.ts +43 -0
- package/dist/cjs/components/feature-announcements/types/repository.types.d.ts +11 -0
- package/dist/cjs/components/feature-announcements/types/router.types.d.ts +7 -0
- package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.d.ts +13 -0
- package/dist/cjs/components/feature-announcements/utils/animationHelpers.d.ts +18 -0
- package/dist/cjs/components/feature-announcements/utils/animationHelpers.js +1 -0
- package/dist/cjs/components/feature-announcements/utils/elementHelpers.d.ts +30 -0
- package/dist/cjs/components/feature-announcements/utils/elementHelpers.js +1 -0
- package/dist/cjs/components/feature-announcements/utils/htmlHelpers.d.ts +18 -0
- package/dist/cjs/components/feature-announcements/utils/htmlHelpers.js +1 -0
- package/dist/cjs/components/feature-announcements/utils/index.d.ts +3 -0
- package/dist/cjs/components/whats-new/WhatsNew.d.ts +23 -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 +185 -0
- package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +58 -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/assets/icons/searchIcon.svg.js +1 -0
- package/dist/esm/assets/icons/whatsNew.svg.js +1 -0
- 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/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +2 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +2 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +4 -0
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -0
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +4 -0
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -0
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +4 -0
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -0
- package/dist/esm/components/feature-announcements/VideoModal.d.ts +3 -0
- package/dist/esm/components/feature-announcements/VideoModal.js +1 -0
- package/dist/esm/components/feature-announcements/constants/animations.d.ts +27 -0
- package/dist/esm/components/feature-announcements/constants/animations.js +1 -0
- package/dist/esm/components/feature-announcements/constants/dimensions.d.ts +56 -0
- package/dist/esm/components/feature-announcements/constants/dimensions.js +1 -0
- package/dist/esm/components/feature-announcements/constants/index.d.ts +19 -0
- package/dist/esm/components/feature-announcements/constants/index.js +1 -0
- package/dist/esm/components/feature-announcements/constants/localStorageKeys.d.ts +18 -0
- package/dist/esm/components/feature-announcements/constants/localStorageKeys.js +1 -0
- package/dist/esm/components/feature-announcements/constants/selectors.d.ts +21 -0
- package/dist/esm/components/feature-announcements/constants/selectors.js +1 -0
- package/dist/esm/components/feature-announcements/constants/zIndex.d.ts +10 -0
- package/dist/esm/components/feature-announcements/constants/zIndex.js +1 -0
- package/dist/esm/components/feature-announcements/hooks/index.d.ts +1 -0
- package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +13 -0
- package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.js +1 -0
- package/dist/esm/components/feature-announcements/index.d.ts +7 -0
- package/dist/esm/components/feature-announcements/styles/index.d.ts +4 -0
- package/dist/esm/components/feature-announcements/styles/joyride.styles.d.ts +125 -0
- package/dist/esm/components/feature-announcements/styles/majorPopup.styles.d.ts +23 -0
- package/dist/esm/components/feature-announcements/styles/majorPopup.styles.js +1 -0
- package/dist/esm/components/feature-announcements/styles/minorPopup.styles.d.ts +16 -0
- package/dist/esm/components/feature-announcements/styles/minorPopup.styles.js +1 -0
- package/dist/esm/components/feature-announcements/styles/videoModal.styles.d.ts +13 -0
- package/dist/esm/components/feature-announcements/styles/videoModal.styles.js +1 -0
- package/dist/esm/components/feature-announcements/types/feature.types.d.ts +41 -0
- package/dist/esm/components/feature-announcements/types/index.d.ts +4 -0
- package/dist/esm/components/feature-announcements/types/props.types.d.ts +43 -0
- package/dist/esm/components/feature-announcements/types/repository.types.d.ts +11 -0
- package/dist/esm/components/feature-announcements/types/router.types.d.ts +7 -0
- package/dist/esm/components/feature-announcements/useFeatureAnnouncements.d.ts +13 -0
- package/dist/esm/components/feature-announcements/utils/animationHelpers.d.ts +18 -0
- package/dist/esm/components/feature-announcements/utils/animationHelpers.js +1 -0
- package/dist/esm/components/feature-announcements/utils/elementHelpers.d.ts +30 -0
- package/dist/esm/components/feature-announcements/utils/elementHelpers.js +1 -0
- package/dist/esm/components/feature-announcements/utils/htmlHelpers.d.ts +18 -0
- package/dist/esm/components/feature-announcements/utils/htmlHelpers.js +1 -0
- package/dist/esm/components/feature-announcements/utils/index.d.ts +3 -0
- package/dist/esm/components/whats-new/WhatsNew.d.ts +23 -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 +185 -0
- package/dist/esm/components/whats-new/WhatsNew.types.d.ts +58 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),t=require("../constants/animations.js"),n=require("../constants/dimensions.js"),i=require("../constants/zIndex.js");exports.getMajorPopupStyles=(o,r)=>({container:{width:`${n.POPUP_DIMENSIONS.MAJOR.width}px`,height:`${n.POPUP_DIMENSIONS.MAJOR.height}px`,display:"flex",backgroundColor:e.BASE_COLORS.grayscale[900],borderRadius:n.BORDER_RADIUS.POPUP,overflow:"hidden",position:"relative",transform:o?r:"scale(1)",opacity:o?0:1,transition:t.POPUP_TRANSITION},skipButton:{base:{position:"absolute",top:n.SPACING.MAJOR.skipButtonTop,right:n.SPACING.MAJOR.skipButtonRight,background:"transparent",border:"none",color:e.BASE_COLORS.grayscale[400],fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:i.Z_INDEX.SKIP_BUTTON,transition:"all 0.2s"},hover:{backgroundColor:e.BASE_COLORS.grayscale[100],color:e.BASE_COLORS.grayscale[700]}},imageContainer:{backgroundColor:e.BASE_COLORS.grayscale[900],width:`${n.POPUP_DIMENSIONS.MAJOR.imageWidth}px`,height:`${n.POPUP_DIMENSIONS.MAJOR.imageHeight}px`,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:n.SPACING.MAJOR.imagePadding},image:{width:`${n.POPUP_DIMENSIONS.MAJOR.imageInnerWidth}px`,height:`${n.POPUP_DIMENSIONS.MAJOR.imageInnerHeight}px`,objectFit:"cover"},imagePlaceholder:{color:e.BASE_COLORS.grayscale[500],fontSize:"14px",textAlign:"center",width:`${n.POPUP_DIMENSIONS.MAJOR.imagePlaceholderWidth}px`,height:`${n.POPUP_DIMENSIONS.MAJOR.imagePlaceholderHeight}px`,display:"flex",alignItems:"center",justifyContent:"center"},contentContainer:{flex:1,display:"flex",margin:n.SPACING.MAJOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:n.SPACING.MAJOR.titlePadding,color:e.BASE_COLORS.grayscale.white,lineHeight:"1.25",textAlign:"left"},content:{fontSize:"14px",lineHeight:"1.5",color:"rgba(255, 255, 255, 0.8)",textAlign:"left"},exploreButton:{base:{backgroundColor:"transparent",border:`1px solid ${e.BASE_COLORS.warning[500]}`,color:e.BASE_COLORS.warning[500],borderRadius:n.BORDER_RADIUS.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:n.SPACING.MAJOR.buttonMarginTop},hover:{backgroundColor:"rgba(254, 192, 45, 0.1)"}},navigationContainer:{position:"absolute",bottom:n.SPACING.MAJOR.navigationBottom,right:n.SPACING.MAJOR.navigationRight,display:"flex",gap:n.SPACING.MAJOR.navigationGap,alignItems:"center"},navigationButton:t=>({base:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:t?e.BASE_COLORS.grayscale[700]:e.BASE_COLORS.grayscale.white,fontSize:"20px",cursor:t?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},hover:{color:e.BASE_COLORS.warning[500]}})});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const getMinorPopupStyles: (startAnimation: boolean, transform: string) => {
|
|
3
|
+
container: CSSProperties;
|
|
4
|
+
imageContainer: CSSProperties;
|
|
5
|
+
imageWrapper: CSSProperties;
|
|
6
|
+
image: CSSProperties;
|
|
7
|
+
badge: CSSProperties;
|
|
8
|
+
badgeText: CSSProperties;
|
|
9
|
+
imagePlaceholder: CSSProperties;
|
|
10
|
+
contentContainer: CSSProperties;
|
|
11
|
+
title: CSSProperties;
|
|
12
|
+
content: CSSProperties;
|
|
13
|
+
actionsContainer: CSSProperties;
|
|
14
|
+
understoodText: CSSProperties;
|
|
15
|
+
exploreButton: CSSProperties;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/Theme.js"),t=require("../constants/animations.js"),i=require("../constants/dimensions.js"),o=require("../constants/zIndex.js");exports.getMinorPopupStyles=(n,a)=>({container:{width:`${i.POPUP_DIMENSIONS.MINOR.width}px`,height:`${i.POPUP_DIMENSIONS.MINOR.height}px`,display:"flex",backgroundColor:e.BASE_COLORS.grayscale.white,borderRadius:i.BORDER_RADIUS.POPUP,overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)",transform:n?a:"scale(1)",opacity:n?0:1,transition:t.POPUP_TRANSITION},imageContainer:{backgroundColor:e.BASE_COLORS.grayscale[50],borderRadius:i.BORDER_RADIUS.IMAGE,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:i.SPACING.MINOR.imageMargin,width:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,minWidth:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,maxWidth:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,height:`${i.POPUP_DIMENSIONS.MINOR.imageHeight}px`},imageWrapper:{position:"relative",width:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,height:`${i.POPUP_DIMENSIONS.MINOR.imageHeight}px`},image:{width:`${i.POPUP_DIMENSIONS.MINOR.imageWidth}px`,height:`${i.POPUP_DIMENSIONS.MINOR.imageHeight}px`,objectFit:"cover",borderRadius:i.BORDER_RADIUS.IMAGE,display:"block"},badge:{position:"absolute",top:"0px",left:"0px",right:"0px",height:`${i.POPUP_DIMENSIONS.MINOR.badgeHeight}px`,backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:`${i.BORDER_RADIUS.IMAGE} ${i.BORDER_RADIUS.IMAGE} ${i.BORDER_RADIUS.IMAGE} ${i.BORDER_RADIUS.IMAGE}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:o.Z_INDEX.IMAGE_BADGE},badgeText:{color:e.BASE_COLORS.grayscale.white,fontWeight:"600",fontSize:"14px"},imagePlaceholder:{color:e.BASE_COLORS.grayscale[500],fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.BASE_COLORS.grayscale[100],borderRadius:i.BORDER_RADIUS.IMAGE},contentContainer:{flex:1,display:"flex",margin:i.SPACING.MINOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:e.BASE_COLORS.grayscale[900],lineHeight:"1.25",textAlign:"left"},content:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:e.BASE_COLORS.grayscale[700],textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},actionsContainer:{position:"absolute",bottom:i.SPACING.MINOR.actionsBottom,right:i.SPACING.MINOR.actionsRight,display:"flex",gap:i.SPACING.MINOR.actionsGap,alignItems:"center"},understoodText:{color:e.BASE_COLORS.brand[800],fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"},exploreButton:{backgroundColor:e.BASE_COLORS.brand[800],border:"none",color:e.BASE_COLORS.grayscale.white,borderRadius:i.BORDER_RADIUS.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const videoModalStyles: {
|
|
3
|
+
backdrop: CSSProperties;
|
|
4
|
+
container: CSSProperties;
|
|
5
|
+
closeButton: {
|
|
6
|
+
base: CSSProperties;
|
|
7
|
+
hover: CSSProperties;
|
|
8
|
+
};
|
|
9
|
+
videoWrapper: CSSProperties;
|
|
10
|
+
iframe: CSSProperties;
|
|
11
|
+
video: CSSProperties;
|
|
12
|
+
noVideoMessage: CSSProperties;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../constants/animations.js");var e=require("../constants/dimensions.js"),t=require("../constants/zIndex.js");const o={backdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.9)",zIndex:t.Z_INDEX.VIDEO_MODAL,display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},container:{position:"relative",width:"90vw",height:"90vh",maxWidth:"1200px",maxHeight:"800px",backgroundColor:"black",borderRadius:e.BORDER_RADIUS.VIDEO_MODAL,overflow:"hidden",boxShadow:"0 25px 50px rgba(0, 0, 0, 0.8)"},closeButton:{base:{position:"absolute",top:"20px",right:"20px",background:"rgba(0, 0, 0, 0.7)",border:"none",color:"white",fontSize:"24px",width:"40px",height:"40px",borderRadius:e.BORDER_RADIUS.CLOSE_BUTTON,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:t.Z_INDEX.CLOSE_BUTTON,transition:"background-color 0.2s"},hover:{backgroundColor:"rgba(0, 0, 0, 0.9)"}},videoWrapper:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},iframe:{borderRadius:e.BORDER_RADIUS.VIDEO_MODAL},video:{width:"100%",height:"100%",objectFit:"contain",borderRadius:e.BORDER_RADIUS.VIDEO_MODAL},noVideoMessage:{color:"white",fontSize:"18px",textAlign:"center"}};exports.videoModalStyles=o;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firestore Timestamp type
|
|
3
|
+
*/
|
|
4
|
+
export interface FirestoreTimestamp {
|
|
5
|
+
seconds: number;
|
|
6
|
+
nanoseconds?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Feature announcement data model
|
|
10
|
+
*/
|
|
11
|
+
export interface FeatureAnnouncement {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
content: string;
|
|
16
|
+
buttonText: string;
|
|
17
|
+
displayImage: string;
|
|
18
|
+
featureTag: string;
|
|
19
|
+
featureUpdateType: 'Major' | 'Minor';
|
|
20
|
+
image: string;
|
|
21
|
+
module: string[];
|
|
22
|
+
pageUrls: string[];
|
|
23
|
+
productVideo: string;
|
|
24
|
+
redirectUrl: string;
|
|
25
|
+
updates: string;
|
|
26
|
+
visibility: boolean;
|
|
27
|
+
archived?: boolean;
|
|
28
|
+
createdAt: FirestoreTimestamp;
|
|
29
|
+
expirationDate?: FirestoreTimestamp | string | Date;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Store feature progress tracking
|
|
33
|
+
*/
|
|
34
|
+
export interface StoreFeatureProgress {
|
|
35
|
+
storeId: string;
|
|
36
|
+
viewedFeatures: Record<string, boolean>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Feature update types
|
|
40
|
+
*/
|
|
41
|
+
export type FeatureUpdateType = 'Major' | 'Minor';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FeatureAnnouncement } from './feature.types';
|
|
3
|
+
import { FeatureAnnouncementRepository } from './repository.types';
|
|
4
|
+
import { RouterProps } from './router.types';
|
|
5
|
+
/**
|
|
6
|
+
* Base popup component props
|
|
7
|
+
*/
|
|
8
|
+
export interface PopupBaseProps {
|
|
9
|
+
feature: FeatureAnnouncement;
|
|
10
|
+
currentIndex: number;
|
|
11
|
+
totalFeatures: number;
|
|
12
|
+
onSkip: () => void;
|
|
13
|
+
onExplore: () => void;
|
|
14
|
+
onPrevious: () => void;
|
|
15
|
+
onNext: () => void;
|
|
16
|
+
setIsClosing?: (isClosing: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Major update popup props
|
|
20
|
+
*/
|
|
21
|
+
export interface MajorUpdatePopupProps extends PopupBaseProps {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Minor update popup props
|
|
25
|
+
*/
|
|
26
|
+
export interface MinorUpdatePopupProps extends PopupBaseProps {
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Video modal props
|
|
30
|
+
*/
|
|
31
|
+
export interface VideoModalProps {
|
|
32
|
+
isOpen: boolean;
|
|
33
|
+
videoUrl: string;
|
|
34
|
+
onClose: () => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Feature announcement provider props
|
|
38
|
+
*/
|
|
39
|
+
export interface FeatureAnnouncementProviderProps extends FeatureAnnouncementRepository {
|
|
40
|
+
children: React.ReactNode;
|
|
41
|
+
module?: string;
|
|
42
|
+
router?: RouterProps;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FeatureAnnouncement, StoreFeatureProgress } from './feature.types';
|
|
2
|
+
/**
|
|
3
|
+
* Repository function types for dependency injection
|
|
4
|
+
*/
|
|
5
|
+
export interface FeatureAnnouncementRepository {
|
|
6
|
+
fetchVisibleFeatures: (module?: string) => Promise<[Error | null, FeatureAnnouncement[] | null]>;
|
|
7
|
+
getStoreFeatureProgress: (storeId: string) => Promise<[Error | null, StoreFeatureProgress | null]>;
|
|
8
|
+
fetchFeatureById: (featureId: string) => Promise<[Error | null, FeatureAnnouncement | null]>;
|
|
9
|
+
markFeatureAsViewedForStore: (storeId: string, featureId: string) => Promise<[Error | null]>;
|
|
10
|
+
isFeatureApplicableToCurrentPage: (feature: FeatureAnnouncement) => boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FeatureAnnouncement, FeatureAnnouncementRepository, RouterProps } from './types';
|
|
2
|
+
export declare const useFeatureAnnouncements: ({ fetchVisibleFeatures, getStoreFeatureProgress, fetchFeatureById, markFeatureAsViewedForStore, isFeatureApplicableToCurrentPage, module, router, }: FeatureAnnouncementRepository & {
|
|
3
|
+
module?: string | undefined;
|
|
4
|
+
router?: RouterProps | undefined;
|
|
5
|
+
}) => {
|
|
6
|
+
features: FeatureAnnouncement[];
|
|
7
|
+
majorUpdateFeatures: FeatureAnnouncement[];
|
|
8
|
+
minorUpdateFeatures: FeatureAnnouncement[];
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
markFeatureAsViewed: (featureId: string) => Promise<void>;
|
|
12
|
+
refetch: () => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate transform for closing animation
|
|
3
|
+
* @param popupElement - Popup element reference
|
|
4
|
+
* @param targetElement - Target element to animate towards
|
|
5
|
+
* @returns Transform CSS string
|
|
6
|
+
*/
|
|
7
|
+
export declare const calculateCloseTransform: (popupElement: HTMLElement, targetElement: Element) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Hide Joyride arrow element
|
|
10
|
+
* @param popupRef - Reference to popup element
|
|
11
|
+
*/
|
|
12
|
+
export declare const hideJoyrideArrow: (popupRef: HTMLElement | null) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Execute callback after animation completes
|
|
15
|
+
* @param callback - Function to execute
|
|
16
|
+
* @param delay - Optional delay override
|
|
17
|
+
*/
|
|
18
|
+
export declare const executeAfterAnimation: (callback: () => void, delay?: number) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants/animations.js");exports.calculateCloseTransform=(e,t)=>{const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();return`translate(${o.left+o.width/2-(i.left+i.width/2)}px, ${o.top+o.height/2-(i.top+i.height/2)}px) scale(0)`},exports.executeAfterAnimation=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.ANIMATION_TIMING.CLOSE_DURATION;setTimeout(t,i)},exports.hideJoyrideArrow=e=>{if(!e)return;const t=e.closest('[class*="react-joyride__tooltip"]');if(!t)return;const i=t.querySelector('[class*="react-joyride__arrow"]');i&&(i.style.display="none",i.style.visibility="hidden",i.style.opacity="0")};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find What's New button using multiple strategies
|
|
3
|
+
* @returns Element or null
|
|
4
|
+
*/
|
|
5
|
+
export declare const findWhatsNewButton: () => Element | null;
|
|
6
|
+
/**
|
|
7
|
+
* Find target element for minor update
|
|
8
|
+
* @param featureTag - Feature tag selector
|
|
9
|
+
* @returns Element or null
|
|
10
|
+
*/
|
|
11
|
+
export declare const findFeatureTagElement: (featureTag: string) => Element | null;
|
|
12
|
+
/**
|
|
13
|
+
* Normalize selector string
|
|
14
|
+
* @param selector - Selector string
|
|
15
|
+
* @returns Normalized selector
|
|
16
|
+
*/
|
|
17
|
+
export declare const normalizeSelector: (selector: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Check if element is fully visible in viewport
|
|
20
|
+
* @param element - Element to check
|
|
21
|
+
* @returns True if element is fully visible
|
|
22
|
+
*/
|
|
23
|
+
export declare const isElementInViewport: (element: Element) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Scroll to element smoothly with offset
|
|
26
|
+
* @param element - Element to scroll to
|
|
27
|
+
* @param offset - Offset from top (default 120px for popup space)
|
|
28
|
+
* @returns Promise that resolves when scroll completes
|
|
29
|
+
*/
|
|
30
|
+
export declare const scrollToElementSmooth: (element: Element, offset?: number) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../constants/animations.js");var e=require("../constants/selectors.js");const t=e=>{const t=e.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,r=t.top>=120&&t.bottom<=o,s=t.left>=0&&t.right<=n;return r&&s};exports.findFeatureTagElement=e=>{const t=e.startsWith("#")||e.startsWith(".")||e.startsWith("[")?e:`#${e}`;return document.querySelector(t)},exports.findWhatsNewButton=()=>{let t=document.querySelector(e.SELECTORS.WHATS_NEW_BUTTON);if(t)return t;if(t=document.querySelector(e.SELECTORS.MAIN_ICON_CLASS),t)return t;const o=document.querySelector(e.SELECTORS.SVG_VIEWBOX);if(o){if(o.querySelector(e.SELECTORS.CLIPPATH_PATTERN))return o.closest(e.SELECTORS.WHATS_NEW_BUTTON)||o.parentElement}return null},exports.isElementInViewport=t,exports.normalizeSelector=e=>e.startsWith("#")||e.startsWith(".")||e.startsWith("[")?e:`#${e}`,exports.scrollToElementSmooth=function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:120;return new Promise((n=>{if(t(e))return void n();const r=e.getBoundingClientRect().top+window.pageYOffset-o;let s;window.scrollTo({top:r,behavior:"smooth"});const i=()=>{clearTimeout(s),s=setTimeout((()=>{window.removeEventListener("scroll",i),setTimeout((()=>n()),100)}),100)};window.addEventListener("scroll",i,{passive:!0}),setTimeout((()=>{window.removeEventListener("scroll",i),n()}),1e3)}))};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode HTML entities in text
|
|
3
|
+
* @param text - Text containing HTML entities
|
|
4
|
+
* @returns Decoded text
|
|
5
|
+
*/
|
|
6
|
+
export declare const decodeHTMLEntities: (text: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Format video URL for embedding
|
|
9
|
+
* @param videoUrl - Original video URL
|
|
10
|
+
* @returns Formatted video URL
|
|
11
|
+
*/
|
|
12
|
+
export declare const formatVideoUrl: (videoUrl: string) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Check if URL is a YouTube video
|
|
15
|
+
* @param videoUrl - Video URL to check
|
|
16
|
+
* @returns True if YouTube video
|
|
17
|
+
*/
|
|
18
|
+
export declare const isYouTubeVideo: (videoUrl: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.decodeHTMLEntities=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},exports.formatVideoUrl=e=>e.replace("watch?v=","embed/").replace("youtu.be/","youtube.com/embed/"),exports.isYouTubeVideo=e=>e.includes("youtube.com")||e.includes("youtu.be");
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
customIcon?: React.ComponentType<{
|
|
17
|
+
width?: number;
|
|
18
|
+
height?: number;
|
|
19
|
+
color?: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export declare const WhatsNew: React.FC<WhatsNewProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),e=require("react"),n=require("./WhatsNewButton.js"),o=require("./WhatsNewPanel.js"),s=require("./WhatsNewProvider.js");exports.WhatsNew=r=>{let{title:i="What's new",tooltip:a="What's new",searchPlaceholder:u="Search posts",emptyStateTitle:c="Nothing new!",emptyStateDescription:h="There are no new updates or features at the moment. Check back soon!",noResultsText:l="Sorry, no results found.",width:d="480px",onContentClick:p,renderCustomContent:w,buttonTestId:x="whats-new-button",iconWidth:m=32,iconHeight:C=32,customIcon:j}=r;const[W,N]=e.useState(!1),{whatsNewContent:g,isLoading:S,newContentCount:y}=s.useWhatsNewContext();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(n.WhatsNewButton,{onClick:()=>N(!0),newContentCount:y,isOpen:W,isLoading:S,tooltip:a,testId:x,iconWidth:m,iconHeight:C,customIcon:j}),t.jsxRuntimeExports.jsx(o.WhatsNewPanel,{isOpen:W,onClose:()=>N(!1),content:g,isLoading:S,title:i,searchPlaceholder:u,emptyStateTitle:c,emptyStateDescription:h,noResultsText:l,width:d,onContentClick:t=>{p&&p(t)},renderCustomContent:w})]})};
|
|
@@ -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,185 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(e);const r=n.default.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.COLORS.background.brandLight};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.main-icon-class:hover {
|
|
19
|
+
background: ${t.COLORS.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.COLORS.background.negative.vibrant};
|
|
31
|
+
border: 1.25px solid ${t.COLORS.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.COLORS.surface.standard};
|
|
42
|
+
}
|
|
43
|
+
`,a=n.default.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.COLORS.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.COLORS.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.COLORS.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.COLORS.background.warning.vibrant};
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
align-items: center;
|
|
158
|
+
margin-right: 8px;
|
|
159
|
+
}
|
|
160
|
+
`,o=n.default.div`
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
height: 100%;
|
|
164
|
+
`,d=n.default.div`
|
|
165
|
+
background: ${t.COLORS.surface.standard};
|
|
166
|
+
border-radius: 8px;
|
|
167
|
+
border: 1px solid ${t.COLORS.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
|
+
`,p=n.default.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
|
+
`;exports.BackgroundImageContainer=p,exports.MainCardContainer=d,exports.MainContainer=o,exports.WhatsNewIconContainer=r,exports.WhatsNewWrapper=a;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
productVideo?: string;
|
|
11
|
+
docId?: string;
|
|
12
|
+
createdAt: any;
|
|
13
|
+
module: string[];
|
|
14
|
+
visibility: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface WhatsNewProviderProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
|
|
19
|
+
markContentAsViewed?: (contentId: string) => Promise<void>;
|
|
20
|
+
module?: string;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface WhatsNewButtonProps {
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
newContentCount?: number;
|
|
26
|
+
isOpen?: boolean;
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
testId?: string;
|
|
30
|
+
iconWidth?: number;
|
|
31
|
+
iconHeight?: number;
|
|
32
|
+
customIcon?: React.ComponentType<{
|
|
33
|
+
width?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
color?: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export interface WhatsNewPanelProps {
|
|
39
|
+
isOpen: boolean;
|
|
40
|
+
onClose: () => void;
|
|
41
|
+
content: WhatsNewContent[];
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
title?: string;
|
|
44
|
+
searchPlaceholder?: string;
|
|
45
|
+
emptyStateTitle?: string;
|
|
46
|
+
emptyStateDescription?: string;
|
|
47
|
+
noResultsText?: string;
|
|
48
|
+
width?: string;
|
|
49
|
+
onContentClick?: (content: WhatsNewContent) => void;
|
|
50
|
+
renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
export interface WhatsNewHookReturn {
|
|
53
|
+
whatsNewContent: WhatsNewContent[];
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
newContentCount: number;
|
|
56
|
+
markAsViewed: (contentId: string) => Promise<void>;
|
|
57
|
+
refreshContent: () => Promise<void>;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../assets/icons/whatsNew.svg.js"),e=require("../../constants/Theme.js"),n=require("../tooltips/Tooltip.js"),i=require("./WhatsNew.styles.js");exports.WhatsNewButton=o=>{let{onClick:r,newContentCount:a=0,isOpen:c=!1,isLoading:x=!1,tooltip:d="What's new",testId:j="whats-new-button",iconWidth:l=32,iconHeight:u=32,customIcon:p}=o;return x?t.jsxRuntimeExports.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsxRuntimeExports.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.jsxRuntimeExports.jsx("style",{children:"\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t"})]})):t.jsxRuntimeExports.jsx(i.WhatsNewIconContainer,Object.assign({count:a},{children:t.jsxRuntimeExports.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?e.COLORS.content.brand:e.COLORS.content.primary},onClick:r,"data-testid":j},{children:[t.jsxRuntimeExports.jsx(n.Tooltip,Object.assign({body:d},{children:t.jsxRuntimeExports.jsx("div",{children:p?t.jsxRuntimeExports.jsx(p,{width:l,height:u,color:c?e.COLORS.content.brand:e.COLORS.content.primary}):t.jsxRuntimeExports.jsx(s.default,{width:l,height:u})})})),a>0&&t.jsxRuntimeExports.jsx("div",Object.assign({className:"notification--count"},{children:t.jsxRuntimeExports.jsx("div",Object.assign({className:"count--text"},{children:a}))}))]}))}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("date-fns"),s=require("react"),r=require("../../assets/icons/searchIcon.svg.js"),n=require("../../assets/icons/whatsNew.svg.js"),i=require("../../constants/Theme.js"),a=require("../button/Button.js"),o=require("../feature-announcements/VideoModal.js"),d=require("../searchBar/searchBar.js"),c=require("../side-modal/SideModal.js"),x=require("../TypographyStyle.js"),l=require("./WhatsNew.styles.js");exports.WhatsNewPanel=u=>{let{isOpen:j,onClose:m,content:h,isLoading:p=!1,title:g="What's new on BIK",searchPlaceholder:R="Search posts",emptyStateTitle:E="Nothing new!",emptyStateDescription:w="There are no new updates or features at the moment. Check back soon!",noResultsText:b="Sorry, no results found.",width:C="480px",onContentClick:O,renderCustomContent:y}=u;const[f,N]=s.useState(""),[S,v]=s.useState(!1),[M,q]=s.useState(""),L=e=>{if(!e.createdAt)return!1;const s=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t.differenceInBusinessDays(new Date,s)<7},T=s.useMemo((()=>{if(!f.trim())return h;const e=f.toLowerCase();return h.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[h,f]),k=0===h.length,B=0===T.length;return j?e.jsxRuntimeExports.jsxs(c.SideModal,Object.assign({width:C,onClose:m,header:"",headerCustomComponent:e.jsxRuntimeExports.jsx(x.TitleMedium,Object.assign({color:i.COLORS.background.inverse},{children:g})),headerStyle:{background:i.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxRuntimeExports.jsxs(l.MainContainer,{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-8"},{children:e.jsxRuntimeExports.jsx(d.SearchBar,{width:"100%",isEnabled:!k,onChange:e=>{N(e)},onEnter:e=>{N(e)},placeholder:R,variant:"default",searchValue:f,onClickCross:()=>{N("")}})})),e.jsxRuntimeExports.jsx(l.WhatsNewWrapper,{children:k||B?e.jsxRuntimeExports.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--wrapper"},{children:k?e.jsxRuntimeExports.jsx(n.default,{width:32,height:32}):e.jsxRuntimeExports.jsx(r.default,{width:32,height:32})})),k?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(x.TitleRegular,{children:E}),e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:i.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:w}))]}):B?e.jsxRuntimeExports.jsx(x.BodyPrimary,Object.assign({color:i.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:b})):null]})):e.jsxRuntimeExports.jsx("div",Object.assign({className:"scroller"},{children:T.map(((s,r)=>y?y(s):e.jsxRuntimeExports.jsxs(l.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsxRuntimeExports.jsx(l.BackgroundImageContainer,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[L(s)?e.jsxRuntimeExports.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsxRuntimeExports.jsx(x.Caption,{children:"New"})})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{color:i.COLORS.content.placeholder}},{children:s.createdAt?t.format(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"mt--8"},{children:e.jsxRuntimeExports.jsx(x.TitleSmall,{children:s.title})})),e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsxRuntimeExports.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsxRuntimeExports.jsx(a.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(q(e.productVideo),v(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),O&&O(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${r}`)))}))})]}),e.jsxRuntimeExports.jsx(o.VideoModal,{isOpen:S,videoUrl:M,onClose:()=>{v(!1)}})]})):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),r=require("./useWhatsNew.js");const s=t.createContext(null);exports.WhatsNewProvider=t=>{let{children:n,fetchWhatsNewContent:o,markContentAsViewed:u,module:a}=t;const i=r.useWhatsNew({fetchWhatsNewContent:o,markContentAsViewed:u,module:a});return e.jsxRuntimeExports.jsx(s.Provider,Object.assign({value:i},{children:n}))},exports.useWhatsNewContext=()=>{const e=t.useContext(s);if(!e)throw new Error("useWhatsNewContext must be used within a WhatsNewProvider");return e};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WhatsNewContent, WhatsNewHookReturn } from './WhatsNew.types';
|
|
2
|
+
interface UseWhatsNewProps {
|
|
3
|
+
fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
|
|
4
|
+
markContentAsViewed?: (contentId: string) => Promise<void>;
|
|
5
|
+
module?: string;
|
|
6
|
+
newContentThresholdDays?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const useWhatsNew: ({ fetchWhatsNewContent, markContentAsViewed, module, newContentThresholdDays, }: UseWhatsNewProps) => WhatsNewHookReturn;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("date-fns"),r=require("react");exports.useWhatsNew=a=>{let{fetchWhatsNewContent:n,markContentAsViewed:o,module:c,newContentThresholdDays:s=7}=a;const[i,d]=r.useState([]),[u,l]=r.useState(!0),f=r.useRef(n),w=r.useRef(o);r.useEffect((()=>{f.current=n}),[n]),r.useEffect((()=>{w.current=o}),[o]);const v=r.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){l(!0);try{const[e,t]=yield f.current();if(e)console.error("Failed to fetch what's new content:",e),d([]);else if(t){let e=t;c&&(e=t.filter((e=>Array.isArray(e.module)?e.module.includes(c):e.module===c))),e.sort(((e,t)=>{var r,a;const n=(null===(r=e.createdAt)||void 0===r?void 0:r.toDate)?e.createdAt.toDate():new Date(e.createdAt);return((null===(a=t.createdAt)||void 0===a?void 0:a.toDate)?t.createdAt.toDate():new Date(t.createdAt)).getTime()-n.getTime()})),d(e)}else d([])}catch(e){console.error("Failed to fetch what's new content:",e),d([])}finally{l(!1)}}))),[c]);r.useEffect((()=>{v()}),[v]);const A=r.useCallback((e=>{if(!e.createdAt)return!1;const r=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t.differenceInBusinessDays(new Date,r)<s}),[s]),h=i.reduce(((e,t)=>A(t)?e+1:e),0);return{whatsNewContent:i,isLoading:u,newContentCount:h,markAsViewed:r.useCallback((t=>e.__awaiter(void 0,void 0,void 0,(function*(){if(w.current)try{yield w.current(t)}catch(e){console.warn("Failed to mark content as viewed:",e)}}))),[]),refreshContent:r.useCallback((()=>e.__awaiter(void 0,void 0,void 0,(function*(){yield v()}))),[v])}};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export * from './components/TablePagination/';
|
|
|
45
45
|
export * from './components/states-modal';
|
|
46
46
|
export * from './components/states';
|
|
47
47
|
export * from './components/WhatsAppTextEditor';
|
|
48
|
+
export * from './components/whats-new';
|
|
48
49
|
export * from './helpers';
|
|
49
50
|
export * from './components/card-selection-modal';
|
|
50
51
|
export * from './components/image-cropper';
|
|
@@ -99,3 +100,4 @@ export * from './components/text-picker';
|
|
|
99
100
|
export * from './components/dot-pulse';
|
|
100
101
|
export * from './components/bik-chatbot';
|
|
101
102
|
export * from './components/banner';
|
|
103
|
+
export * from './components/feature-announcements';
|