@bikdotai/bik-component-library 0.0.721-beta.1 → 0.0.721-beta.11
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.js +1 -1
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +1 -0
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +1 -0
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/cjs/components/whats-new/WhatsNewButton.js +1 -1
- package/dist/cjs/components/whats-new/useWhatsNew.js +1 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +1 -0
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +1 -0
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/esm/components/whats-new/WhatsNewButton.js +1 -1
- package/dist/esm/components/whats-new/useWhatsNew.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),o=require("react-joyride"),n=require("./MajorUpdatePopup.js"),a=require("./MinorUpdatePopup.js"),r=require("./useFeatureAnnouncements.js"),s=require("./VideoModal.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(o);const u="#007bff";exports.default=i=>{let{children:d,fetchVisibleFeatures:p,getStoreFeatureProgress:c,fetchFeatureById:f,markFeatureAsViewedForStore:b,isFeatureApplicableToCurrentPage:g,module:x,router:h}=i;var m;const{majorUpdateFeatures:k,minorUpdateFeatures:C,isLoading:y,markFeatureAsViewed:S}=r.useFeatureAnnouncements({fetchVisibleFeatures:p,getStoreFeatureProgress:c,fetchFeatureById:f,markFeatureAsViewedForStore:b,isFeatureApplicableToCurrentPage:g,module:x,router:h}),[T,w]=t.useState(null),[B,j]=t.useState(null),[E,v]=t.useState(!1),[F,I]=t.useState([]),[N,R]=t.useState(!1),[P,M]=t.useState([]),[W,q]=t.useState(!1),[O,V]=t.useState(!1),[A,L]=t.useState([]),[U,$]=t.useState(!1),[z,_]=t.useState(!1),[D,G]=t.useState(!1),[H,J]=t.useState(""),[K,Q]=t.useState(!1);t.useEffect((()=>{if(!(k.length>0)||T||y||W||K)0!==k.length||y||_(!0);else{_(!1),$(!1),v(!1),I([]),j(null),L([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?X(k[0]):setTimeout(e,1e3)};e()}}),[k,T,y,W,K]),t.useEffect((()=>{var e;const t=null===(e=null==h?void 0:h.query)||void 0===e?void 0:e.featureId;if(!t||y||0===C.length)return;const o=C.find((e=>e.id===t));if(!o||!o.featureTag)return;$(!0);let n=0;const a=setInterval((()=>{n++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;document.querySelector(e)?(re(o),clearInterval(a)):n>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),clearInterval(a))}),200);return()=>{clearInterval(a)}}),[C,null===(m=null==h?void 0:h.query)||void 0===m?void 0:m.featureId,y]),t.useEffect((()=>{if(C.length>0&&!y&&!E&&!O&&!B&&!U&&z&&!K){let e=null,t=null,o=null,n=!1;const a=()=>{if(n||O||B||U||!z)return;const a=C.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));a.length>0&&(L(a),re(a[0]),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const n=o.addedNodes[e];if(n.nodeType===Node.ELEMENT_NODE){const e=n;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}E||n||O||B||U||!z||!t||(o&&clearTimeout(o),o=setTimeout((()=>{n||O||B||U||!z||a()}),200))})),t=()=>{E||n||O||B||U||!z||(o&&clearTimeout(o),o=setTimeout((()=>{n||O||B||U||!z||a()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),a(),setTimeout((()=>{n||O||B||U||!z||a()}),100),setTimeout((()=>{n||O||B||U||!z||a()}),1e3),setTimeout((()=>{n||O||B||U||!z||a()}),500),()=>{n=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}(0===C.length||y)&&(v(!1),I([]),j(null),L([]),$(!1))}),[C,y,E,O,B,U,z,S,K]);const X=t=>{w(t);const o=k.findIndex((e=>e.id===t.id)),a=k.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(n.default,{feature:t,currentIndex:o,totalFeatures:a,onSkip:()=>Y(t),onExplore:()=>Z(t),onPrevious:()=>ee(t),onNext:()=>te(t)}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];M(r),R(!0)},Y=t.useCallback((e=>{(e||T)&&(q(!0),k.forEach((e=>{S(e.id)})),R(!1),w(null),M([]),_(!0),setTimeout((()=>{q(!1)}),500))}),[T,k,S]),Z=t.useCallback((e=>{q(!0),S(e.id),e.productVideo&&(J(e.productVideo),G(!0),Q(!0)),R(!1),w(null),M([]);k.findIndex((t=>t.id===e.id))===k.length-1&&_(!0),setTimeout((()=>{q(!1)}),500)}),[k,S]),ee=t.useCallback((t=>{const o=t||T;if(!o)return;const a=k.findIndex((e=>e.id===o.id));if(a>0){const t=k[a-1];w(t);const o=a-1,r=k.length,s=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(n.default,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>Y(t),onExplore:()=>Z(t),onPrevious:()=>ee(t),onNext:()=>te(t)}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];M(s)}}),[T,k]),te=t.useCallback((t=>{const o=t||T;if(!o)return;const a=k.findIndex((e=>e.id===o.id));if(a<k.length-1){const t=k[a+1];w(t);const o=a+1,r=k.length,s=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(n.default,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>Y(t),onExplore:()=>Z(t),onPrevious:()=>ee(t),onNext:()=>te(t)}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];M(s)}else q(!0),S(o.id),R(!1),w(null),M([]),_(!0),setTimeout((()=>{q(!1)}),500)}),[T,k,S]),oe=()=>{if(k.length>0&&!T){document.querySelector('[data-testid="whats-new-button"]')&&X(k[0])}};t.useEffect((()=>(window.showMajorUpdatePopup=oe,()=>{delete window.showMajorUpdatePopup})),[k,T]);const ne=t.useCallback((e=>{const{action:t}=e;t===o.ACTIONS.CLOSE&&(T&&(q(!0),k.forEach((e=>{S(e.id)})),_(!0),setTimeout((()=>{q(!1)}),500)),R(!1),w(null),M([]))}),[T,k,S]),ae=t.useCallback((e=>{const{action:t}=e;t===o.ACTIONS.CLOSE&&(B&&(V(!0),$(!0),C.forEach((e=>{S(e.id)})),setTimeout((()=>{V(!1)}),500)),v(!1),j(null),I([]))}),[B,C,S]),re=t=>{j(t);const o=A.findIndex((e=>e.id===t.id)),n=A.length,r=[{target:t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ie(t),onPrevious:()=>le(t),onNext:()=>ue(t)}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];I(r),v(!0)},se=t.useCallback((e=>{(e||B)&&(V(!0),$(!0),C.forEach((e=>{S(e.id)})),v(!1),j(null),I([]),setTimeout((()=>{V(!1)}),500))}),[B,C,S]),ie=t.useCallback((e=>{V(!0),$(!0),S(e.id),e.productVideo&&(J(e.productVideo),G(!0),Q(!0)),v(!1),j(null),I([]),setTimeout((()=>{V(!1)}),500)}),[S]),le=t.useCallback((t=>{const o=t||B;if(!o)return;const n=A.findIndex((e=>e.id===o.id));if(n>0){const t=A[n-1];j(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=n-1,s=A.length,i=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:r,totalFeatures:s,onSkip:()=>se(t),onExplore:()=>ie(t),onPrevious:()=>le(t),onNext:()=>ue(t)}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];I(i)}}),[B,A]),ue=t.useCallback((t=>{const o=t||B;if(!o)return;const n=A.findIndex((e=>e.id===o.id));if(n<A.length-1){const t=A[n+1];j(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=n+1,s=A.length,i=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:r,totalFeatures:s,onSkip:()=>se(t),onExplore:()=>ie(t),onPrevious:()=>le(t),onNext:()=>ue(t)}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];I(i)}else V(!0),$(!0),S(o.id),v(!1),j(null),I([]),setTimeout((()=>{V(!1)}),500)}),[B,A,S]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[d,P.length>0&&e.jsxRuntimeExports.jsx(l.default,{steps:P,run:N,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ne,disableOverlayClose:!1,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:"#212121"},overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"},spotlight:{backgroundColor:"transparent",border:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),F.length>0&&e.jsxRuntimeExports.jsx(l.default,{steps:F,run:E,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ae,disableOverlayClose:!1,disableCloseOnEsc:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:"#ffffff"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsxRuntimeExports.jsx(s.VideoModal,{isOpen:D,videoUrl:H,onClose:()=>{G(!1),J(""),Q(!1)}})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),o=require("react-joyride"),n=require("./MajorUpdatePopup.js"),a=require("./MinorUpdatePopup.js"),r=require("./useFeatureAnnouncements.js"),s=require("./VideoModal.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(o);const u="#007bff";exports.default=i=>{let{children:d,fetchVisibleFeatures:p,getStoreFeatureProgress:c,fetchFeatureById:f,markFeatureAsViewedForStore:b,isFeatureApplicableToCurrentPage:g,module:x,router:h}=i;var m;const{majorUpdateFeatures:C,minorUpdateFeatures:k,isLoading:S,markFeatureAsViewed:y}=r.useFeatureAnnouncements({fetchVisibleFeatures:p,getStoreFeatureProgress:c,fetchFeatureById:f,markFeatureAsViewedForStore:b,isFeatureApplicableToCurrentPage:g,module:x,router:h}),[T,w]=t.useState(null),[B,j]=t.useState(null),[E,v]=t.useState(!1),[F,I]=t.useState([]),[N,R]=t.useState(!1),[P,M]=t.useState([]),[W,q]=t.useState(!1),[O,V]=t.useState(!1),[A,L]=t.useState([]),[U,$]=t.useState(!1),[z,_]=t.useState(!1),[D,G]=t.useState(!1),[H,J]=t.useState(""),[K,Q]=t.useState(!1),[X,Y]=t.useState(!1),[Z,ee]=t.useState(!1);t.useEffect((()=>{if(!(C.length>0)||T||S||W||K)0!==C.length||S||_(!0);else{_(!1),$(!1),v(!1),I([]),j(null),L([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?te(C[0]):setTimeout(e,1e3)};e()}}),[C,T,S,W,K]),t.useEffect((()=>{var e;const t=null===(e=null==h?void 0:h.query)||void 0===e?void 0:e.featureId;if(!t||S||0===k.length)return;const o=k.find((e=>e.id===t));if(!o||!o.featureTag)return;$(!0),V(!0);let n=0;const a=setInterval((()=>{n++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;document.querySelector(e)?(ue(o),setTimeout((()=>V(!1)),100),clearInterval(a)):n>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),V(!1),clearInterval(a))}),200);return()=>{clearInterval(a),V(!1)}}),[k,null===(m=null==h?void 0:h.query)||void 0===m?void 0:m.featureId,S]),t.useEffect((()=>{if(k.length>0&&!S&&!E&&!O&&!B&&!U&&z&&!K){let e=null,t=null,o=null,n=!1;const a=()=>{if(n||O||B||U||!z)return;const a=k.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));a.length>0&&(L(a),ue(a[0]),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const n=o.addedNodes[e];if(n.nodeType===Node.ELEMENT_NODE){const e=n;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}E||n||O||B||U||!z||!t||(o&&clearTimeout(o),o=setTimeout((()=>{n||O||B||U||!z||a()}),200))})),t=()=>{E||n||O||B||U||!z||(o&&clearTimeout(o),o=setTimeout((()=>{n||O||B||U||!z||a()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),a(),setTimeout((()=>{n||O||B||U||!z||a()}),100),setTimeout((()=>{n||O||B||U||!z||a()}),1e3),setTimeout((()=>{n||O||B||U||!z||a()}),500),()=>{n=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}(0===k.length||S)&&(v(!1),I([]),j(null),L([]),$(!1))}),[k,S,E,O,B,U,z,y,K]);const te=t=>{w(t);const o=C.findIndex((e=>e.id===t.id)),a=C.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(n.default,{feature:t,currentIndex:o,totalFeatures:a,onSkip:()=>oe(t),onExplore:()=>ne(t),onPrevious:()=>ae(t),onNext:()=>re(t),setIsClosing:Y}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];M(r),R(!0)},oe=t.useCallback((e=>{(e||T)&&(q(!0),C.forEach((e=>{y(e.id)})),R(!1),w(null),M([]),_(!0),setTimeout((()=>{q(!1)}),500))}),[T,C,y]),ne=t.useCallback((e=>{q(!0),y(e.id),e.productVideo&&(J(e.productVideo),G(!0),Q(!0)),R(!1),w(null),M([]);C.findIndex((t=>t.id===e.id))===C.length-1&&_(!0),setTimeout((()=>{q(!1)}),500)}),[C,y]),ae=t.useCallback((t=>{const o=t||T;if(!o)return;const a=C.findIndex((e=>e.id===o.id));if(a>0){const t=C[a-1];w(t);const o=a-1,r=C.length,s=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(n.default,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>oe(t),onExplore:()=>ne(t),onPrevious:()=>ae(t),onNext:()=>re(t),setIsClosing:Y}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];M(s)}}),[T,C]),re=t.useCallback((t=>{const o=t||T;if(!o)return;const a=C.findIndex((e=>e.id===o.id));if(a<C.length-1){const t=C[a+1];w(t);const o=a+1,r=C.length,s=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(n.default,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>oe(t),onExplore:()=>ne(t),onPrevious:()=>ae(t),onNext:()=>re(t),setIsClosing:Y}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];M(s)}else q(!0),y(o.id),R(!1),w(null),M([]),_(!0),setTimeout((()=>{q(!1)}),500)}),[T,C,y]),se=()=>{if(C.length>0&&!T){document.querySelector('[data-testid="whats-new-button"]')&&te(C[0])}};t.useEffect((()=>(window.showMajorUpdatePopup=se,()=>{delete window.showMajorUpdatePopup})),[C,T]);const ie=t.useCallback((e=>{const{action:t}=e;t===o.ACTIONS.CLOSE&&(T&&(q(!0),C.forEach((e=>{y(e.id)})),_(!0),setTimeout((()=>{q(!1)}),500)),R(!1),w(null),M([]))}),[T,C,y]),le=t.useCallback((e=>{const{action:t}=e;t===o.ACTIONS.CLOSE&&(B&&(V(!0),$(!0),k.forEach((e=>{y(e.id)})),setTimeout((()=>{V(!1)}),500)),v(!1),j(null),I([]))}),[B,k,y]),ue=t=>{j(t);const o=A.findIndex((e=>e.id===t.id)),n=A.length,r=[{target:t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>de(t),onExplore:()=>pe(t),onPrevious:()=>ce(t),onNext:()=>fe(t),setIsClosing:ee}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];I(r),v(!0)},de=t.useCallback((e=>{(e||B)&&(V(!0),$(!0),k.forEach((e=>{y(e.id)})),v(!1),j(null),I([]),setTimeout((()=>{V(!1)}),500))}),[B,k,y]),pe=t.useCallback((e=>{V(!0),$(!0),y(e.id),e.productVideo&&(J(e.productVideo),G(!0),Q(!0)),v(!1),j(null),I([]),setTimeout((()=>{V(!1)}),500)}),[y]),ce=t.useCallback((t=>{const o=t||B;if(!o)return;const n=A.findIndex((e=>e.id===o.id));if(n>0){const t=A[n-1];j(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=n-1,s=A.length,i=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:r,totalFeatures:s,onSkip:()=>de(t),onExplore:()=>pe(t),onPrevious:()=>ce(t),onNext:()=>fe(t),setIsClosing:ee}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];I(i)}}),[B,A]),fe=t.useCallback((t=>{const o=t||B;if(!o)return;const n=A.findIndex((e=>e.id===o.id));if(n<A.length-1){const t=A[n+1];j(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=n+1,s=A.length,i=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:r,totalFeatures:s,onSkip:()=>de(t),onExplore:()=>pe(t),onPrevious:()=>ce(t),onNext:()=>fe(t),setIsClosing:ee}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];I(i)}else V(!0),$(!0),y(o.id),v(!1),j(null),I([]),setTimeout((()=>{V(!1)}),500)}),[B,A,y]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[d,P.length>0&&e.jsxRuntimeExports.jsx(l.default,{steps:P,run:N,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ie,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:X?"transparent":"#212121"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",border:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),F.length>0&&e.jsxRuntimeExports.jsx(l.default,{steps:F,run:E,continuous:!1,showProgress:!1,showSkipButton:!1,callback:le,disableOverlayClose:!0,disableCloseOnEsc:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:Z?"transparent":"#ffffff"},overlay:{backgroundColor:Z?"transparent":"rgba(0, 0, 0, 0.4)"},spotlight:{backgroundColor:"transparent",borderRadius:"8px",boxShadow:Z?"none":"0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsxRuntimeExports.jsx(s.VideoModal,{isOpen:D,videoUrl:H,onClose:()=>{G(!1),J(""),Q(!1)}})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react");const n=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value};exports.default=r=>{let{feature:o,currentIndex:s,totalFeatures:i,onSkip:l,onExplore:a,onPrevious:c,onNext:u,setIsClosing:p}=r;const[x,d]=t.useState(!1),[g,f]=t.useState(!1),[h,y]=t.useState(""),j=t.useRef(null);t.useEffect((()=>{x&&f(!0)}),[x]);const b=e=>{if(j.current){const e=j.current.closest('[class*="react-joyride__tooltip"]');if(e){const t=e.querySelector('[class*="react-joyride__arrow"]');t&&(t.style.display="none",t.style.visibility="hidden",t.style.opacity="0")}}let t=null;if(t=document.querySelector('[data-testid="whats-new-button"]'),t||(t=document.querySelector(".main-icon-class")),!t){const e=document.querySelector('svg[viewBox="0 0 32 32"]');if(e){e.querySelector('clipPath[id*="clip"]')&&(t=e.closest('[data-testid="whats-new-button"]')||e.parentElement)}}if(console.log("What's New button found:",!!t,t),t&&j.current){const e=j.current.getBoundingClientRect(),n=t.getBoundingClientRect();console.log("Popup rect:",e),console.log("Target rect:",n);const r=n.left+n.width/2-(e.left+e.width/2),o=n.top+n.height/2-(e.top+e.height/2);console.log("Translation:",{translateX:r,translateY:o}),y(`translate(${r}px, ${o}px) scale(0)`)}else y("scale(0)");null==p||p(!0),d(!0),setTimeout((()=>{e()}),1150)};return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",Object.assign({ref:j,style:{width:"959px",height:"274px",display:"flex",backgroundColor:"#212121",borderRadius:"4px",overflow:"hidden",position:"relative",transform:g?h:"scale(1)",opacity:g?0:1,transition:"transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1)"}},{children:[e.jsxRuntimeExports.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),b(l)},style:{position:"absolute",top:"10px",right:"10px",background:"transparent",border:"none",color:"#BDBDBD",fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:10,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f3f4f6",e.currentTarget.style.color="#374151"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="#6b7280"}},{children:"Skip"})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{backgroundColor:"#212121",width:"480px",height:"274px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"}},{children:o.displayImage?e.jsxRuntimeExports.jsx("img",{src:o.displayImage,alt:o.title,style:{width:"464px",height:"258px",objectFit:"cover"},onError:e=>{o.image&&(e.target.src=o.image)}}):e.jsxRuntimeExports.jsx("div",Object.assign({style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",width:"290px",height:"258px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:"Feature Preview"}))})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{flex:1,display:"flex",margin:"0 8px 0 0",flexDirection:"column",justifyContent:"space-between",background:"transparent"}},{children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",Object.assign({style:{fontSize:"16px",fontWeight:"600",padding:"36px 0 0 0",color:"#fff",lineHeight:"1.25",textAlign:"left"}},{children:o.title})),e.jsxRuntimeExports.jsx("div",{style:{fontSize:"14px",lineHeight:"1.5",color:"rgba(255, 255, 255, 0.8)",textAlign:"left"},dangerouslySetInnerHTML:{__html:n(o.content||o.body||"")}}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("button",Object.assign({onClick:()=>{b(a)},style:{backgroundColor:"transparent",border:"1px solid #FEC02D",color:"#FEC02D",borderRadius:"4px",fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"16px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(254, 192, 45, 0.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},{children:o.buttonText||"Explore the feature"}))})]}),i>1&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",gap:"8px",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),b(c)},disabled:0===s,style:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:0===s?"#666":"#fff",fontSize:"20px",cursor:0===s?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{0!==s&&(e.currentTarget.style.color="#FEC02D")},onMouseLeave:e=>{0!==s&&(e.currentTarget.style.color="#fff")}},{children:"‹"})),e.jsxRuntimeExports.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),b(u)},disabled:s===i-1,style:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:s===i-1?"#666":"#fff",fontSize:"20px",cursor:s===i-1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{s!==i-1&&(e.currentTarget.style.color="#FEC02D")},onMouseLeave:e=>{s!==i-1&&(e.currentTarget.style.color="#fff")}},{children:"›"}))]}))]}))]}))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react");const i=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value};exports.default=s=>{let{feature:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react");const i=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value};exports.default=s=>{let{feature:r,currentIndex:n,totalFeatures:o,onSkip:l,onExplore:a,onPrevious:x,onNext:p,setIsClosing:c}=s;const[d,u]=t.useState(!1),[f,g]=t.useState(!1),[h,j]=t.useState(""),b=t.useRef(null);t.useEffect((()=>{d&&g(!0)}),[d]);const m=e=>{if(b.current){const e=b.current.closest('[class*="react-joyride__tooltip"]');if(e){const t=e.querySelector('[class*="react-joyride__arrow"]');t&&(t.style.display="none",t.style.visibility="hidden",t.style.opacity="0")}}if(b.current&&r.featureTag){const e=r.featureTag.startsWith("#")||r.featureTag.startsWith(".")||r.featureTag.startsWith("[")?r.featureTag:`#${r.featureTag}`,t=document.querySelector(e);if(t){const e=b.current.getBoundingClientRect(),i=t.getBoundingClientRect(),s=i.left+i.width/2-(e.left+e.width/2),r=i.top+i.height/2-(e.top+e.height/2);j(`translate(${s}px, ${r}px) scale(0)`)}else j("scale(0)")}else j("scale(0)");null==c||c(!0),u(!0),setTimeout((()=>{e()}),1150)};return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",Object.assign({ref:b,style:{width:"519px",height:"160px",display:"flex",backgroundColor:"#ffffff",borderRadius:"4px",overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)",transform:f?h:"scale(1)",opacity:f?0:1,transition:"transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1)"}},{children:[e.jsxRuntimeExports.jsx("div",Object.assign({style:{backgroundColor:"#f9fafb",borderRadius:"4px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:"13px 10px 13px 10px",width:"235px",minWidth:"235px",maxWidth:"235px",height:"134px"}},{children:r.displayImage?e.jsxRuntimeExports.jsxs("div",Object.assign({style:{position:"relative",width:"235px",height:"134px"}},{children:[e.jsxRuntimeExports.jsx("img",{src:r.displayImage,alt:r.title,style:{width:"235px",height:"134px",objectFit:"cover",borderRadius:"4px",display:"block"},onError:e=>{r.image&&(e.target.src=r.image)}}),e.jsxRuntimeExports.jsx("div",Object.assign({style:{position:"absolute",top:"0px",left:"0px",right:"0px",height:"27px",backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px 4px 4px 4px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10}},{children:e.jsxRuntimeExports.jsx("span",Object.assign({style:{color:"#ffffff",fontWeight:"600",fontSize:"14px"}},{children:"New feature"}))}))]})):e.jsxRuntimeExports.jsx("div",Object.assign({style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f3f4f6",borderRadius:"4px"}},{children:"Feature Preview"}))})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{flex:1,display:"flex",margin:"13px 13px 13px 3px",flexDirection:"column",justifyContent:"space-between",background:"transparent"}},{children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",Object.assign({style:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:"#212121",lineHeight:"1.25",textAlign:"left"}},{children:r.title})),e.jsxRuntimeExports.jsx("div",{style:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:"#616161",textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},dangerouslySetInnerHTML:{__html:i(r.content||r.body||"")}})]}),e.jsxRuntimeExports.jsxs("div",Object.assign({style:{position:"absolute",bottom:"13px",right:"10px",display:"flex",gap:"16px",alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx("span",Object.assign({onClick:()=>m(l),style:{color:"#4B1583",fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"}},{children:"Understood"})),r.productVideo&&e.jsxRuntimeExports.jsx("button",Object.assign({onClick:()=>{m(a)},style:{backgroundColor:"#4B1583",border:"none",color:"#ffffff",borderRadius:"4px",fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}},{children:r.buttonText||"Explore the feature"}))]}))]}))]}))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../constants/Theme.js"),e=require("../tooltips/Tooltip.js"),n=require("./WhatsNew.styles.js");const i=s=>{let{width:e=32,height:n=32}=s;return t.jsxRuntimeExports.jsxs("svg",Object.assign({width:e,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxRuntimeExports.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsxRuntimeExports.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsxRuntimeExports.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))};exports.WhatsNewButton=r=>{let{onClick:o,newContentCount:x=0,isOpen:c=!1,isLoading:d=!1,tooltip:a="What's new",testId:j="whats-new-button",iconWidth:l=32,iconHeight:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),s=require("../../constants/Theme.js"),e=require("../tooltips/Tooltip.js"),n=require("./WhatsNew.styles.js");const i=s=>{let{width:e=32,height:n=32}=s;return t.jsxRuntimeExports.jsxs("svg",Object.assign({width:e,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxRuntimeExports.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsxRuntimeExports.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsxRuntimeExports.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsxRuntimeExports.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))};exports.WhatsNewButton=r=>{let{onClick:o,newContentCount:x=0,isOpen:c=!1,isLoading:d=!1,tooltip:a="What's new",testId:j="whats-new-button",iconWidth:l=32,iconHeight:p=32,customIcon:u}=r;return d?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(n.WhatsNewIconContainer,Object.assign({count:x},{children:t.jsxRuntimeExports.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?s.COLORS.content.brand:s.COLORS.content.primary},onClick:o,"data-testid":j},{children:[t.jsxRuntimeExports.jsx(e.Tooltip,Object.assign({body:a},{children:t.jsxRuntimeExports.jsx("div",{children:u?t.jsxRuntimeExports.jsx(u,{width:l,height:p,color:c?s.COLORS.content.brand:s.COLORS.content.primary}):t.jsxRuntimeExports.jsx(i,{width:l,height:p})})})),x>0&&t.jsxRuntimeExports.jsx("div",Object.assign({className:"notification--count"},{children:t.jsxRuntimeExports.jsx("div",Object.assign({className:"count--text"},{children:x}))}))]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("date-fns"),
|
|
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])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useEffect as o,useCallback as n}from"react";import a,{ACTIONS as r}from"react-joyride";import i from"./MajorUpdatePopup.js";import s from"./MinorUpdatePopup.js";import{useFeatureAnnouncements as d}from"./useFeatureAnnouncements.js";import{VideoModal as l}from"./VideoModal.js";const u="#007bff",p=p=>{let{children:c,fetchVisibleFeatures:f,getStoreFeatureProgress:b,fetchFeatureById:g,markFeatureAsViewedForStore:h,isFeatureApplicableToCurrentPage:m,module:x,router:y}=p;var k;const{majorUpdateFeatures:T,minorUpdateFeatures:C,isLoading:w,markFeatureAsViewed:S}=d({fetchVisibleFeatures:f,getStoreFeatureProgress:b,fetchFeatureById:g,markFeatureAsViewedForStore:h,isFeatureApplicableToCurrentPage:m,module:x,router:y}),[B,v]=t(null),[F,j]=t(null),[I,N]=t(!1),[E,P]=t([]),[W,M]=t(!1),[O,V]=t([]),[L,R]=t(!1),[q,A]=t(!1),[U,$]=t([]),[z,_]=t(!1),[D,G]=t(!1),[H,J]=t(!1),[K,Q]=t(""),[X,Y]=t(!1);o((()=>{if(!(T.length>0)||B||w||L||X)0!==T.length||w||G(!0);else{G(!1),_(!1),N(!1),P([]),j(null),$([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?Z(T[0]):setTimeout(e,1e3)};e()}}),[T,B,w,L,X]),o((()=>{var e;const t=null===(e=null==y?void 0:y.query)||void 0===e?void 0:e.featureId;if(!t||w||0===C.length)return;const o=C.find((e=>e.id===t));if(!o||!o.featureTag)return;_(!0);let n=0;const a=setInterval((()=>{n++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;document.querySelector(e)?(se(o),clearInterval(a)):n>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),clearInterval(a))}),200);return()=>{clearInterval(a)}}),[C,null===(k=null==y?void 0:y.query)||void 0===k?void 0:k.featureId,w]),o((()=>{if(C.length>0&&!w&&!I&&!q&&!F&&!z&&D&&!X){let e=null,t=null,o=null,n=!1;const a=()=>{if(n||q||F||z||!D)return;const a=C.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));a.length>0&&($(a),se(a[0]),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const n=o.addedNodes[e];if(n.nodeType===Node.ELEMENT_NODE){const e=n;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}I||n||q||F||z||!D||!t||(o&&clearTimeout(o),o=setTimeout((()=>{n||q||F||z||!D||a()}),200))})),t=()=>{I||n||q||F||z||!D||(o&&clearTimeout(o),o=setTimeout((()=>{n||q||F||z||!D||a()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),a(),setTimeout((()=>{n||q||F||z||!D||a()}),100),setTimeout((()=>{n||q||F||z||!D||a()}),1e3),setTimeout((()=>{n||q||F||z||!D||a()}),500),()=>{n=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}(0===C.length||w)&&(N(!1),P([]),j(null),$([]),_(!1))}),[C,w,I,q,F,z,D,S,X]);const Z=t=>{v(t);const o=T.findIndex((e=>e.id===t.id)),n=T.length,a=[{target:'[data-testid="whats-new-button"]',content:e.jsx(i,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>ee(t),onExplore:()=>te(t),onPrevious:()=>oe(t),onNext:()=>ne(t)}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];V(a),M(!0)},ee=n((e=>{(e||B)&&(R(!0),T.forEach((e=>{S(e.id)})),M(!1),v(null),V([]),G(!0),setTimeout((()=>{R(!1)}),500))}),[B,T,S]),te=n((e=>{R(!0),S(e.id),e.productVideo&&(Q(e.productVideo),J(!0),Y(!0)),M(!1),v(null),V([]);T.findIndex((t=>t.id===e.id))===T.length-1&&G(!0),setTimeout((()=>{R(!1)}),500)}),[T,S]),oe=n((t=>{const o=t||B;if(!o)return;const n=T.findIndex((e=>e.id===o.id));if(n>0){const t=T[n-1];v(t);const o=n-1,a=T.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(i,{feature:t,currentIndex:o,totalFeatures:a,onSkip:()=>ee(t),onExplore:()=>te(t),onPrevious:()=>oe(t),onNext:()=>ne(t)}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];V(r)}}),[B,T]),ne=n((t=>{const o=t||B;if(!o)return;const n=T.findIndex((e=>e.id===o.id));if(n<T.length-1){const t=T[n+1];v(t);const o=n+1,a=T.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(i,{feature:t,currentIndex:o,totalFeatures:a,onSkip:()=>ee(t),onExplore:()=>te(t),onPrevious:()=>oe(t),onNext:()=>ne(t)}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];V(r)}else R(!0),S(o.id),M(!1),v(null),V([]),G(!0),setTimeout((()=>{R(!1)}),500)}),[B,T,S]),ae=()=>{if(T.length>0&&!B){document.querySelector('[data-testid="whats-new-button"]')&&Z(T[0])}};o((()=>(window.showMajorUpdatePopup=ae,()=>{delete window.showMajorUpdatePopup})),[T,B]);const re=n((e=>{const{action:t}=e;t===r.CLOSE&&(B&&(R(!0),T.forEach((e=>{S(e.id)})),G(!0),setTimeout((()=>{R(!1)}),500)),M(!1),v(null),V([]))}),[B,T,S]),ie=n((e=>{const{action:t}=e;t===r.CLOSE&&(F&&(A(!0),_(!0),C.forEach((e=>{S(e.id)})),setTimeout((()=>{A(!1)}),500)),N(!1),j(null),P([]))}),[F,C,S]),se=t=>{j(t);const o=U.findIndex((e=>e.id===t.id)),n=U.length,a=[{target:t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,content:e.jsx(s,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>de(t),onExplore:()=>le(t),onPrevious:()=>ue(t),onNext:()=>pe(t)}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];P(a),N(!0)},de=n((e=>{(e||F)&&(A(!0),_(!0),C.forEach((e=>{S(e.id)})),N(!1),j(null),P([]),setTimeout((()=>{A(!1)}),500))}),[F,C,S]),le=n((e=>{A(!0),_(!0),S(e.id),e.productVideo&&(Q(e.productVideo),J(!0),Y(!0)),N(!1),j(null),P([]),setTimeout((()=>{A(!1)}),500)}),[S]),ue=n((t=>{const o=t||F;if(!o)return;const n=U.findIndex((e=>e.id===o.id));if(n>0){const t=U[n-1];j(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,a=n-1,r=U.length,i=[{target:o,content:e.jsx(s,{feature:t,currentIndex:a,totalFeatures:r,onSkip:()=>de(t),onExplore:()=>le(t),onPrevious:()=>ue(t),onNext:()=>pe(t)}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];P(i)}}),[F,U]),pe=n((t=>{const o=t||F;if(!o)return;const n=U.findIndex((e=>e.id===o.id));if(n<U.length-1){const t=U[n+1];j(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,a=n+1,r=U.length,i=[{target:o,content:e.jsx(s,{feature:t,currentIndex:a,totalFeatures:r,onSkip:()=>de(t),onExplore:()=>le(t),onPrevious:()=>ue(t),onNext:()=>pe(t)}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];P(i)}else A(!0),_(!0),S(o.id),N(!1),j(null),P([]),setTimeout((()=>{A(!1)}),500)}),[F,U,S]);return e.jsxs(e.Fragment,{children:[c,O.length>0&&e.jsx(a,{steps:O,run:W,continuous:!1,showProgress:!1,showSkipButton:!1,callback:re,disableOverlayClose:!1,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:"#212121"},overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"},spotlight:{backgroundColor:"transparent",border:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),E.length>0&&e.jsx(a,{steps:E,run:I,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ie,disableOverlayClose:!1,disableCloseOnEsc:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:"#ffffff"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsx(l,{isOpen:H,videoUrl:K,onClose:()=>{J(!1),Q(""),Y(!1)}})]})};export{p as default};
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useEffect as o,useCallback as n}from"react";import a,{ACTIONS as r}from"react-joyride";import s from"./MajorUpdatePopup.js";import i from"./MinorUpdatePopup.js";import{useFeatureAnnouncements as d}from"./useFeatureAnnouncements.js";import{VideoModal as l}from"./VideoModal.js";const u="#007bff",p=p=>{let{children:c,fetchVisibleFeatures:f,getStoreFeatureProgress:b,fetchFeatureById:g,markFeatureAsViewedForStore:h,isFeatureApplicableToCurrentPage:m,module:x,router:y}=p;var k;const{majorUpdateFeatures:C,minorUpdateFeatures:T,isLoading:w,markFeatureAsViewed:S}=d({fetchVisibleFeatures:f,getStoreFeatureProgress:b,fetchFeatureById:g,markFeatureAsViewedForStore:h,isFeatureApplicableToCurrentPage:m,module:x,router:y}),[B,v]=t(null),[F,I]=t(null),[j,N]=t(!1),[E,P]=t([]),[W,M]=t(!1),[O,V]=t([]),[L,R]=t(!1),[q,A]=t(!1),[U,$]=t([]),[z,_]=t(!1),[D,G]=t(!1),[H,J]=t(!1),[K,Q]=t(""),[X,Y]=t(!1),[Z,ee]=t(!1),[te,oe]=t(!1);o((()=>{if(!(C.length>0)||B||w||L||X)0!==C.length||w||G(!0);else{G(!1),_(!1),N(!1),P([]),I(null),$([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?ne(C[0]):setTimeout(e,1e3)};e()}}),[C,B,w,L,X]),o((()=>{var e;const t=null===(e=null==y?void 0:y.query)||void 0===e?void 0:e.featureId;if(!t||w||0===T.length)return;const o=T.find((e=>e.id===t));if(!o||!o.featureTag)return;_(!0),A(!0);let n=0;const a=setInterval((()=>{n++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;document.querySelector(e)?(pe(o),setTimeout((()=>A(!1)),100),clearInterval(a)):n>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),A(!1),clearInterval(a))}),200);return()=>{clearInterval(a),A(!1)}}),[T,null===(k=null==y?void 0:y.query)||void 0===k?void 0:k.featureId,w]),o((()=>{if(T.length>0&&!w&&!j&&!q&&!F&&!z&&D&&!X){let e=null,t=null,o=null,n=!1;const a=()=>{if(n||q||F||z||!D)return;const a=T.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));a.length>0&&($(a),pe(a[0]),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const n=o.addedNodes[e];if(n.nodeType===Node.ELEMENT_NODE){const e=n;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}j||n||q||F||z||!D||!t||(o&&clearTimeout(o),o=setTimeout((()=>{n||q||F||z||!D||a()}),200))})),t=()=>{j||n||q||F||z||!D||(o&&clearTimeout(o),o=setTimeout((()=>{n||q||F||z||!D||a()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),a(),setTimeout((()=>{n||q||F||z||!D||a()}),100),setTimeout((()=>{n||q||F||z||!D||a()}),1e3),setTimeout((()=>{n||q||F||z||!D||a()}),500),()=>{n=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}(0===T.length||w)&&(N(!1),P([]),I(null),$([]),_(!1))}),[T,w,j,q,F,z,D,S,X]);const ne=t=>{v(t);const o=C.findIndex((e=>e.id===t.id)),n=C.length,a=[{target:'[data-testid="whats-new-button"]',content:e.jsx(s,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>ae(t),onExplore:()=>re(t),onPrevious:()=>se(t),onNext:()=>ie(t),setIsClosing:ee}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];V(a),M(!0)},ae=n((e=>{(e||B)&&(R(!0),C.forEach((e=>{S(e.id)})),M(!1),v(null),V([]),G(!0),setTimeout((()=>{R(!1)}),500))}),[B,C,S]),re=n((e=>{R(!0),S(e.id),e.productVideo&&(Q(e.productVideo),J(!0),Y(!0)),M(!1),v(null),V([]);C.findIndex((t=>t.id===e.id))===C.length-1&&G(!0),setTimeout((()=>{R(!1)}),500)}),[C,S]),se=n((t=>{const o=t||B;if(!o)return;const n=C.findIndex((e=>e.id===o.id));if(n>0){const t=C[n-1];v(t);const o=n-1,a=C.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(s,{feature:t,currentIndex:o,totalFeatures:a,onSkip:()=>ae(t),onExplore:()=>re(t),onPrevious:()=>se(t),onNext:()=>ie(t),setIsClosing:ee}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];V(r)}}),[B,C]),ie=n((t=>{const o=t||B;if(!o)return;const n=C.findIndex((e=>e.id===o.id));if(n<C.length-1){const t=C[n+1];v(t);const o=n+1,a=C.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(s,{feature:t,currentIndex:o,totalFeatures:a,onSkip:()=>ae(t),onExplore:()=>re(t),onPrevious:()=>se(t),onNext:()=>ie(t),setIsClosing:ee}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];V(r)}else R(!0),S(o.id),M(!1),v(null),V([]),G(!0),setTimeout((()=>{R(!1)}),500)}),[B,C,S]),de=()=>{if(C.length>0&&!B){document.querySelector('[data-testid="whats-new-button"]')&&ne(C[0])}};o((()=>(window.showMajorUpdatePopup=de,()=>{delete window.showMajorUpdatePopup})),[C,B]);const le=n((e=>{const{action:t}=e;t===r.CLOSE&&(B&&(R(!0),C.forEach((e=>{S(e.id)})),G(!0),setTimeout((()=>{R(!1)}),500)),M(!1),v(null),V([]))}),[B,C,S]),ue=n((e=>{const{action:t}=e;t===r.CLOSE&&(F&&(A(!0),_(!0),T.forEach((e=>{S(e.id)})),setTimeout((()=>{A(!1)}),500)),N(!1),I(null),P([]))}),[F,T,S]),pe=t=>{I(t);const o=U.findIndex((e=>e.id===t.id)),n=U.length,a=[{target:t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,content:e.jsx(i,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>be(t),onNext:()=>ge(t),setIsClosing:oe}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];P(a),N(!0)},ce=n((e=>{(e||F)&&(A(!0),_(!0),T.forEach((e=>{S(e.id)})),N(!1),I(null),P([]),setTimeout((()=>{A(!1)}),500))}),[F,T,S]),fe=n((e=>{A(!0),_(!0),S(e.id),e.productVideo&&(Q(e.productVideo),J(!0),Y(!0)),N(!1),I(null),P([]),setTimeout((()=>{A(!1)}),500)}),[S]),be=n((t=>{const o=t||F;if(!o)return;const n=U.findIndex((e=>e.id===o.id));if(n>0){const t=U[n-1];I(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,a=n-1,r=U.length,s=[{target:o,content:e.jsx(i,{feature:t,currentIndex:a,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>be(t),onNext:()=>ge(t),setIsClosing:oe}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];P(s)}}),[F,U]),ge=n((t=>{const o=t||F;if(!o)return;const n=U.findIndex((e=>e.id===o.id));if(n<U.length-1){const t=U[n+1];I(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,a=n+1,r=U.length,s=[{target:o,content:e.jsx(i,{feature:t,currentIndex:a,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>be(t),onNext:()=>ge(t),setIsClosing:oe}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];P(s)}else A(!0),_(!0),S(o.id),N(!1),I(null),P([]),setTimeout((()=>{A(!1)}),500)}),[F,U,S]);return e.jsxs(e.Fragment,{children:[c,O.length>0&&e.jsx(a,{steps:O,run:W,continuous:!1,showProgress:!1,showSkipButton:!1,callback:le,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:Z?"transparent":"#212121"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",border:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),E.length>0&&e.jsx(a,{steps:E,run:j,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ue,disableOverlayClose:!0,disableCloseOnEsc:!1,styles:{options:{primaryColor:u,zIndex:1e4,width:"auto",arrowColor:te?"transparent":"#ffffff"},overlay:{backgroundColor:te?"transparent":"rgba(0, 0, 0, 0.4)"},spotlight:{backgroundColor:"transparent",borderRadius:"8px",boxShadow:te?"none":"0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsx(l,{isOpen:H,videoUrl:K,onClose:()=>{J(!1),Q(""),Y(!1)}})]})};export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t}from"react";const r=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as n,useEffect as o}from"react";const r=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},s=s=>{let{feature:i,currentIndex:l,totalFeatures:a,onSkip:c,onExplore:d,onPrevious:p,onNext:u,setIsClosing:g}=s;const[x,f]=t(!1),[h,y]=t(!1),[b,j]=t(""),m=n(null);o((()=>{x&&y(!0)}),[x]);const C=e=>{if(m.current){const e=m.current.closest('[class*="react-joyride__tooltip"]');if(e){const t=e.querySelector('[class*="react-joyride__arrow"]');t&&(t.style.display="none",t.style.visibility="hidden",t.style.opacity="0")}}let t=null;if(t=document.querySelector('[data-testid="whats-new-button"]'),t||(t=document.querySelector(".main-icon-class")),!t){const e=document.querySelector('svg[viewBox="0 0 32 32"]');if(e){e.querySelector('clipPath[id*="clip"]')&&(t=e.closest('[data-testid="whats-new-button"]')||e.parentElement)}}if(console.log("What's New button found:",!!t,t),t&&m.current){const e=m.current.getBoundingClientRect(),n=t.getBoundingClientRect();console.log("Popup rect:",e),console.log("Target rect:",n);const o=n.left+n.width/2-(e.left+e.width/2),r=n.top+n.height/2-(e.top+e.height/2);console.log("Translation:",{translateX:o,translateY:r}),j(`translate(${o}px, ${r}px) scale(0)`)}else j("scale(0)");null==g||g(!0),f(!0),setTimeout((()=>{e()}),1150)};return e.jsx(e.Fragment,{children:e.jsxs("div",Object.assign({ref:m,style:{width:"959px",height:"274px",display:"flex",backgroundColor:"#212121",borderRadius:"4px",overflow:"hidden",position:"relative",transform:h?b:"scale(1)",opacity:h?0:1,transition:"transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1)"}},{children:[e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),C(c)},style:{position:"absolute",top:"10px",right:"10px",background:"transparent",border:"none",color:"#BDBDBD",fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:10,transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f3f4f6",e.currentTarget.style.color="#374151"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="#6b7280"}},{children:"Skip"})),e.jsx("div",Object.assign({style:{backgroundColor:"#212121",width:"480px",height:"274px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"}},{children:i.displayImage?e.jsx("img",{src:i.displayImage,alt:i.title,style:{width:"464px",height:"258px",objectFit:"cover"},onError:e=>{i.image&&(e.target.src=i.image)}}):e.jsx("div",Object.assign({style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",width:"290px",height:"258px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:"Feature Preview"}))})),e.jsxs("div",Object.assign({style:{flex:1,display:"flex",margin:"0 8px 0 0",flexDirection:"column",justifyContent:"space-between",background:"transparent"}},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:{fontSize:"16px",fontWeight:"600",padding:"36px 0 0 0",color:"#fff",lineHeight:"1.25",textAlign:"left"}},{children:i.title})),e.jsx("div",{style:{fontSize:"14px",lineHeight:"1.5",color:"rgba(255, 255, 255, 0.8)",textAlign:"left"},dangerouslySetInnerHTML:{__html:r(i.content||i.body||"")}}),e.jsx("div",{children:e.jsx("button",Object.assign({onClick:()=>{C(d)},style:{backgroundColor:"transparent",border:"1px solid #FEC02D",color:"#FEC02D",borderRadius:"4px",fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"16px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(254, 192, 45, 0.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},{children:i.buttonText||"Explore the feature"}))})]}),a>1&&e.jsxs("div",Object.assign({style:{position:"absolute",bottom:"16px",right:"16px",display:"flex",gap:"8px",alignItems:"center"}},{children:[e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),C(p)},disabled:0===l,style:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:0===l?"#666":"#fff",fontSize:"20px",cursor:0===l?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{0!==l&&(e.currentTarget.style.color="#FEC02D")},onMouseLeave:e=>{0!==l&&(e.currentTarget.style.color="#fff")}},{children:"‹"})),e.jsx("button",Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),C(u)},disabled:l===a-1,style:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:l===a-1?"#666":"#fff",fontSize:"20px",cursor:l===a-1?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{l!==a-1&&(e.currentTarget.style.color="#FEC02D")},onMouseLeave:e=>{l!==a-1&&(e.currentTarget.style.color="#fff")}},{children:"›"}))]}))]}))]}))})};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t}from"react";const
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useRef as i,useEffect as n}from"react";const r=e=>{if(!e)return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value},s=s=>{let{feature:o,currentIndex:l,totalFeatures:a,onSkip:c,onExplore:x,onPrevious:d,onNext:p,setIsClosing:f}=s;const[g,h]=t(!1),[u,b]=t(!1),[y,j]=t(""),m=i(null);n((()=>{g&&b(!0)}),[g]);const v=e=>{if(m.current){const e=m.current.closest('[class*="react-joyride__tooltip"]');if(e){const t=e.querySelector('[class*="react-joyride__arrow"]');t&&(t.style.display="none",t.style.visibility="hidden",t.style.opacity="0")}}if(m.current&&o.featureTag){const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`,t=document.querySelector(e);if(t){const e=m.current.getBoundingClientRect(),i=t.getBoundingClientRect(),n=i.left+i.width/2-(e.left+e.width/2),r=i.top+i.height/2-(e.top+e.height/2);j(`translate(${n}px, ${r}px) scale(0)`)}else j("scale(0)")}else j("scale(0)");null==f||f(!0),h(!0),setTimeout((()=>{e()}),1150)};return e.jsx(e.Fragment,{children:e.jsxs("div",Object.assign({ref:m,style:{width:"519px",height:"160px",display:"flex",backgroundColor:"#ffffff",borderRadius:"4px",overflow:"hidden",position:"relative",boxShadow:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)",transform:u?y:"scale(1)",opacity:u?0:1,transition:"transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1)"}},{children:[e.jsx("div",Object.assign({style:{backgroundColor:"#f9fafb",borderRadius:"4px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:"13px 10px 13px 10px",width:"235px",minWidth:"235px",maxWidth:"235px",height:"134px"}},{children:o.displayImage?e.jsxs("div",Object.assign({style:{position:"relative",width:"235px",height:"134px"}},{children:[e.jsx("img",{src:o.displayImage,alt:o.title,style:{width:"235px",height:"134px",objectFit:"cover",borderRadius:"4px",display:"block"},onError:e=>{o.image&&(e.target.src=o.image)}}),e.jsx("div",Object.assign({style:{position:"absolute",top:"0px",left:"0px",right:"0px",height:"27px",backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px 4px 4px 4px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10}},{children:e.jsx("span",Object.assign({style:{color:"#ffffff",fontWeight:"600",fontSize:"14px"}},{children:"New feature"}))}))]})):e.jsx("div",Object.assign({style:{color:"#9ca3af",fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f3f4f6",borderRadius:"4px"}},{children:"Feature Preview"}))})),e.jsxs("div",Object.assign({style:{flex:1,display:"flex",margin:"13px 13px 13px 3px",flexDirection:"column",justifyContent:"space-between",background:"transparent"}},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:{fontSize:"16px",fontWeight:"600",padding:"0 0 0 0",color:"#212121",lineHeight:"1.25",textAlign:"left"}},{children:o.title})),e.jsx("div",{style:{fontSize:"12px",fontWeight:"400",lineHeight:"1.2",color:"#616161",textAlign:"left",maxHeight:"48px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},dangerouslySetInnerHTML:{__html:r(o.content||o.body||"")}})]}),e.jsxs("div",Object.assign({style:{position:"absolute",bottom:"13px",right:"10px",display:"flex",gap:"16px",alignItems:"center"}},{children:[e.jsx("span",Object.assign({onClick:()=>v(c),style:{color:"#4B1583",fontSize:"14px",fontWeight:"500",cursor:"pointer",transition:"all 0.2s"}},{children:"Understood"})),o.productVideo&&e.jsx("button",Object.assign({onClick:()=>{v(x)},style:{backgroundColor:"#4B1583",border:"none",color:"#ffffff",borderRadius:"4px",fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"}},{children:o.buttonText||"Explore the feature"}))]}))]}))]}))})};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"../../node_modules/react/jsx-runtime.js";import{COLORS as s}from"../../constants/Theme.js";import{Tooltip as e}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as
|
|
1
|
+
import{j as t}from"../../node_modules/react/jsx-runtime.js";import{COLORS as s}from"../../constants/Theme.js";import{Tooltip as e}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as i}from"./WhatsNew.styles.js";const n=s=>{let{width:e=32,height:i=32}=s;return t.jsxs("svg",Object.assign({width:e,height:i,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[t.jsxs("g",Object.assign({clipPath:"url(#clip0_4309_13422)"},{children:[t.jsx("path",{d:"M22.1797 15.3052L15.4548 24.4022C15.3815 24.5014 15.3339 24.6172 15.316 24.7392C15.2982 24.8613 15.3108 24.9859 15.3526 25.1019L15.7733 26.2675C15.8141 26.3806 15.8815 26.4822 15.9698 26.5638C16.0581 26.6454 16.1647 26.7046 16.2806 26.7364C16.3966 26.7682 16.5185 26.7716 16.636 26.7464C16.7536 26.7212 16.8634 26.6681 16.9561 26.5916L20.7368 23.5654",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M6.4457 17.6642C6.36082 17.7791 6.31051 17.9158 6.30068 18.0583C6.29085 18.2008 6.32192 18.3431 6.39022 18.4686C6.45853 18.594 6.56123 18.6973 6.68626 18.7664C6.81128 18.8355 6.95343 18.8674 7.09598 18.8584C13.4962 18.4646 17.7214 21.3363 17.7214 21.3363L20.7369 23.5654C21.5366 24.1567 22.5385 24.406 23.5221 24.2585C24.5056 24.111 25.3903 23.5789 25.9816 22.7791C26.5728 21.9794 26.8221 20.9775 26.6746 19.9939C26.5272 19.0104 25.995 18.1257 25.1952 17.5344L22.1797 15.3053C22.1797 15.3053 18.1953 12.1079 16.6943 5.87443C16.6611 5.7356 16.5889 5.60913 16.4863 5.50988C16.3837 5.41062 16.2549 5.34272 16.1151 5.31413C15.9752 5.28554 15.8301 5.29746 15.6968 5.34849C15.5635 5.39952 15.4475 5.48754 15.3624 5.6022L6.4457 17.6642Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M7.69175 12.0819L5.24902 11.3518",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M10.9423 8.35748L9.88867 6.03589",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M8.91955 9.68574L5.66699 6.87134",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})),t.jsx("defs",{children:t.jsx("clipPath",Object.assign({id:"clip0_4309_13422"},{children:t.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(4 4)"})}))})]}))},o=o=>{let{onClick:r,newContentCount:c=0,isOpen:d=!1,isLoading:a=!1,tooltip:h="What's new",testId:l="whats-new-button",iconWidth:j=32,iconHeight:p=32,customIcon:x}=o;return a?t.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.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.jsx(i,Object.assign({count:c},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(d?"icon-active":""),style:{color:d?s.content.brand:s.content.primary},onClick:r,"data-testid":l},{children:[t.jsx(e,Object.assign({body:h},{children:t.jsx("div",{children:x?t.jsx(x,{width:j,height:p,color:d?s.content.brand:s.content.primary}):t.jsx(n,{width:j,height:p})})})),c>0&&t.jsx("div",Object.assign({className:"notification--count"},{children:t.jsx("div",Object.assign({className:"count--text"},{children:c}))}))]}))}))};export{o as WhatsNewButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{differenceInBusinessDays as t}from"date-fns";import{useState as o,
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{differenceInBusinessDays as t}from"date-fns";import{useState as o,useRef as r,useEffect as n,useCallback as a}from"react";const i=i=>{let{fetchWhatsNewContent:c,markContentAsViewed:d,module:s,newContentThresholdDays:l=7}=i;const[u,f]=o([]),[w,v]=o(!0),m=r(c),A=r(d);n((()=>{m.current=c}),[c]),n((()=>{A.current=d}),[d]);const h=a((()=>e(void 0,void 0,void 0,(function*(){v(!0);try{const[e,t]=yield m.current();if(e)console.error("Failed to fetch what's new content:",e),f([]);else if(t){let e=t;s&&(e=t.filter((e=>Array.isArray(e.module)?e.module.includes(s):e.module===s))),e.sort(((e,t)=>{var o,r;const n=(null===(o=e.createdAt)||void 0===o?void 0:o.toDate)?e.createdAt.toDate():new Date(e.createdAt);return((null===(r=t.createdAt)||void 0===r?void 0:r.toDate)?t.createdAt.toDate():new Date(t.createdAt)).getTime()-n.getTime()})),f(e)}else f([])}catch(e){console.error("Failed to fetch what's new content:",e),f([])}finally{v(!1)}}))),[s]);n((()=>{h()}),[h]);const D=a((e=>{if(!e.createdAt)return!1;const o=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t(new Date,o)<l}),[l]),y=u.reduce(((e,t)=>D(t)?e+1:e),0);return{whatsNewContent:u,isLoading:w,newContentCount:y,markAsViewed:a((t=>e(void 0,void 0,void 0,(function*(){if(A.current)try{yield A.current(t)}catch(e){console.warn("Failed to mark content as viewed:",e)}}))),[]),refreshContent:a((()=>e(void 0,void 0,void 0,(function*(){yield h()}))),[h])}};export{i as useWhatsNew};
|