@bikdotai/bik-component-library 0.0.721-beta.4 → 0.0.721-beta.41
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/feature-announcements/FeatureAnnouncementProvider.d.ts +1 -11
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +1 -10
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +1 -10
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/cjs/components/feature-announcements/VideoModal.d.ts +1 -6
- package/dist/cjs/components/feature-announcements/VideoModal.js +1 -1
- 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 +3 -2
- 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 +40 -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 +3 -14
- 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/WhatsNewButton.js +1 -1
- package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -1
- package/dist/cjs/components/whats-new/useWhatsNew.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +1 -11
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +1 -10
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +1 -10
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/esm/components/feature-announcements/VideoModal.d.ts +1 -6
- package/dist/esm/components/feature-announcements/VideoModal.js +1 -1
- 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 +3 -2
- 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 +40 -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 +3 -14
- 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/WhatsNewButton.js +1 -1
- package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -1
- package/dist/esm/components/whats-new/useWhatsNew.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/feature-announcements/FeatureAnnouncement.types.d.ts +0 -27
- package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.js +0 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncement.types.d.ts +0 -27
- package/dist/esm/components/feature-announcements/useFeatureAnnouncements.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as s,useEffect as n}from"react";import{TEXT as o}from"./constants/index.js";import{getMajorPopupStyles as r}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as i}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as a,calculateCloseTransform as l,executeAfterAnimation as c}from"./utils/animationHelpers.js";import{findWhatsNewButton as u}from"./utils/elementHelpers.js";const g=g=>{let{feature:j,currentIndex:b,totalFeatures:p,onSkip:m,onExplore:d,onPrevious:v,onNext:y,setIsClosing:O}=g;const[x,T]=t(!1),[h,E]=t(!1),[f,B]=t(""),I=s(null);n((()=>{x&&E(!0)}),[x]);const P=r(h,f);return e.jsxs("div",Object.assign({ref:I,style:P.container},{children:[e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),(e=>{a(I.current);const t=u();if(t&&I.current){const e=l(I.current,t);B(e)}else B("scale(0)");null==O||O(!0),T(!0),c(e)})(m)},style:P.skipButton.base,onMouseEnter:e=>Object.assign(e.currentTarget.style,P.skipButton.hover),onMouseLeave:e=>Object.assign(e.currentTarget.style,P.skipButton.base)},{children:o.SKIP_BUTTON})),e.jsx("div",Object.assign({style:P.imageContainer},{children:j.displayImage?e.jsx("img",{src:j.displayImage,alt:j.title,style:P.image,onError:e=>{j.image&&(e.target.src=j.image)}}):e.jsx("div",Object.assign({style:P.imagePlaceholder},{children:o.FEATURE_PREVIEW_PLACEHOLDER}))})),e.jsxs("div",Object.assign({style:P.contentContainer},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:P.title},{children:j.title})),e.jsx("div",{style:P.content,dangerouslySetInnerHTML:{__html:i(j.content||j.body||"")}}),e.jsx("button",Object.assign({onClick:()=>{d(),a(I.current);const e=u();if(e&&I.current){const t=l(I.current,e);B(t)}else B("scale(0)");null==O||O(!0),T(!0)},style:P.exploreButton.base,onMouseEnter:e=>Object.assign(e.currentTarget.style,P.exploreButton.hover),onMouseLeave:e=>Object.assign(e.currentTarget.style,P.exploreButton.base)},{children:j.buttonText||o.DEFAULT_BUTTON_TEXT}))]}),p>1&&e.jsxs("div",Object.assign({style:P.navigationContainer},{children:[e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),v()},disabled:0===b,style:P.navigationButton(0===b).base,onMouseEnter:e=>{0!==b&&Object.assign(e.currentTarget.style,P.navigationButton(!1).hover)},onMouseLeave:e=>{0!==b&&Object.assign(e.currentTarget.style,P.navigationButton(!1).base)}},{children:o.NAVIGATION_PREVIOUS})),e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),y()},disabled:b===p-1,style:P.navigationButton(b===p-1).base,onMouseEnter:e=>{b!==p-1&&Object.assign(e.currentTarget.style,P.navigationButton(!1).hover)},onMouseLeave:e=>{b!==p-1&&Object.assign(e.currentTarget.style,P.navigationButton(b===p-1).base)}},{children:o.NAVIGATION_NEXT}))]}))]}))]}))};export{g as default};
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
-
}
|
|
2
|
+
import { MinorUpdatePopupProps } from './types';
|
|
12
3
|
declare const MinorUpdatePopup: React.FC<MinorUpdatePopupProps>;
|
|
13
4
|
export default MinorUpdatePopup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as s,useEffect as n}from"react";import{TEXT as r}from"./constants/index.js";import"../../constants/Theme.js";import"./constants/animations.js";import{getMinorPopupStyles as i}from"./styles/minorPopup.styles.js";import{decodeHTMLEntities as a}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as l,calculateCloseTransform as o,executeAfterAnimation as c}from"./utils/animationHelpers.js";import{findFeatureTagElement as d}from"./utils/elementHelpers.js";const u=u=>{let{feature:j,currentIndex:m,totalFeatures:g,onSkip:p,onExplore:x,onPrevious:f,onNext:T,setIsClosing:h}=u;const[y,b]=t(!1),[E,O]=t(!1),[v,_]=t(""),C=s(null);n((()=>{y&&O(!0)}),[y]);const I=i(E,v);return e.jsxs("div",Object.assign({ref:C,style:I.container},{children:[e.jsx("div",Object.assign({style:I.imageContainer},{children:j.displayImage?e.jsxs("div",Object.assign({style:I.imageWrapper},{children:[e.jsx("img",{src:j.displayImage,alt:j.title,style:I.image,onError:e=>{j.image&&(e.target.src=j.image)}}),e.jsx("div",Object.assign({style:I.badge},{children:e.jsx("span",Object.assign({style:I.badgeText},{children:r.NEW_FEATURE_BADGE}))}))]})):e.jsx("div",Object.assign({style:I.imagePlaceholder},{children:r.FEATURE_PREVIEW_PLACEHOLDER}))})),e.jsxs("div",Object.assign({style:I.contentContainer},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:I.title},{children:j.title})),e.jsx("div",{style:I.content,dangerouslySetInnerHTML:{__html:a(j.content||j.body||"")}})]}),e.jsxs("div",Object.assign({style:I.actionsContainer},{children:[e.jsx("span",Object.assign({onClick:()=>{(e=>{if(l(C.current),C.current&&j.featureTag){const e=d(j.featureTag);if(e){const t=o(C.current,e);_(t)}else _("scale(0)")}else _("scale(0)");null==h||h(!0),b(!0),c(e)})(p)},style:I.understoodText},{children:r.UNDERSTOOD})),j.productVideo&&e.jsx("button",Object.assign({onClick:()=>{if(x(),l(C.current),C.current&&j.featureTag){const e=j.featureTag.startsWith("#")||j.featureTag.startsWith(".")||j.featureTag.startsWith("[")?j.featureTag:`#${j.featureTag}`,t=document.querySelector(e);if(t){const e=o(C.current,t);_(e)}else _("scale(0)")}else _("scale(0)");null==h||h(!0),b(!0)},style:I.exploreButton},{children:j.buttonText||r.DEFAULT_BUTTON_TEXT}))]}))]}))]}))};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";const
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{TEXT as s}from"./constants/index.js";import"../../constants/Theme.js";import"./constants/animations.js";import{videoModalStyles as t}from"./styles/videoModal.styles.js";import{formatVideoUrl as o,isYouTubeVideo as r}from"./utils/htmlHelpers.js";const i=i=>{let{isOpen:n,videoUrl:c,onClose:l}=i;if(!n)return null;const a=o(c),d=r(c);return e.jsx("div",Object.assign({style:t.backdrop,onClick:e=>{e.target===e.currentTarget&&l()}},{children:e.jsxs("div",Object.assign({style:t.container,onClick:e=>e.stopPropagation()},{children:[e.jsx("button",Object.assign({onClick:l,style:t.closeButton.base,onMouseOver:e=>Object.assign(e.currentTarget.style,t.closeButton.hover),onMouseOut:e=>Object.assign(e.currentTarget.style,t.closeButton.base)},{children:"×"})),e.jsx("div",Object.assign({style:t.videoWrapper},{children:c?d?e.jsx("iframe",{width:"100%",height:"100%",src:a,title:s.VIDEO_MODAL_TITLE,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,style:t.iframe}):e.jsxs("video",Object.assign({controls:!0,autoPlay:!0,style:t.video},{children:[e.jsx("source",{src:c,type:"video/mp4"}),e.jsx("source",{src:c,type:"video/webm"}),e.jsx("source",{src:c,type:"video/ogg"}),"Your browser does not support the video tag."]})):e.jsx("div",Object.assign({style:t.noVideoMessage},{children:s.NO_VIDEO_AVAILABLE}))}))]}))}))};export{i as VideoModal};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animation timing constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const ANIMATION_TIMING: {
|
|
5
|
+
readonly CLOSE_DURATION: 1150;
|
|
6
|
+
readonly PROCESSING_DELAY: 500;
|
|
7
|
+
readonly MINOR_POPUP_DELAY: 2000;
|
|
8
|
+
readonly TRANSITION_DURATION: "1s";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Animation easing functions
|
|
12
|
+
*/
|
|
13
|
+
export declare const ANIMATION_EASING: {
|
|
14
|
+
readonly STANDARD: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Element check configuration
|
|
18
|
+
*/
|
|
19
|
+
export declare const ELEMENT_CHECK_CONFIG: {
|
|
20
|
+
readonly MAX_ATTEMPTS: 25;
|
|
21
|
+
readonly RETRY_INTERVAL_MS: 200;
|
|
22
|
+
readonly SCROLL_DEBOUNCE_MS: 300;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Combined transition string
|
|
26
|
+
*/
|
|
27
|
+
export declare const POPUP_TRANSITION: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const A={CLOSE_DURATION:1150,PROCESSING_DELAY:500,MINOR_POPUP_DELAY:2e3,TRANSITION_DURATION:"1s"},N={STANDARD:"cubic-bezier(0.4, 0, 0.2, 1)"},T=`transform ${A.TRANSITION_DURATION} ${N.STANDARD}, opacity ${A.TRANSITION_DURATION} ${N.STANDARD}`;export{N as ANIMATION_EASING,A as ANIMATION_TIMING,T as POPUP_TRANSITION};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popup dimension constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const POPUP_DIMENSIONS: {
|
|
5
|
+
readonly MAJOR: {
|
|
6
|
+
readonly width: 959;
|
|
7
|
+
readonly height: 274;
|
|
8
|
+
readonly imageWidth: 480;
|
|
9
|
+
readonly imageHeight: 274;
|
|
10
|
+
readonly imageInnerWidth: 464;
|
|
11
|
+
readonly imageInnerHeight: 258;
|
|
12
|
+
readonly imagePlaceholderWidth: 290;
|
|
13
|
+
readonly imagePlaceholderHeight: 258;
|
|
14
|
+
};
|
|
15
|
+
readonly MINOR: {
|
|
16
|
+
readonly width: 519;
|
|
17
|
+
readonly height: 160;
|
|
18
|
+
readonly imageWidth: 235;
|
|
19
|
+
readonly imageHeight: 134;
|
|
20
|
+
readonly badgeHeight: 27;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Spacing constants
|
|
25
|
+
*/
|
|
26
|
+
export declare const SPACING: {
|
|
27
|
+
readonly MAJOR: {
|
|
28
|
+
readonly contentMargin: "0 8px 0 0";
|
|
29
|
+
readonly imagePadding: "8px";
|
|
30
|
+
readonly titlePadding: "36px 0 0 0";
|
|
31
|
+
readonly buttonMarginTop: "16px";
|
|
32
|
+
readonly skipButtonTop: "10px";
|
|
33
|
+
readonly skipButtonRight: "10px";
|
|
34
|
+
readonly navigationBottom: "16px";
|
|
35
|
+
readonly navigationRight: "16px";
|
|
36
|
+
readonly navigationGap: "8px";
|
|
37
|
+
};
|
|
38
|
+
readonly MINOR: {
|
|
39
|
+
readonly imageMargin: "13px 10px 13px 10px";
|
|
40
|
+
readonly contentMargin: "13px 13px 13px 3px";
|
|
41
|
+
readonly actionsBottom: "13px";
|
|
42
|
+
readonly actionsRight: "10px";
|
|
43
|
+
readonly actionsGap: "16px";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Border radius constants
|
|
48
|
+
*/
|
|
49
|
+
export declare const BORDER_RADIUS: {
|
|
50
|
+
readonly POPUP: "4px";
|
|
51
|
+
readonly IMAGE: "4px";
|
|
52
|
+
readonly BUTTON: "4px";
|
|
53
|
+
readonly VIDEO_MODAL: "12px";
|
|
54
|
+
readonly CLOSE_BUTTON: "50%";
|
|
55
|
+
readonly SPOTLIGHT: "8px";
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i={MAJOR:{width:959,height:274,imageWidth:480,imageHeight:274,imageInnerWidth:464,imageInnerHeight:258,imagePlaceholderWidth:290,imagePlaceholderHeight:258},MINOR:{width:519,height:160,imageWidth:235,imageHeight:134,badgeHeight:27}},t={MAJOR:{contentMargin:"0 8px 0 0",imagePadding:"8px",titlePadding:"36px 0 0 0",buttonMarginTop:"16px",skipButtonTop:"10px",skipButtonRight:"10px",navigationBottom:"16px",navigationRight:"16px",navigationGap:"8px"},MINOR:{imageMargin:"13px 10px 13px 10px",contentMargin:"13px 13px 13px 3px",actionsBottom:"13px",actionsRight:"10px",actionsGap:"16px"}},p={POPUP:"4px",IMAGE:"4px",BUTTON:"4px",VIDEO_MODAL:"12px",CLOSE_BUTTON:"50%",SPOTLIGHT:"8px"};export{p as BORDER_RADIUS,i as POPUP_DIMENSIONS,t as SPACING};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './animations';
|
|
2
|
+
export * from './dimensions';
|
|
3
|
+
export * from './selectors';
|
|
4
|
+
export * from './zIndex';
|
|
5
|
+
export * from './localStorageKeys';
|
|
6
|
+
/**
|
|
7
|
+
* Text constants
|
|
8
|
+
*/
|
|
9
|
+
export declare const TEXT: {
|
|
10
|
+
readonly DEFAULT_BUTTON_TEXT: "Explore the feature";
|
|
11
|
+
readonly SKIP_BUTTON: "Skip";
|
|
12
|
+
readonly UNDERSTOOD: "Understood";
|
|
13
|
+
readonly NEW_FEATURE_BADGE: "New feature";
|
|
14
|
+
readonly FEATURE_PREVIEW_PLACEHOLDER: "Feature Preview";
|
|
15
|
+
readonly NO_VIDEO_AVAILABLE: "No video available";
|
|
16
|
+
readonly VIDEO_MODAL_TITLE: "Product Video";
|
|
17
|
+
readonly NAVIGATION_PREVIOUS: "‹";
|
|
18
|
+
readonly NAVIGATION_NEXT: "›";
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{ANIMATION_EASING,ANIMATION_TIMING,POPUP_TRANSITION}from"./animations.js";const E={DEFAULT_BUTTON_TEXT:"Explore the feature",SKIP_BUTTON:"Skip",UNDERSTOOD:"Understood",NEW_FEATURE_BADGE:"New feature",FEATURE_PREVIEW_PLACEHOLDER:"Feature Preview",NO_VIDEO_AVAILABLE:"No video available",VIDEO_MODAL_TITLE:"Product Video",NAVIGATION_PREVIOUS:"‹",NAVIGATION_NEXT:"›"};export{E as TEXT};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local storage keys for feature announcements
|
|
3
|
+
*/
|
|
4
|
+
export declare const LOCAL_STORAGE_KEYS: {
|
|
5
|
+
readonly STORE_ID: "storeId";
|
|
6
|
+
readonly BIK_STORE_ID: "Bik/StoreId";
|
|
7
|
+
readonly CURRENT_STORE: "currentStore";
|
|
8
|
+
readonly STORE: "store";
|
|
9
|
+
readonly CURRENT_USER: "Bik/CurrentUser";
|
|
10
|
+
readonly QUERY_PARAM: "storeId";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* URL query parameters
|
|
14
|
+
*/
|
|
15
|
+
export declare const QUERY_PARAMS: {
|
|
16
|
+
readonly FEATURE_ID: "featureId";
|
|
17
|
+
readonly STORE_ID: "storeId";
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r={STORE_ID:"storeId",BIK_STORE_ID:"Bik/StoreId",CURRENT_STORE:"currentStore",STORE:"store",CURRENT_USER:"Bik/CurrentUser",QUERY_PARAM:"storeId"},R={FEATURE_ID:"featureId",STORE_ID:"storeId"};export{r as LOCAL_STORAGE_KEYS,R as QUERY_PARAMS};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS selectors for feature announcements
|
|
3
|
+
*/
|
|
4
|
+
export declare const SELECTORS: {
|
|
5
|
+
readonly WHATS_NEW_BUTTON: "[data-testid=\"whats-new-button\"]";
|
|
6
|
+
readonly MAIN_ICON_CLASS: ".main-icon-class";
|
|
7
|
+
readonly SVG_VIEWBOX: "svg[viewBox=\"0 0 32 32\"]";
|
|
8
|
+
readonly CLIPPATH_PATTERN: "clipPath[id*=\"clip\"]";
|
|
9
|
+
readonly JOYRIDE_TOOLTIP: "[class*=\"react-joyride__tooltip\"]";
|
|
10
|
+
readonly JOYRIDE_ARROW: "[class*=\"react-joyride__arrow\"]";
|
|
11
|
+
readonly JOYRIDE_SPOTLIGHT: ".react-joyride__spotlight";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Data test IDs
|
|
15
|
+
*/
|
|
16
|
+
export declare const TEST_IDS: {
|
|
17
|
+
readonly WHATS_NEW_BUTTON: "whats-new-button";
|
|
18
|
+
readonly MAJOR_POPUP: "major-update-popup";
|
|
19
|
+
readonly MINOR_POPUP: "minor-update-popup";
|
|
20
|
+
readonly VIDEO_MODAL: "video-modal";
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t={WHATS_NEW_BUTTON:'[data-testid="whats-new-button"]',MAIN_ICON_CLASS:".main-icon-class",SVG_VIEWBOX:'svg[viewBox="0 0 32 32"]',CLIPPATH_PATTERN:'clipPath[id*="clip"]',JOYRIDE_TOOLTIP:'[class*="react-joyride__tooltip"]',JOYRIDE_ARROW:'[class*="react-joyride__arrow"]',JOYRIDE_SPOTLIGHT:".react-joyride__spotlight"};export{t as SELECTORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const O={JOYRIDE:1e4,VIDEO_MODAL:2e3,SKIP_BUTTON:10,IMAGE_BADGE:10,CLOSE_BUTTON:10};export{O as Z_INDEX};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFeatureAnnouncements } from './useFeatureAnnouncements';
|
|
@@ -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 @@
|
|
|
1
|
+
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{useState as t,useCallback as r,useEffect as o}from"react";import{ANIMATION_TIMING as a}from"../constants/animations.js";import{QUERY_PARAMS as n,LOCAL_STORAGE_KEYS as i}from"../constants/localStorageKeys.js";const l=l=>{let{fetchVisibleFeatures:s,getStoreFeatureProgress:u,fetchFeatureById:d,markFeatureAsViewedForStore:c,isFeatureApplicableToCurrentPage:f,module:p,router:m}=l;var g;const y=(()=>{const[e,r]=t(null);return o((()=>{if("undefined"!=typeof window){let e=null;try{if(e=localStorage.getItem(i.STORE_ID)||localStorage.getItem(i.BIK_STORE_ID)||localStorage.getItem(i.CURRENT_STORE)||localStorage.getItem(i.STORE),!e){const t=localStorage.getItem(i.CURRENT_USER);t&&(e=JSON.parse(t).storeId)}e||(e=new URLSearchParams(window.location.search).get(i.QUERY_PARAM))}catch(e){console.error("FeatureAnnouncements: Failed to get store ID",e)}r(e)}}),[]),e})(),[v,F]=t([]),[D,w]=t([]),[U,h]=t([]),[A,I]=t(!1),[R,S]=t(null),T=r((()=>e(void 0,void 0,void 0,(function*(){if(y){I(!0),S(null);try{const[e,t]=yield s(p);if(e||!t)return console.error("FeatureAnnouncements: Failed to fetch features",e),void S("Failed to fetch features");const[r,o]=yield u(y);r&&console.warn("FeatureAnnouncements: Progress fetch failed, treating all features as new",r);const n=new Date,i="undefined"!=typeof window?window.location.pathname:"",l=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()))&&n<t},d=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(i)}return!0},c=t.filter((e=>{var t;return!((null===(t=null==o?void 0:o.viewedFeatures)||void 0===t?void 0:t[e.id])||!1)&&f(e)&&l(e)&&d(e)})),m=c.filter((e=>"Major"===e.featureUpdateType)),g=c.filter((e=>"Minor"===e.featureUpdateType));F(c),w(m),setTimeout((()=>{h(g)}),a.MINOR_POPUP_DELAY)}catch(e){console.error("FeatureAnnouncements: Unexpected error in fetchFeatures",e),S("An unexpected error occurred")}finally{I(!1)}}}))),[y,s,u,f,p]),x=r((t=>e(void 0,void 0,void 0,(function*(){I(!0),S(null);try{const[e,r]=yield d(t);if(e||!r)return void S("Failed to fetch feature by ID");"Major"===r.featureUpdateType?w([r]):h([r]),F([r])}catch(e){S("An unexpected error occurred while fetching by ID")}finally{I(!1)}}))),[d]),E=r((t=>e(void 0,void 0,void 0,(function*(){if(!y)return;const[e]=yield c(y,t);e?(console.warn("FeatureAnnouncements: Failed to mark feature as viewed, removing from local state anyway",e),F((e=>e.filter((e=>e.id!==t)))),w((e=>e.filter((e=>e.id!==t)))),h((e=>e.filter((e=>e.id!==t))))):(F((e=>e.filter((e=>e.id!==t)))),w((e=>e.filter((e=>e.id!==t)))),h((e=>e.filter((e=>e.id!==t)))))}))),[y,c]);return o((()=>{var e;const t=null===(e=null==m?void 0:m.query)||void 0===e?void 0:e[n.FEATURE_ID];t&&m?x(t):T()}),[null==m?void 0:m.pathname,null===(g=null==m?void 0:m.query)||void 0===g?void 0:g[n.FEATURE_ID],y,T,x,m]),{features:v,majorUpdateFeatures:D,minorUpdateFeatures:U,isLoading:A,error:R,markFeatureAsViewed:E,refetch:T}};export{l as useFeatureAnnouncements};
|
|
@@ -2,5 +2,6 @@ export { default as FeatureAnnouncementProvider } from './FeatureAnnouncementPro
|
|
|
2
2
|
export { default as MajorUpdatePopup } from './MajorUpdatePopup';
|
|
3
3
|
export { default as MinorUpdatePopup } from './MinorUpdatePopup';
|
|
4
4
|
export { VideoModal } from './VideoModal';
|
|
5
|
-
export
|
|
6
|
-
export * from './
|
|
5
|
+
export { useFeatureAnnouncements } from './hooks/useFeatureAnnouncements';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export { TEXT, ANIMATION_TIMING, POPUP_DIMENSIONS } from './constants';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export declare const majorStepStyles: {
|
|
2
|
+
tooltip: {
|
|
3
|
+
padding: number;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
border: string;
|
|
7
|
+
filter: string;
|
|
8
|
+
boxShadow: string;
|
|
9
|
+
};
|
|
10
|
+
tooltipContent: {
|
|
11
|
+
padding: number;
|
|
12
|
+
};
|
|
13
|
+
buttonNext: {
|
|
14
|
+
display: string;
|
|
15
|
+
};
|
|
16
|
+
buttonBack: {
|
|
17
|
+
display: string;
|
|
18
|
+
};
|
|
19
|
+
buttonClose: {
|
|
20
|
+
display: string;
|
|
21
|
+
};
|
|
22
|
+
buttonSkip: {
|
|
23
|
+
display: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const minorStepStyles: {
|
|
27
|
+
tooltip: {
|
|
28
|
+
padding: number;
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
borderRadius: "4px";
|
|
31
|
+
border: string;
|
|
32
|
+
filter: string;
|
|
33
|
+
boxShadow: string;
|
|
34
|
+
};
|
|
35
|
+
tooltipContent: {
|
|
36
|
+
padding: number;
|
|
37
|
+
};
|
|
38
|
+
buttonNext: {
|
|
39
|
+
display: string;
|
|
40
|
+
};
|
|
41
|
+
buttonBack: {
|
|
42
|
+
display: string;
|
|
43
|
+
};
|
|
44
|
+
buttonClose: {
|
|
45
|
+
display: string;
|
|
46
|
+
};
|
|
47
|
+
buttonSkip: {
|
|
48
|
+
display: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const getMajorJoyrideStyles: (isClosing: boolean) => {
|
|
52
|
+
options: {
|
|
53
|
+
arrowColor: string;
|
|
54
|
+
backgroundColor: string;
|
|
55
|
+
overlayColor: string;
|
|
56
|
+
primaryColor: string;
|
|
57
|
+
textColor: string;
|
|
58
|
+
zIndex: 10000;
|
|
59
|
+
};
|
|
60
|
+
tooltip: {
|
|
61
|
+
padding: number;
|
|
62
|
+
backgroundColor: string;
|
|
63
|
+
borderRadius: string;
|
|
64
|
+
border: string;
|
|
65
|
+
filter: string;
|
|
66
|
+
boxShadow: string;
|
|
67
|
+
position: "fixed";
|
|
68
|
+
top: string;
|
|
69
|
+
left: string;
|
|
70
|
+
transform: string;
|
|
71
|
+
};
|
|
72
|
+
tooltipContent: {
|
|
73
|
+
padding: number;
|
|
74
|
+
};
|
|
75
|
+
buttonNext: {
|
|
76
|
+
display: string;
|
|
77
|
+
};
|
|
78
|
+
buttonBack: {
|
|
79
|
+
display: string;
|
|
80
|
+
};
|
|
81
|
+
buttonClose: {
|
|
82
|
+
display: string;
|
|
83
|
+
};
|
|
84
|
+
buttonSkip: {
|
|
85
|
+
display: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare const getMinorJoyrideStyles: (isClosing: boolean) => {
|
|
89
|
+
options: {
|
|
90
|
+
arrowColor: string;
|
|
91
|
+
backgroundColor: string;
|
|
92
|
+
overlayColor: string;
|
|
93
|
+
primaryColor: string;
|
|
94
|
+
textColor: string;
|
|
95
|
+
zIndex: 10000;
|
|
96
|
+
};
|
|
97
|
+
spotlight: {
|
|
98
|
+
boxShadow: string;
|
|
99
|
+
borderRadius: "8px";
|
|
100
|
+
};
|
|
101
|
+
tooltip: {
|
|
102
|
+
padding: number;
|
|
103
|
+
backgroundColor: string;
|
|
104
|
+
borderRadius: "4px";
|
|
105
|
+
border: string;
|
|
106
|
+
filter: string;
|
|
107
|
+
boxShadow: string;
|
|
108
|
+
maxWidth: string;
|
|
109
|
+
};
|
|
110
|
+
tooltipContent: {
|
|
111
|
+
padding: number;
|
|
112
|
+
};
|
|
113
|
+
buttonNext: {
|
|
114
|
+
display: string;
|
|
115
|
+
};
|
|
116
|
+
buttonBack: {
|
|
117
|
+
display: string;
|
|
118
|
+
};
|
|
119
|
+
buttonClose: {
|
|
120
|
+
display: string;
|
|
121
|
+
};
|
|
122
|
+
buttonSkip: {
|
|
123
|
+
display: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const getMajorPopupStyles: (startAnimation: boolean, transform: string) => {
|
|
3
|
+
container: CSSProperties;
|
|
4
|
+
skipButton: {
|
|
5
|
+
base: CSSProperties;
|
|
6
|
+
hover: CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
imageContainer: CSSProperties;
|
|
9
|
+
image: CSSProperties;
|
|
10
|
+
imagePlaceholder: CSSProperties;
|
|
11
|
+
contentContainer: CSSProperties;
|
|
12
|
+
title: CSSProperties;
|
|
13
|
+
content: CSSProperties;
|
|
14
|
+
exploreButton: {
|
|
15
|
+
base: CSSProperties;
|
|
16
|
+
hover: CSSProperties;
|
|
17
|
+
};
|
|
18
|
+
navigationContainer: CSSProperties;
|
|
19
|
+
navigationButton: (disabled: boolean) => {
|
|
20
|
+
base: CSSProperties;
|
|
21
|
+
hover: CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as n,BORDER_RADIUS as i,SPACING as o}from"../constants/dimensions.js";import{Z_INDEX as a}from"../constants/zIndex.js";const r=(r,l)=>({container:{width:`${n.MAJOR.width}px`,height:`${n.MAJOR.height}px`,display:"flex",backgroundColor:t.grayscale[900],borderRadius:i.POPUP,overflow:"hidden",position:"relative",transform:r?l:"scale(1)",opacity:r?0:1,transition:e},skipButton:{base:{position:"absolute",top:o.MAJOR.skipButtonTop,right:o.MAJOR.skipButtonRight,background:"transparent",border:"none",color:t.grayscale[400],fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:a.SKIP_BUTTON,transition:"all 0.2s"},hover:{backgroundColor:t.grayscale[100],color:t.grayscale[700]}},imageContainer:{backgroundColor:t.grayscale[900],width:`${n.MAJOR.imageWidth}px`,height:`${n.MAJOR.imageHeight}px`,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:o.MAJOR.imagePadding},image:{width:`${n.MAJOR.imageInnerWidth}px`,height:`${n.MAJOR.imageInnerHeight}px`,objectFit:"cover"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:`${n.MAJOR.imagePlaceholderWidth}px`,height:`${n.MAJOR.imagePlaceholderHeight}px`,display:"flex",alignItems:"center",justifyContent:"center"},contentContainer:{flex:1,display:"flex",margin:o.MAJOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:o.MAJOR.titlePadding,color:t.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 ${t.warning[500]}`,color:t.warning[500],borderRadius:i.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:o.MAJOR.buttonMarginTop},hover:{backgroundColor:"rgba(254, 192, 45, 0.1)"}},navigationContainer:{position:"absolute",bottom:o.MAJOR.navigationBottom,right:o.MAJOR.navigationRight,display:"flex",gap:o.MAJOR.navigationGap,alignItems:"center"},navigationButton:e=>({base:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:e?t.grayscale[700]:t.grayscale.white,fontSize:"20px",cursor:e?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},hover:{color:t.warning[500]}})});export{r as getMajorPopupStyles};
|
|
@@ -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
|
+
import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as i,BORDER_RADIUS as o,SPACING as n}from"../constants/dimensions.js";import{Z_INDEX as a}from"../constants/zIndex.js";const r=(r,s)=>({container:{width:`${i.MINOR.width}px`,height:`${i.MINOR.height}px`,display:"flex",backgroundColor:t.grayscale.white,borderRadius:o.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:r?s:"scale(1)",opacity:r?0:1,transition:e},imageContainer:{backgroundColor:t.grayscale[50],borderRadius:o.IMAGE,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:n.MINOR.imageMargin,width:`${i.MINOR.imageWidth}px`,minWidth:`${i.MINOR.imageWidth}px`,maxWidth:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`},imageWrapper:{position:"relative",width:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`},image:{width:`${i.MINOR.imageWidth}px`,height:`${i.MINOR.imageHeight}px`,objectFit:"cover",borderRadius:o.IMAGE,display:"block"},badge:{position:"absolute",top:"0px",left:"0px",right:"0px",height:`${i.MINOR.badgeHeight}px`,backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:`${o.IMAGE} ${o.IMAGE} ${o.IMAGE} ${o.IMAGE}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:a.IMAGE_BADGE},badgeText:{color:t.grayscale.white,fontWeight:"600",fontSize:"14px"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t.grayscale[100],borderRadius:o.IMAGE},contentContainer:{flex:1,display:"flex",margin:n.MINOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:t.grayscale[900],lineHeight:"1.25",textAlign:"left"},content:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:t.grayscale[700],textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},actionsContainer:{position:"absolute",bottom:n.MINOR.actionsBottom,right:n.MINOR.actionsRight,display:"flex",gap:n.MINOR.actionsGap,alignItems:"center"},understoodText:{color:t.brand[800],fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"},exploreButton:{backgroundColor:t.brand[800],border:"none",color:t.grayscale.white,borderRadius:o.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}});export{r as getMinorPopupStyles};
|
|
@@ -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
|
+
import"../constants/animations.js";import{BORDER_RADIUS as o}from"../constants/dimensions.js";import{Z_INDEX as t}from"../constants/zIndex.js";const e={backdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.9)",zIndex:t.VIDEO_MODAL,display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},container:{position:"relative",width:"90vw",height:"90vh",maxWidth:"1200px",maxHeight:"800px",backgroundColor:"black",borderRadius:o.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:o.CLOSE_BUTTON,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:t.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:o.VIDEO_MODAL},video:{width:"100%",height:"100%",objectFit:"contain",borderRadius:o.VIDEO_MODAL},noVideoMessage:{color:"white",fontSize:"18px",textAlign:"center"}};export{e as videoModalStyles};
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
createdAt: FirestoreTimestamp;
|
|
28
|
+
expirationDate?: FirestoreTimestamp | string | Date;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Store feature progress tracking
|
|
32
|
+
*/
|
|
33
|
+
export interface StoreFeatureProgress {
|
|
34
|
+
storeId: string;
|
|
35
|
+
viewedFeatures: Record<string, boolean>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Feature update types
|
|
39
|
+
*/
|
|
40
|
+
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
|
+
}
|