@envive-ai/react-hooks 0.2.2 → 0.2.4
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/README.md +35 -0
- package/dist/{NewOrgConfig-sLsJcSn8.cjs → NewOrgConfig-B_1A1d9q.cjs} +2 -2
- package/dist/{NewOrgConfig-CbqBTHzG.js → NewOrgConfig-xNlcpcF_.js} +2 -2
- package/dist/{SystemSettingsContext-BLRfTbCC.js → SystemSettingsContext-CCuS3kWH.js} +2 -2
- package/dist/{SystemSettingsContext-BHi2YaQp.cjs → SystemSettingsContext-Dh_35fES.cjs} +2 -2
- package/dist/{TrackComponentVisibleEvent-CftWp8QR.js → TrackComponentVisibleEvent-B828giM-.js} +3 -3
- package/dist/{TrackComponentVisibleEvent-Dag8vFhb.cjs → TrackComponentVisibleEvent-DsTIH7Yt.cjs} +7 -7
- package/dist/{amplitudeContext-BhhYPJSL.d.ts → amplitudeContext-BfRDG5CX.d.ts} +1 -1
- package/dist/application/models/graphql/index.d.ts +1 -1
- package/dist/application/models/guards/api/index.d.ts +2 -2
- package/dist/application/models/guards/utils.d.ts +1 -1
- package/dist/application/models/index.cjs +3 -2
- package/dist/application/models/index.d.cts +4 -4
- package/dist/application/models/index.d.ts +12 -12
- package/dist/application/models/index.js +3 -3
- package/dist/application/models/utilityTypes/index.d.ts +1 -1
- package/dist/application/models/variantInfo/index.cjs +3 -1
- package/dist/application/models/variantInfo/index.d.cts +2 -2
- package/dist/application/models/variantInfo/index.d.ts +2 -2
- package/dist/application/models/variantInfo/index.js +2 -2
- package/dist/application/utils/index.cjs +7 -8
- package/dist/application/utils/index.d.cts +5 -5
- package/dist/application/utils/index.d.ts +15 -15
- package/dist/application/utils/index.js +7 -8
- package/dist/{atomStore-CZKe3itM.cjs → atomStore-8ppNkJ_n.cjs} +1 -1
- package/dist/{atomStore-BuopbV9k.js → atomStore-BLYJ2ZoQ.js} +1 -1
- package/dist/atoms/app/index.cjs +14 -9
- package/dist/atoms/app/index.d.cts +10 -10
- package/dist/atoms/app/index.d.ts +19 -19
- package/dist/atoms/app/index.js +9 -4
- package/dist/atoms/atomStore/index.cjs +1 -2
- package/dist/atoms/atomStore/index.js +1 -2
- package/dist/atoms/chat/index.cjs +9 -9
- package/dist/atoms/chat/index.d.cts +30 -30
- package/dist/atoms/chat/index.d.ts +39 -39
- package/dist/atoms/chat/index.js +9 -9
- package/dist/atoms/globalSearch/index.cjs +1 -1
- package/dist/atoms/globalSearch/index.d.cts +5 -5
- package/dist/atoms/globalSearch/index.d.ts +6 -6
- package/dist/atoms/globalSearch/index.js +1 -1
- package/dist/atoms/org/index.cjs +7 -8
- package/dist/atoms/org/index.d.cts +21 -21
- package/dist/atoms/org/index.d.ts +30 -30
- package/dist/atoms/org/index.js +3 -4
- package/dist/atoms/search/index.cjs +16 -16
- package/dist/atoms/search/index.d.cts +4 -4
- package/dist/atoms/search/index.d.ts +13 -13
- package/dist/atoms/search/index.js +16 -16
- package/dist/atoms/search/types.cjs +1 -1
- package/dist/atoms/search/types.d.ts +1 -1
- package/dist/atoms/search/types.js +1 -1
- package/dist/atoms/search/utils.cjs +1 -1
- package/dist/atoms/search/utils.d.cts +1 -1
- package/dist/atoms/search/utils.js +1 -1
- package/dist/{cdnContext-ShKWLgKA.cjs → cdnContext-BlRI74F-.cjs} +1 -1
- package/dist/{cdnContext-pfrZ6lfu.js → cdnContext-D26C8Y4H.js} +1 -1
- package/dist/{chat-KkJYXdfZ.cjs → chat-2NGrmU_Z.cjs} +8 -9
- package/dist/{chat-DQq8RR5E.js → chat-Bg3wEfNd.js} +5 -6
- package/dist/{chat-CV6MXeID.js → chat-pXCsesuS.js} +2 -3
- package/dist/{chat-BubCW1as.cjs → chat-sCX7aTrz.cjs} +1 -8
- package/dist/{chatElementDisplayLocation-BwiXrkN7.d.ts → chatElementDisplayLocation-D6oLuQS4.d.ts} +1 -1
- package/dist/{chatSearch-OgBQtu3u.cjs → chatSearch-B4dsxGth.cjs} +6 -6
- package/dist/{chatSearch-xO4HYEBI.js → chatSearch-Cvc_eBFV.js} +6 -6
- package/dist/{chatState-CkMgQSse.js → chatState-2bMtvPgG.js} +2 -2
- package/dist/{chatState-CTwPHEJG.cjs → chatState-fP1r34CN.cjs} +4 -4
- package/dist/common-4xhjcUbt.cjs +189 -0
- package/dist/common-DhKoZ6jN.js +39 -0
- package/dist/{components-B4T3Uzth.js → components-BUisjl4v.js} +1 -1
- package/dist/{components-Cw9WjA6g.cjs → components-DVaYBroL.cjs} +1 -1
- package/dist/config/locators/components/chat/index.cjs +1 -2
- package/dist/config/locators/components/chat/index.d.cts +2 -2
- package/dist/config/locators/components/chat/index.d.ts +2 -2
- package/dist/config/locators/components/chat/index.js +2 -2
- package/dist/config/locators/components/common/index.cjs +27 -0
- package/dist/config/locators/components/common/index.d.cts +2 -0
- package/dist/config/locators/components/common/index.d.ts +2 -0
- package/dist/config/locators/components/common/index.js +3 -0
- package/dist/config/locators/components/index.cjs +1 -1
- package/dist/config/locators/components/index.d.cts +1 -1
- package/dist/config/locators/components/index.d.ts +1 -1
- package/dist/config/locators/components/index.js +1 -1
- package/dist/config/locators/index.cjs +29 -4
- package/dist/config/locators/index.d.cts +5 -4
- package/dist/config/locators/index.d.ts +5 -4
- package/dist/config/locators/index.js +5 -4
- package/dist/contexts/amplitudeContext/index.cjs +10 -9
- package/dist/contexts/amplitudeContext/index.d.ts +1 -1
- package/dist/contexts/amplitudeContext/index.js +7 -6
- package/dist/contexts/cdnContext/index.cjs +1 -1
- package/dist/contexts/cdnContext/index.js +1 -1
- package/dist/contexts/chatContext/index.cjs +32 -37
- package/dist/contexts/chatContext/index.d.cts +2 -2
- package/dist/contexts/chatContext/index.d.ts +2 -2
- package/dist/contexts/chatContext/index.js +21 -26
- package/dist/contexts/enviveConfigContext/index.d.cts +1 -1
- package/dist/contexts/enviveConfigContext/index.d.ts +3 -3
- package/dist/contexts/enviveCssContext/index.cjs +8 -8
- package/dist/contexts/enviveCssContext/index.js +8 -8
- package/dist/contexts/featureFlagContext/index.cjs +2 -2
- package/dist/contexts/featureFlagContext/index.d.cts +1 -1
- package/dist/contexts/featureFlagContext/index.d.ts +3 -3
- package/dist/contexts/featureFlagContext/index.js +2 -2
- package/dist/contexts/featureFlagServiceContext/index.cjs +3 -2
- package/dist/contexts/featureFlagServiceContext/index.d.cts +3 -3
- package/dist/contexts/featureFlagServiceContext/index.d.ts +5 -5
- package/dist/contexts/featureFlagServiceContext/index.js +3 -3
- package/dist/contexts/graphqlContext/index.cjs +3 -3
- package/dist/contexts/graphqlContext/index.d.cts +4 -4
- package/dist/contexts/graphqlContext/index.d.ts +13 -13
- package/dist/contexts/graphqlContext/index.js +3 -3
- package/dist/contexts/newOrgConfigContext/index.cjs +7 -7
- package/dist/contexts/newOrgConfigContext/index.d.cts +5 -5
- package/dist/contexts/newOrgConfigContext/index.d.ts +14 -14
- package/dist/contexts/newOrgConfigContext/index.js +7 -7
- package/dist/contexts/searchContext/index.cjs +13 -10
- package/dist/contexts/searchContext/index.d.ts +2 -2
- package/dist/contexts/searchContext/index.js +13 -10
- package/dist/contexts/sessionStorageContext/index.cjs +1 -1
- package/dist/contexts/sessionStorageContext/index.js +1 -1
- package/dist/contexts/shopifyUrlContext/index.cjs +1 -1
- package/dist/contexts/shopifyUrlContext/index.d.cts +1 -1
- package/dist/contexts/shopifyUrlContext/index.d.ts +3 -3
- package/dist/contexts/shopifyUrlContext/index.js +1 -1
- package/dist/contexts/systemSettingsContext/index.cjs +1 -1
- package/dist/contexts/systemSettingsContext/index.d.cts +7 -7
- package/dist/contexts/systemSettingsContext/index.d.ts +13 -13
- package/dist/contexts/systemSettingsContext/index.js +1 -1
- package/dist/contexts/types.d.cts +1 -1
- package/dist/contexts/types.d.ts +3 -3
- package/dist/contexts/userIdentityContext/index.cjs +9 -14
- package/dist/contexts/userIdentityContext/index.d.ts +1 -1
- package/dist/contexts/userIdentityContext/index.js +7 -12
- package/dist/{domObserver-B19-69gW.js → domObserver-DKcas6tl.js} +1 -1
- package/dist/{domObserver-CwieVNgj.cjs → domObserver-Do6RAJdf.cjs} +1 -1
- package/dist/featureFlagServiceContext-C2Yj-Uyh.d.ts +23 -0
- package/dist/featureFlagServiceContext-CiKWV306.d.cts +23 -0
- package/dist/featureFlagServiceContext-DFb-uLHN.cjs +62 -0
- package/dist/featureFlagServiceContext-Dd_Hbq6e.js +42 -0
- package/dist/featureGates-BdvOVv8N.cjs +32 -0
- package/dist/featureGates-DhoJq4io.js +26 -0
- package/dist/frontendConfig-CbyjUXZW.d.ts +856 -0
- package/dist/frontendConfig-tVg0hsWZ.d.cts +856 -0
- package/dist/{globalSearch-B8jHLScz.js → globalSearch-B_v9qfCT.js} +1 -1
- package/dist/{globalSearch-JJI1Fijh.cjs → globalSearch-OiF96VLG.cjs} +1 -1
- package/dist/graphqlConfig-DZHeFKDY.cjs +73 -0
- package/dist/graphqlConfig-Xk--JbPl.js +24 -0
- package/dist/{graphqlContext-EhYZM1v_.d.ts → graphqlContext-BotK7KCg.d.ts} +5 -5
- package/dist/{graphqlContext-ChRuFVxO.d.cts → graphqlContext-CMav2igl.d.cts} +4 -4
- package/dist/{graphqlContext-8kw4aLRc.js → graphqlContext-CSVwhCnP.js} +1 -1
- package/dist/{graphqlContext-Fwc6Upvh.cjs → graphqlContext-aaOOb79d.cjs} +1 -1
- package/dist/hooks/AmplitudeOperations/index.cjs +9 -8
- package/dist/hooks/AmplitudeOperations/index.d.ts +1 -1
- package/dist/hooks/AmplitudeOperations/index.js +9 -8
- package/dist/hooks/AppDetails/index.cjs +12 -7
- package/dist/hooks/AppDetails/index.d.cts +3 -3
- package/dist/hooks/AppDetails/index.d.ts +11 -11
- package/dist/hooks/AppDetails/index.js +12 -7
- package/dist/hooks/CdnOperations/index.cjs +1 -1
- package/dist/hooks/CdnOperations/index.js +1 -1
- package/dist/hooks/ChatToggle/index.cjs +13 -13
- package/dist/hooks/ChatToggle/index.d.ts +1 -1
- package/dist/hooks/ChatToggle/index.js +9 -9
- package/dist/hooks/ChatToggleAnalytics/index.cjs +11 -10
- package/dist/hooks/ChatToggleAnalytics/index.d.ts +1 -1
- package/dist/hooks/ChatToggleAnalytics/index.js +11 -10
- package/dist/hooks/Debounce/index.cjs +1 -1
- package/dist/hooks/Debounce/index.js +1 -1
- package/dist/hooks/ElementObserver/index.cjs +1 -1
- package/dist/hooks/ElementObserver/index.d.ts +1 -1
- package/dist/hooks/ElementObserver/index.js +1 -1
- package/dist/hooks/GrabAndScroll/index.d.cts +2 -2
- package/dist/hooks/GraphQLConfig/index.cjs +4 -4
- package/dist/hooks/GraphQLConfig/index.d.cts +4 -4
- package/dist/hooks/GraphQLConfig/index.d.ts +12 -12
- package/dist/hooks/GraphQLConfig/index.js +4 -4
- package/dist/hooks/IdentifyUser/index.cjs +9 -14
- package/dist/hooks/IdentifyUser/index.js +8 -13
- package/dist/hooks/ImageResolver/index.cjs +2 -2
- package/dist/hooks/ImageResolver/index.js +2 -2
- package/dist/hooks/Intersection/index.cjs +1 -1
- package/dist/hooks/Intersection/index.js +1 -1
- package/dist/hooks/MessageFilter/index.cjs +2 -2
- package/dist/hooks/MessageFilter/index.d.cts +3 -3
- package/dist/hooks/MessageFilter/index.d.ts +11 -11
- package/dist/hooks/MessageFilter/index.js +2 -2
- package/dist/hooks/NewOrgConfig/index.cjs +8 -8
- package/dist/hooks/NewOrgConfig/index.d.cts +5 -5
- package/dist/hooks/NewOrgConfig/index.d.ts +14 -14
- package/dist/hooks/NewOrgConfig/index.js +8 -8
- package/dist/hooks/Search/index.cjs +35 -36
- package/dist/hooks/Search/index.d.cts +6 -6
- package/dist/hooks/Search/index.d.ts +15 -15
- package/dist/hooks/Search/index.js +26 -27
- package/dist/hooks/SearchOperations/index.cjs +14 -11
- package/dist/hooks/SearchOperations/index.d.ts +2 -2
- package/dist/hooks/SearchOperations/index.js +14 -11
- package/dist/hooks/SessionStorageOperations/index.cjs +1 -1
- package/dist/hooks/SessionStorageOperations/index.js +1 -1
- package/dist/hooks/ShopifyUrlOperations/index.cjs +1 -1
- package/dist/hooks/ShopifyUrlOperations/index.d.cts +3 -3
- package/dist/hooks/ShopifyUrlOperations/index.d.ts +5 -5
- package/dist/hooks/ShopifyUrlOperations/index.js +1 -1
- package/dist/hooks/SystemSettingsContext/index.cjs +2 -2
- package/dist/hooks/SystemSettingsContext/index.d.cts +5 -5
- package/dist/hooks/SystemSettingsContext/index.d.ts +13 -13
- package/dist/hooks/SystemSettingsContext/index.js +2 -2
- package/dist/hooks/TrackComponentVisibleEvent/index.cjs +9 -8
- package/dist/hooks/TrackComponentVisibleEvent/index.d.ts +2 -2
- package/dist/hooks/TrackComponentVisibleEvent/index.js +9 -8
- package/dist/hooks/UpdateAnalyticsProps/index.cjs +12 -11
- package/dist/hooks/UpdateAnalyticsProps/index.js +8 -7
- package/dist/hooks/utils.cjs +1 -1
- package/dist/hooks/utils.d.cts +4 -4
- package/dist/hooks/utils.d.ts +12 -12
- package/dist/hooks/utils.js +1 -1
- package/dist/{index-BN-3ctk_.d.ts → index-7VOYQNo5.d.ts} +2 -2
- package/dist/index-9NE86em3.d.cts +35 -0
- package/dist/index-C1nwLU6Q.d.ts +35 -0
- package/dist/{index-C_MIfxF0.d.cts → index-CG3P8xE1.d.cts} +3 -3
- package/dist/{index-hdbCEjYy.d.cts → index-Cyq5HiC0.d.cts} +10 -5
- package/dist/{index-B5qslMv7.d.cts → index-D9SzePCE.d.cts} +31 -31
- package/dist/{index-C4_vohah.d.ts → index-DDZmV951.d.ts} +34 -34
- package/dist/{index-CVa3DeXJ.d.cts → index-Da1s8h5C.d.cts} +1 -1
- package/dist/{index-C6KdON7d.d.ts → index-Dy22w7kg.d.ts} +2 -3
- package/dist/{index-C12-NmS7.d.cts → index-DzbkQtaK.d.cts} +2 -3
- package/dist/{index-DOii3C6b.d.ts → index-DzzKdrcZ.d.ts} +1 -1
- package/dist/{index-DsiilEj-.d.ts → index-L7SEpDLz.d.ts} +1 -1
- package/dist/{index-CK_J3QMY.d.ts → index-YrhxAGtH.d.ts} +6 -6
- package/dist/{index-BoYC9XLW.d.ts → index-exSzn3SP.d.ts} +10 -5
- package/dist/{index-Dr_c2DDq.d.ts → index-hebsV7fc.d.ts} +1 -1
- package/dist/interceptors/index.cjs +2 -2
- package/dist/interceptors/index.d.cts +4 -4
- package/dist/interceptors/index.d.ts +12 -12
- package/dist/interceptors/index.js +2 -2
- package/dist/interceptors/types.cjs +1 -1
- package/dist/interceptors/types.d.cts +4 -4
- package/dist/interceptors/types.d.ts +12 -12
- package/dist/interceptors/types.js +1 -1
- package/dist/{newOrgConfigAtom-DxILMn2I.cjs → newOrgConfigAtom-B9FW3fDc.cjs} +1 -1
- package/dist/{newOrgConfigAtom-sqve6LZU.js → newOrgConfigAtom-CMeY5c6t.js} +1 -1
- package/dist/{newOrgConfigContext-BzIpdpd6.js → newOrgConfigContext-1uwWWCPa.js} +4 -4
- package/dist/{newOrgConfigContext-wTQVvOaX.cjs → newOrgConfigContext-B0v1q3dk.cjs} +4 -4
- package/dist/{newOrgConfigContext-CiwteVzM.d.cts → newOrgConfigContext-C8wBmK3q.d.cts} +2 -2
- package/dist/{newOrgConfigContext-D9PpVqyW.d.ts → newOrgConfigContext-D180PO0t.d.ts} +2 -2
- package/dist/{nodeSelector-D5gjDWZ3.d.ts → nodeSelector-DQicm08Y.d.ts} +1 -1
- package/dist/{org-DlAesvQ_.cjs → org-DU3Wck0R.cjs} +1 -1
- package/dist/{org-vi0njpBh.js → org-DptftvB6.js} +1 -1
- package/dist/{search-0-pfy0cc.js → search-BtYKpiNB.js} +5 -5
- package/dist/{search-BLShhjvR.d.ts → search-DYVQuYti.d.ts} +2 -2
- package/dist/{search-BQn1pW2M.cjs → search-Du6HZpO6.cjs} +5 -5
- package/dist/{search-filter-types-BlmWOnlA.d.ts → search-filter-types-B5xcaEit.d.ts} +1 -1
- package/dist/{search-filter-types-BBIjvwJV.d.cts → search-filter-types-DZPTzUK9.d.cts} +1 -1
- package/dist/{searchContext-DmXo2rpU.cjs → searchContext-BK43ArCs.cjs} +6 -6
- package/dist/{searchContext-5qTU8CbH.js → searchContext-JjZZhDCe.js} +4 -4
- package/dist/{searchServiceAdapter-WyCU55NV.js → searchServiceAdapter-BSPZOg1r.js} +1 -1
- package/dist/{searchServiceAdapter-DEv1tTn0.cjs → searchServiceAdapter-DrjFCiw8.cjs} +1 -1
- package/dist/{sessionStorageContext-DnuKi3Gk.js → sessionStorageContext-BQY9r8zz.js} +1 -1
- package/dist/{sessionStorageContext-B-UFXyJR.cjs → sessionStorageContext-R2yUAkd9.cjs} +1 -1
- package/dist/{shopifyUrlContext-jLW63VLY.js → shopifyUrlContext-Bon8_SUJ.js} +1 -1
- package/dist/{shopifyUrlContext-Lm-Xcut2.cjs → shopifyUrlContext-DUdw1xUH.cjs} +1 -1
- package/dist/{spiffyWidgets-GILaqHv6.d.ts → spiffyWidgets-DZqG5plz.d.ts} +1 -1
- package/dist/{systemSettingsContext--LcXOVJz.js → systemSettingsContext-BjbhIz6y.js} +1 -1
- package/dist/{systemSettingsContext-CafaP6Zh.cjs → systemSettingsContext-Dv9EmjmZ.cjs} +1 -1
- package/dist/{test-types-EzMFw_U3.d.ts → test-types-Dl5puRHC.d.ts} +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types-CKMMb_gX.d.cts +1 -1
- package/dist/{types-BN2z0HcL.d.ts → types-Csgpt7EV.d.ts} +1 -1
- package/dist/{types-CS0Hrzja.js → types-DIk0FLwd.js} +1 -1
- package/dist/{types-CxObxLKs.cjs → types-DNLkuGWZ.cjs} +1 -1
- package/dist/{types-D4aa7_7x.d.cts → types-DSW9XODe.d.cts} +1 -1
- package/dist/{types-6siNDmGv.d.ts → types-oSg-AkO5.d.ts} +2 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/{useAmplitudeOperations-aGOqxc4V.cjs → useAmplitudeOperations-C9o_wDU6.cjs} +3 -3
- package/dist/{useAmplitudeOperations-wQnkMaDm.js → useAmplitudeOperations-COq3L1no.js} +2 -2
- package/dist/{useAppDetails-9WXEc3mg.cjs → useAppDetails-C4GTLEIR.cjs} +6 -6
- package/dist/{useAppDetails-mNC2PBqH.js → useAppDetails-CEksA88Q.js} +3 -3
- package/dist/{useDebounce-CxPj9WmE.js → useDebounce--rPGMuE7.js} +1 -1
- package/dist/{useDebounce-BaIp-A1W.cjs → useDebounce-DECHWSTn.cjs} +1 -1
- package/dist/{useGraphQLConfig-CTsRsKd2.js → useGraphQLConfig-DQoMmpNM.js} +2 -2
- package/dist/{useGraphQLConfig-D7naV2RD.cjs → useGraphQLConfig-DzH1nVBh.cjs} +2 -2
- package/dist/{useIntersection-B4J9UhaG.js → useIntersection-UEO0Cezc.js} +1 -1
- package/dist/{useIntersection-DKWc5MY6.cjs → useIntersection-rV0Q8mBH.cjs} +1 -1
- package/dist/{useMessageInterceptor-C9p9No1n.cjs → useMessageInterceptor-CstX10ih.cjs} +1 -1
- package/dist/{useMessageInterceptor-tntd2rvB.js → useMessageInterceptor-D5oAekXn.js} +1 -1
- package/dist/{userIdentityContext-wYRpgkaJ.d.ts → userIdentityContext-8kfKQRFx.d.ts} +1 -1
- package/dist/{utils-FU_r-pTj.d.ts → utils-B8rATLoc.d.ts} +4 -4
- package/dist/{utils-B1xLx9S8.d.ts → utils-BLe5oreh.d.ts} +1 -1
- package/dist/{utils-_97oEqyL.js → utils-Bcz5kAgP.js} +1 -1
- package/dist/{utils-C8vYQhLV.cjs → utils-CMqFfqZx.cjs} +1 -1
- package/dist/{utils-2SWrJ12w.cjs → utils-CqVRbvfN.cjs} +1 -1
- package/dist/{utils-CqBxIpEV.js → utils-DQhbbAnt.js} +1 -1
- package/dist/{utils-BSYichA7.d.cts → utils-EDgzCG3Q.d.cts} +3 -3
- package/dist/utils-V1YTUQng.js +1385 -0
- package/dist/utils-VI19AC8S.cjs +1591 -0
- package/dist/variantInfo-BRmDpamJ.cjs +17 -0
- package/dist/variantInfo-BwBBEWSA.js +11 -0
- package/package.json +3 -2
- package/src/application/models/featureGates.ts +18 -20
- package/src/application/models/variantInfo/variantInfo.ts +9 -3
- package/src/atoms/app/index.ts +3 -2
- package/src/atoms/app/variant.ts +27 -89
- package/src/config/locators/components/chat/index.ts +0 -1
- package/src/config/locators/components/chat/preview.ts +0 -1
- package/src/config/locators/components/common/index.ts +4 -0
- package/src/config/locators/index.ts +1 -0
- package/src/contexts/amplitudeContext/amplitudeContext.tsx +12 -45
- package/src/contexts/featureFlagServiceContext/featureFlagServiceContext.tsx +1 -1
- package/dist/amplitudeContext-CwPtBPhg.js +0 -287
- package/dist/amplitudeContext-DTC6maR0.cjs +0 -309
- package/dist/app-CoQ1nC-j.js +0 -132
- package/dist/app-DN72spgQ.cjs +0 -178
- package/dist/commerce-api-BVy49Qk8.js +0 -311
- package/dist/commerce-api-Pclc9ZBQ.cjs +0 -318
- package/dist/featureFlagServiceContext-CUBoBV2i.cjs +0 -56
- package/dist/featureFlagServiceContext-Cpw8omUr.d.ts +0 -23
- package/dist/featureFlagServiceContext-Cvn6fcdB.d.cts +0 -23
- package/dist/featureFlagServiceContext-Dg8okVk1.js +0 -42
- package/dist/featureGates-Blx10fwB.js +0 -27
- package/dist/featureGates-DcZNrUma.cjs +0 -33
- package/dist/frontendConfig-DnMZfvcA.d.cts +0 -857
- package/dist/frontendConfig-Dqxbqo8G.d.ts +0 -857
- package/dist/graphqlConfig-BWqLgZ6v.cjs +0 -39
- package/dist/graphqlConfig-Dn-hO_SQ.js +0 -14
- package/dist/orgAnalyticsConfig-BC4_sEmn.js +0 -14
- package/dist/orgAnalyticsConfig-DsGbyFhO.cjs +0 -39
- package/dist/types-DQoXDiso.js +0 -1
- package/dist/types-o3zWarRp.cjs +0 -0
- package/dist/unsupportedProductExceptions-CKiri_vO.cjs +0 -32
- package/dist/unsupportedProductExceptions-ClxlJ6cU.js +0 -20
- package/dist/userIdentityContext-BWzqWXPI.cjs +0 -125
- package/dist/userIdentityContext-BoNYqrTf.js +0 -109
- package/dist/utils-BgMcvG6l.js +0 -606
- package/dist/utils-D_aOvxMg.cjs +0 -715
- package/dist/variantInfo-B7IwRpCg.cjs +0 -0
- package/dist/variantInfo-BtOYUGWa.js +0 -1
- /package/dist/{AmplitudeOperations-CNyxbBY6.cjs → AmplitudeOperations-CEwp7tPJ.cjs} +0 -0
- /package/dist/{AmplitudeOperations-Oa2efWtF.js → AmplitudeOperations-uF2zIi_1.js} +0 -0
- /package/dist/{index-BPxqQmpF.d.ts → index-CalyvQj_.d.ts} +0 -0
- /package/dist/{atomStore-DKlaDbMx.js → types-DtTnp0o0.js} +0 -0
- /package/dist/{atomStore-CdFkEC8s.cjs → types-a8gm_IaQ.cjs} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/application/models/variantInfo/variantInfo.ts
|
|
3
|
+
let VariantTypeEnum = /* @__PURE__ */ function(VariantTypeEnum$1) {
|
|
4
|
+
VariantTypeEnum$1["Pdp"] = "pdp";
|
|
5
|
+
VariantTypeEnum$1["Plp"] = "plp";
|
|
6
|
+
VariantTypeEnum$1["PageVisit"] = "page_visit";
|
|
7
|
+
return VariantTypeEnum$1;
|
|
8
|
+
}({});
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
Object.defineProperty(exports, 'VariantTypeEnum', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return VariantTypeEnum;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFyaWFudEluZm8tQlJtRHBhbUouY2pzIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIi4uL3NyYy9hcHBsaWNhdGlvbi9tb2RlbHMvdmFyaWFudEluZm8vdmFyaWFudEluZm8udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUExQSW5mbyB9IGZyb20gJy4vcGxwSW5mbyc7XG5pbXBvcnQgeyBQYWdlVmlzaXRJbmZvIH0gZnJvbSAnLi9wYWdlVmlzaXRJbmZvJztcbmltcG9ydCB7IFByb2R1Y3RJbmZvIH0gZnJvbSAnLi9wcm9kdWN0SW5mbyc7XG5cbmV4cG9ydCBlbnVtIFZhcmlhbnRUeXBlRW51bSB7XG4gIFBkcCA9ICdwZHAnLFxuICBQbHAgPSAncGxwJyxcbiAgUGFnZVZpc2l0ID0gJ3BhZ2VfdmlzaXQnLFxufVxuXG5leHBvcnQgdHlwZSBWYXJpYW50VHlwZSA9ICdwZHAnIHwgJ3BscCcgfCAncGFnZV92aXNpdCc7XG5cbmV4cG9ydCB0eXBlIFZhcmlhbnRJbmZvID0gUERQVmFyaWFudEluZm8gfCBQTFBWYXJpYW50SW5mbyB8IFBhZ2VWaXNpdFZhcmlhbnRJbmZvO1xuXG5leHBvcnQgdHlwZSBQRFBWYXJpYW50SW5mbyA9IHtcbiAgdmFyaWFudElkOiBzdHJpbmc7XG4gIHZhcmlhbnQ6IFZhcmlhbnRUeXBlRW51bS5QZHA7XG59ICYgUHJvZHVjdEluZm87XG5cbmV4cG9ydCB0eXBlIFBMUFZhcmlhbnRJbmZvID0ge1xuICB2YXJpYW50SWQ6IHN0cmluZztcbiAgdmFyaWFudDogVmFyaWFudFR5cGVFbnVtLlBscDtcbiAgdXJsPzogc3RyaW5nO1xufSAmIFBMUEluZm87XG5cbmV4cG9ydCB0eXBlIFBhZ2VWaXNpdFZhcmlhbnRJbmZvID0ge1xuICB2YXJpYW50SWQ6IHN0cmluZztcbiAgdmFyaWFudDogVmFyaWFudFR5cGVFbnVtLlBhZ2VWaXNpdDtcbn0gJiBQYWdlVmlzaXRJbmZvO1xuIl0sIm1hcHBpbmdzIjoiOztBQUlBLElBQVksOERBQUw7QUFDTDtBQUNBO0FBQ0EifQ==
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/application/models/variantInfo/variantInfo.ts
|
|
2
|
+
let VariantTypeEnum = /* @__PURE__ */ function(VariantTypeEnum$1) {
|
|
3
|
+
VariantTypeEnum$1["Pdp"] = "pdp";
|
|
4
|
+
VariantTypeEnum$1["Plp"] = "plp";
|
|
5
|
+
VariantTypeEnum$1["PageVisit"] = "page_visit";
|
|
6
|
+
return VariantTypeEnum$1;
|
|
7
|
+
}({});
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { VariantTypeEnum };
|
|
11
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFyaWFudEluZm8tQndCQkVXU0EuanMiLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2FwcGxpY2F0aW9uL21vZGVscy92YXJpYW50SW5mby92YXJpYW50SW5mby50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQTFBJbmZvIH0gZnJvbSAnLi9wbHBJbmZvJztcbmltcG9ydCB7IFBhZ2VWaXNpdEluZm8gfSBmcm9tICcuL3BhZ2VWaXNpdEluZm8nO1xuaW1wb3J0IHsgUHJvZHVjdEluZm8gfSBmcm9tICcuL3Byb2R1Y3RJbmZvJztcblxuZXhwb3J0IGVudW0gVmFyaWFudFR5cGVFbnVtIHtcbiAgUGRwID0gJ3BkcCcsXG4gIFBscCA9ICdwbHAnLFxuICBQYWdlVmlzaXQgPSAncGFnZV92aXNpdCcsXG59XG5cbmV4cG9ydCB0eXBlIFZhcmlhbnRUeXBlID0gJ3BkcCcgfCAncGxwJyB8ICdwYWdlX3Zpc2l0JztcblxuZXhwb3J0IHR5cGUgVmFyaWFudEluZm8gPSBQRFBWYXJpYW50SW5mbyB8IFBMUFZhcmlhbnRJbmZvIHwgUGFnZVZpc2l0VmFyaWFudEluZm87XG5cbmV4cG9ydCB0eXBlIFBEUFZhcmlhbnRJbmZvID0ge1xuICB2YXJpYW50SWQ6IHN0cmluZztcbiAgdmFyaWFudDogVmFyaWFudFR5cGVFbnVtLlBkcDtcbn0gJiBQcm9kdWN0SW5mbztcblxuZXhwb3J0IHR5cGUgUExQVmFyaWFudEluZm8gPSB7XG4gIHZhcmlhbnRJZDogc3RyaW5nO1xuICB2YXJpYW50OiBWYXJpYW50VHlwZUVudW0uUGxwO1xuICB1cmw/OiBzdHJpbmc7XG59ICYgUExQSW5mbztcblxuZXhwb3J0IHR5cGUgUGFnZVZpc2l0VmFyaWFudEluZm8gPSB7XG4gIHZhcmlhbnRJZDogc3RyaW5nO1xuICB2YXJpYW50OiBWYXJpYW50VHlwZUVudW0uUGFnZVZpc2l0O1xufSAmIFBhZ2VWaXNpdEluZm87XG4iXSwibWFwcGluZ3MiOiI7QUFJQSxJQUFZLDhEQUFMO0FBQ0w7QUFDQTtBQUNBIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-hooks",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "React hooks for connecting to Envive AI services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"build": "tsdown",
|
|
31
31
|
"build:watch": "tsdown --watch",
|
|
32
32
|
"prepublish": "npm run build",
|
|
33
|
-
"typecheck": "tsc"
|
|
33
|
+
"typecheck": "tsc",
|
|
34
|
+
"prepare-version": "node scripts/prepare-version.js"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@amplitude/analytics-browser": "^2.23.7",
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
export enum FeatureGates {
|
|
2
|
-
IsClientSessionEnabled =
|
|
3
|
-
IsNewFeatureEnabled =
|
|
2
|
+
IsClientSessionEnabled = 'is_client_session_enabled',
|
|
3
|
+
IsNewFeatureEnabled = 'is_new_feature_enabled',
|
|
4
4
|
// IsFineTunedModel8b is defined here for the sole purpose of correlating events to a specific model in Amplitude
|
|
5
|
-
IsFineTunedModel8b =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
IsChatVariantBEnabled = "is_chat_variant_b_enabled",
|
|
22
|
-
IsUserQueryAlwaysEnabled = "is_user_query_always_enabled",
|
|
5
|
+
IsFineTunedModel8b = 'is_fine_tuned_model_8b',
|
|
6
|
+
IsImageBannerEnabled = 'is_image_banner_enabled',
|
|
7
|
+
IsOrderLookupEnabled = 'is_order_lookup_enabled',
|
|
8
|
+
IsSummarizeReviewsEnabled = 'is_summarize_reviews_enabled',
|
|
9
|
+
IsGlobalSearchEnabled = 'is_global_search_enabled',
|
|
10
|
+
IsImagePromptEnabled = 'is_image_prompt_enabled',
|
|
11
|
+
IsWatermarkEnabled = 'is_watermark_enabled',
|
|
12
|
+
IsInferenceRegion0 = 'is_inference_region_0',
|
|
13
|
+
IsChatVariantEnabled = 'is_chat_variant_enabled',
|
|
14
|
+
IsChatVariantAEnabled = 'is_chat_variant_a_enabled',
|
|
15
|
+
IsChatVariantBEnabled = 'is_chat_variant_b_enabled',
|
|
16
|
+
IsUserQueryAlwaysEnabled = 'is_user_query_always_enabled',
|
|
17
|
+
IsSearchAutocompleteEnabled = 'is_search_autocomplete_enabled',
|
|
18
|
+
IsEmptyDivPLPEnabled = 'is_empty_div_plp_enabled',
|
|
19
|
+
IsRecommendedProductsEnabled = 'is_recommended_products_enabled',
|
|
20
|
+
IsChatScrollPaused = 'is_chat_scroll_paused',
|
|
23
21
|
}
|
|
@@ -2,22 +2,28 @@ import { PLPInfo } from './plpInfo';
|
|
|
2
2
|
import { PageVisitInfo } from './pageVisitInfo';
|
|
3
3
|
import { ProductInfo } from './productInfo';
|
|
4
4
|
|
|
5
|
+
export enum VariantTypeEnum {
|
|
6
|
+
Pdp = 'pdp',
|
|
7
|
+
Plp = 'plp',
|
|
8
|
+
PageVisit = 'page_visit',
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
export type VariantType = 'pdp' | 'plp' | 'page_visit';
|
|
6
12
|
|
|
7
13
|
export type VariantInfo = PDPVariantInfo | PLPVariantInfo | PageVisitVariantInfo;
|
|
8
14
|
|
|
9
15
|
export type PDPVariantInfo = {
|
|
10
16
|
variantId: string;
|
|
11
|
-
variant:
|
|
17
|
+
variant: VariantTypeEnum.Pdp;
|
|
12
18
|
} & ProductInfo;
|
|
13
19
|
|
|
14
20
|
export type PLPVariantInfo = {
|
|
15
21
|
variantId: string;
|
|
16
|
-
variant:
|
|
22
|
+
variant: VariantTypeEnum.Plp;
|
|
17
23
|
url?: string;
|
|
18
24
|
} & PLPInfo;
|
|
19
25
|
|
|
20
26
|
export type PageVisitVariantInfo = {
|
|
21
27
|
variantId: string;
|
|
22
|
-
variant:
|
|
28
|
+
variant: VariantTypeEnum.PageVisit;
|
|
23
29
|
} & PageVisitInfo;
|
package/src/atoms/app/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import { atom } from "jotai";
|
|
6
6
|
import { atomWithStorage } from "jotai/utils";
|
|
7
7
|
import { VariantInfo } from "src/application/models";
|
|
8
|
-
import { UserIdentityContextType } from "src/contexts/userIdentityContext/userIdentityContext";
|
|
8
|
+
import { UserIdentityContextType, useUserIdentity } from "src/contexts/userIdentityContext/userIdentityContext";
|
|
9
9
|
import { variantInfoAtom } from "src/atoms/app/variant";
|
|
10
10
|
import { v4 as uuid } from "uuid";
|
|
11
11
|
import { contextSourceAtom } from "../envive/enviveConfig";
|
|
@@ -32,7 +32,8 @@ export const userIdAtom = atom(
|
|
|
32
32
|
return maybeUserId;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const { getUserIdOrDefault } = useUserIdentity();
|
|
36
|
+
return getUserIdOrDefault();
|
|
36
37
|
},
|
|
37
38
|
(_, set, value: string | undefined) => {
|
|
38
39
|
set(internalUserIdAtom, value);
|
package/src/atoms/app/variant.ts
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { atomWithStorage } from
|
|
2
|
-
import { atom } from
|
|
3
|
-
import {
|
|
4
|
-
SupportedEventProductCategory,
|
|
5
|
-
SupportedEventResponse,
|
|
6
|
-
PageVisitCategory,
|
|
7
|
-
} from "@spiffy-ai/commerce-api-client";
|
|
1
|
+
import { atomWithStorage } from 'jotai/utils';
|
|
2
|
+
import { atom } from 'jotai';
|
|
3
|
+
import { SupportedEventResponse, PageVisitCategory } from '@spiffy-ai/commerce-api-client';
|
|
8
4
|
import {
|
|
9
5
|
PageVisitVariantInfo,
|
|
10
6
|
PDPVariantInfo,
|
|
11
7
|
PLPVariantInfo,
|
|
12
8
|
VariantInfo,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from
|
|
16
|
-
import { sessionStorageUtil } from "src/atoms/atomStore/atomStore";
|
|
17
|
-
import { enviveConfigAtom } from "src/atoms/envive/enviveConfig";
|
|
9
|
+
VariantTypeEnum,
|
|
10
|
+
} from 'src/application/models';
|
|
11
|
+
import { sessionStorageUtil } from 'src/atoms/atomStore';
|
|
18
12
|
|
|
19
13
|
export interface SupportedEvent
|
|
20
14
|
extends Pick<
|
|
21
15
|
SupportedEventResponse,
|
|
22
|
-
|
|
16
|
+
'supported' | 'ready' | 'category' | 'collections' | 'top_category'
|
|
23
17
|
> {
|
|
24
18
|
numberOfReviews: number | undefined;
|
|
25
19
|
merchant_tags?: string[];
|
|
@@ -92,10 +86,7 @@ export type BackendPageVariantConfig = {
|
|
|
92
86
|
|
|
93
87
|
export interface UrlResolverResponse {
|
|
94
88
|
variant_type: string;
|
|
95
|
-
specific_details:
|
|
96
|
-
| UrlResolvingPDPConfig
|
|
97
|
-
| UrlResolvingPLPConfig
|
|
98
|
-
| UrlResolvingGenericConfig;
|
|
89
|
+
specific_details: UrlResolvingPDPConfig | UrlResolvingPLPConfig | UrlResolvingGenericConfig;
|
|
99
90
|
ready: boolean;
|
|
100
91
|
user_event?: {
|
|
101
92
|
event_id?: string;
|
|
@@ -110,12 +101,12 @@ export interface UrlResolverResponse {
|
|
|
110
101
|
export type UrlResolverCache = Record<string, UrlResolverResponse | undefined>;
|
|
111
102
|
|
|
112
103
|
const internalStorageUrlResolverAtom = atomWithStorage<string | undefined>(
|
|
113
|
-
|
|
104
|
+
'spiffy-url-resolver',
|
|
114
105
|
undefined,
|
|
115
106
|
sessionStorageUtil,
|
|
116
107
|
{
|
|
117
108
|
getOnInit: true,
|
|
118
|
-
}
|
|
109
|
+
},
|
|
119
110
|
);
|
|
120
111
|
|
|
121
112
|
export const urlResolverAtom = atom(
|
|
@@ -126,37 +117,25 @@ export const urlResolverAtom = atom(
|
|
|
126
117
|
}
|
|
127
118
|
return JSON.parse(maybeUrlResolver);
|
|
128
119
|
},
|
|
129
|
-
(
|
|
130
|
-
get,
|
|
131
|
-
set,
|
|
132
|
-
value: { url: string; response: UrlResolverResponse | undefined }
|
|
133
|
-
) => {
|
|
120
|
+
(get, set, value: { url: string; response: UrlResolverResponse | undefined }) => {
|
|
134
121
|
// Get current cache from storage
|
|
135
122
|
const currentCache = get(urlResolverAtom);
|
|
136
123
|
const newCache = { ...currentCache, [value.url]: value.response };
|
|
137
124
|
|
|
138
125
|
set(internalStorageUrlResolverAtom, JSON.stringify(newCache));
|
|
139
|
-
}
|
|
126
|
+
},
|
|
140
127
|
);
|
|
141
128
|
|
|
142
129
|
const internalStorageSupportedEventAtom = atomWithStorage<string | undefined>(
|
|
143
|
-
|
|
130
|
+
'spiffy-supported-event',
|
|
144
131
|
undefined,
|
|
145
132
|
sessionStorageUtil,
|
|
146
133
|
{
|
|
147
134
|
getOnInit: true,
|
|
148
|
-
}
|
|
135
|
+
},
|
|
149
136
|
);
|
|
150
137
|
const internalSupportedEventAtom = atom<SupportedEvent | undefined>(undefined);
|
|
151
138
|
|
|
152
|
-
const featureFlagServiceAtom = atom((get) => {
|
|
153
|
-
const config = get(enviveConfigAtom);
|
|
154
|
-
const featureOverrides = config?.featureOverrides;
|
|
155
|
-
return {
|
|
156
|
-
isFeatureGateEnabled: (gate: string) => featureOverrides?.[gate] || false,
|
|
157
|
-
};
|
|
158
|
-
});
|
|
159
|
-
|
|
160
139
|
export const supportedEventAtom = atom(
|
|
161
140
|
(get): SupportedEvent | undefined => {
|
|
162
141
|
const maybeSupportedEvent = get(internalStorageSupportedEventAtom);
|
|
@@ -168,51 +147,16 @@ export const supportedEventAtom = atom(
|
|
|
168
147
|
// and perform the object validation on "get" there.
|
|
169
148
|
return JSON.parse(maybeSupportedEvent);
|
|
170
149
|
},
|
|
171
|
-
(
|
|
150
|
+
(_, set, value: SupportedEvent | undefined) => {
|
|
172
151
|
if (value == null) {
|
|
173
152
|
set(internalStorageSupportedEventAtom, undefined);
|
|
174
153
|
set(internalSupportedEventAtom, undefined);
|
|
175
154
|
return;
|
|
176
155
|
}
|
|
177
156
|
|
|
178
|
-
const featureFlagService = get(featureFlagServiceAtom);
|
|
179
|
-
const maybeSupportedEvent = get(internalSupportedEventAtom);
|
|
180
|
-
const variantCategory = maybeSupportedEvent?.category;
|
|
181
|
-
const config = get(enviveConfigAtom);
|
|
182
|
-
const orgShortName = config?.orgShortName;
|
|
183
|
-
|
|
184
|
-
// TODO: clean up this logic & the feature gate when we've fully rolled out
|
|
185
|
-
if (
|
|
186
|
-
featureFlagService &&
|
|
187
|
-
!featureFlagService.isFeatureGateEnabled(
|
|
188
|
-
FeatureGates.IsNonShapewearEnabled
|
|
189
|
-
) &&
|
|
190
|
-
variantCategory &&
|
|
191
|
-
variantCategory !== SupportedEventProductCategory.Shapewear &&
|
|
192
|
-
(orgShortName === OrgShortName.Spanx ||
|
|
193
|
-
orgShortName === OrgShortName.SpanxStaging)
|
|
194
|
-
) {
|
|
195
|
-
const modifiedSupportedEvent = {
|
|
196
|
-
supported: false,
|
|
197
|
-
ready: value.ready,
|
|
198
|
-
category: value.category,
|
|
199
|
-
numberOfReviews: value.numberOfReviews,
|
|
200
|
-
collections: value.collections,
|
|
201
|
-
top_category: value.top_category,
|
|
202
|
-
merchant_tags: value.merchant_tags,
|
|
203
|
-
};
|
|
204
|
-
set(internalSupportedEventAtom, modifiedSupportedEvent);
|
|
205
|
-
set(
|
|
206
|
-
internalStorageSupportedEventAtom,
|
|
207
|
-
JSON.stringify(modifiedSupportedEvent)
|
|
208
|
-
);
|
|
209
|
-
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
157
|
set(internalSupportedEventAtom, value);
|
|
214
158
|
set(internalStorageSupportedEventAtom, JSON.stringify(value));
|
|
215
|
-
}
|
|
159
|
+
},
|
|
216
160
|
);
|
|
217
161
|
|
|
218
162
|
const internalVariantIdAtom = atom<string>();
|
|
@@ -222,28 +166,22 @@ const internalProductUrlAtom = atom<string>();
|
|
|
222
166
|
const internalPlpIdAtom = atom<string>();
|
|
223
167
|
const internalUrlAtom = atom<string>();
|
|
224
168
|
const internalPageVisitCategoryAtom = atom<PageVisitCategory>();
|
|
225
|
-
const internalVariantAtom = atom<
|
|
226
|
-
"pdp"
|
|
227
|
-
);
|
|
169
|
+
const internalVariantAtom = atom<'pdp' | 'plp' | 'search' | 'page_visit'>('pdp');
|
|
228
170
|
|
|
229
171
|
export const variantIdAtom = atom((get) => get(internalVariantIdAtom));
|
|
230
172
|
export const productIdAtom = atom((get) => get(internalProductIdAtom));
|
|
231
|
-
export const parentProductIdAtom = atom((get) =>
|
|
232
|
-
get(internalParentProductIdAtom)
|
|
233
|
-
);
|
|
173
|
+
export const parentProductIdAtom = atom((get) => get(internalParentProductIdAtom));
|
|
234
174
|
export const productUrlAtom = atom((get) => get(internalProductUrlAtom));
|
|
235
175
|
export const plpIdAtom = atom((get) => get(internalPlpIdAtom));
|
|
236
176
|
export const urlAtom = atom((get) => get(internalUrlAtom));
|
|
237
|
-
export const pageVisitCategoryAtom = atom((get) =>
|
|
238
|
-
get(internalPageVisitCategoryAtom)
|
|
239
|
-
);
|
|
177
|
+
export const pageVisitCategoryAtom = atom((get) => get(internalPageVisitCategoryAtom));
|
|
240
178
|
export const variantAtom = atom((get) => get(internalVariantAtom));
|
|
241
179
|
export const hasParsedVariantInfoAtom = atom(false);
|
|
242
180
|
|
|
243
181
|
export const variantInfoAtom = atom(
|
|
244
182
|
(get): VariantInfo => {
|
|
245
183
|
const variant = get(variantAtom);
|
|
246
|
-
if (variant ===
|
|
184
|
+
if (variant === VariantTypeEnum.Pdp) {
|
|
247
185
|
return {
|
|
248
186
|
variantId: get(variantIdAtom),
|
|
249
187
|
variant,
|
|
@@ -252,7 +190,7 @@ export const variantInfoAtom = atom(
|
|
|
252
190
|
url: get(urlAtom),
|
|
253
191
|
} as PDPVariantInfo;
|
|
254
192
|
}
|
|
255
|
-
if (variant ===
|
|
193
|
+
if (variant === VariantTypeEnum.Plp) {
|
|
256
194
|
return {
|
|
257
195
|
variantId: get(variantIdAtom),
|
|
258
196
|
variant,
|
|
@@ -260,7 +198,7 @@ export const variantInfoAtom = atom(
|
|
|
260
198
|
url: get(urlAtom),
|
|
261
199
|
} as PLPVariantInfo;
|
|
262
200
|
}
|
|
263
|
-
if (variant ===
|
|
201
|
+
if (variant === VariantTypeEnum.PageVisit) {
|
|
264
202
|
return {
|
|
265
203
|
variantId: get(variantIdAtom),
|
|
266
204
|
variant,
|
|
@@ -268,23 +206,23 @@ export const variantInfoAtom = atom(
|
|
|
268
206
|
pageVisitCategory: get(pageVisitCategoryAtom),
|
|
269
207
|
} as PageVisitVariantInfo;
|
|
270
208
|
}
|
|
271
|
-
throw new Error(
|
|
209
|
+
throw new Error('Invalid variantInfo details');
|
|
272
210
|
},
|
|
273
211
|
(_, set, newVariant: VariantInfo) => {
|
|
274
212
|
set(internalVariantAtom, newVariant.variant);
|
|
275
213
|
set(internalVariantIdAtom, newVariant.variantId);
|
|
276
|
-
if (newVariant.variant ===
|
|
214
|
+
if (newVariant.variant === VariantTypeEnum.Pdp) {
|
|
277
215
|
set(internalProductIdAtom, newVariant.productId);
|
|
278
216
|
set(internalParentProductIdAtom, newVariant.parentProductId);
|
|
279
217
|
set(internalUrlAtom, newVariant.url);
|
|
280
218
|
}
|
|
281
|
-
if (newVariant.variant ===
|
|
219
|
+
if (newVariant.variant === VariantTypeEnum.Plp) {
|
|
282
220
|
set(internalPlpIdAtom, newVariant.plpId);
|
|
283
221
|
set(internalUrlAtom, newVariant.url);
|
|
284
222
|
}
|
|
285
|
-
if (newVariant.variant ===
|
|
223
|
+
if (newVariant.variant === VariantTypeEnum.PageVisit) {
|
|
286
224
|
set(internalUrlAtom, newVariant.url);
|
|
287
225
|
set(internalPageVisitCategoryAtom, newVariant.pageVisitCategory);
|
|
288
226
|
}
|
|
289
|
-
}
|
|
227
|
+
},
|
|
290
228
|
);
|
|
@@ -17,7 +17,6 @@ export const MOBILE_CHAT_HEADER_TESTID = 'spiffy-mobile-chat-header';
|
|
|
17
17
|
export const SCROLLABLE_SUGGESTIONS_TESTID = 'spiffy-scrollable-suggestions';
|
|
18
18
|
export const SUGGESTION_BAR_TESTID = 'spiffy-suggestion-bar';
|
|
19
19
|
export const SUGGESTION_BAR_BUTTON_TESTID = 'spiffy-suggestion-bar-button';
|
|
20
|
-
export const SUGGESTION_BUTTON_TESTID = 'spiffy-suggestion-button';
|
|
21
20
|
|
|
22
21
|
export const TAG_TESTID = 'spiffy-tag';
|
|
23
22
|
export const ANIMATED_MESSAGES_TESTID = 'spiffy-animated-messages';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const SUGGESTION_BUTTON_TESTID = 'spiffy-suggestion-button';
|
|
2
1
|
export const CHAT_PREVIEW_FOOTER_TESTID = 'spiffy-chat-preview-footer';
|
|
3
2
|
export const CHAT_PREVIEW_TESTID = 'spiffy-chat-preview';
|
|
4
3
|
export const CHAT_PREVIEW_SHADOW_DOM_TESTID = 'chat-preview-shadow-dom-container';
|
|
@@ -31,6 +31,10 @@ import type {
|
|
|
31
31
|
ServerZoneType,
|
|
32
32
|
} from "@amplitude/analytics-types";
|
|
33
33
|
import { useEnviveConfig } from "src/contexts/enviveConfigContext/enviveConfigContext";
|
|
34
|
+
import {
|
|
35
|
+
useFeatureFlagService,
|
|
36
|
+
} from "src/contexts/featureFlagServiceContext/featureFlagServiceContext";
|
|
37
|
+
import { useUserIdentity } from "src/contexts/userIdentityContext/userIdentityContext";
|
|
34
38
|
|
|
35
39
|
export enum SpiffyMetricsEventName {
|
|
36
40
|
BundleLoaded = "Bundle Loaded",
|
|
@@ -101,50 +105,7 @@ export const AmplitudeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
101
105
|
featureGates,
|
|
102
106
|
} = useEnviveConfig();
|
|
103
107
|
|
|
104
|
-
const
|
|
105
|
-
const isFeatureGateEnabled = useCallback(
|
|
106
|
-
(gate: string) => {
|
|
107
|
-
const override = featureOverrides?.[gate];
|
|
108
|
-
if (override !== undefined) {
|
|
109
|
-
return override;
|
|
110
|
-
}
|
|
111
|
-
return (
|
|
112
|
-
featureGates?.some((fg) => fg.name === gate && fg.value) || false
|
|
113
|
-
);
|
|
114
|
-
},
|
|
115
|
-
[featureOverrides, featureGates]
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const isClientSessionEnabled = useCallback(() => {
|
|
119
|
-
// Assuming this is a feature gate, or needs to be explicitly passed
|
|
120
|
-
return isFeatureGateEnabled(FeatureGates.IsClientSessionEnabled);
|
|
121
|
-
}, [isFeatureGateEnabled]);
|
|
122
|
-
|
|
123
|
-
const getFeatureFlags = useCallback(() => {
|
|
124
|
-
const flags: Record<string, boolean> = {};
|
|
125
|
-
if (featureOverrides) {
|
|
126
|
-
Object.entries(featureOverrides).forEach(([key, value]) => {
|
|
127
|
-
flags[key] = value;
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
if (featureGates) {
|
|
131
|
-
featureGates.forEach((fg) => {
|
|
132
|
-
if (fg.name) {
|
|
133
|
-
flags[fg.name] = Boolean(fg.value);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return flags;
|
|
138
|
-
}, [featureOverrides, featureGates]);
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
isFeatureGateEnabled,
|
|
142
|
-
isClientSessionEnabled,
|
|
143
|
-
getFeatureFlags,
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const featureFlagService = useFeatureFlagService();
|
|
108
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
148
109
|
|
|
149
110
|
const [amplitudeClient, setAmplitudeClient] = React.useState<
|
|
150
111
|
BrowserClient | undefined
|
|
@@ -154,7 +115,9 @@ export const AmplitudeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
154
115
|
const [supplementalDefaultProps, setSupplementalDefaultProps] =
|
|
155
116
|
React.useState<Record<string, unknown>>({});
|
|
156
117
|
|
|
157
|
-
const isReady = Boolean(
|
|
118
|
+
const isReady = Boolean(
|
|
119
|
+
userId && featureFlagService && amplitudeApiKey && userId
|
|
120
|
+
);
|
|
158
121
|
|
|
159
122
|
const getDefaultTrackingProps = useCallback((): Record<string, unknown> => {
|
|
160
123
|
const gatesProps = featureGates
|
|
@@ -372,6 +335,7 @@ export const AmplitudeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
372
335
|
eventGroups,
|
|
373
336
|
alsoSendToGoogleAnalytics = false,
|
|
374
337
|
}: TrackEventParams): Promise<void> => {
|
|
338
|
+
Logger.logDebug("Submitting event", eventName);
|
|
375
339
|
try {
|
|
376
340
|
const decoratedEventName = `[Spiffy] ${eventName}`;
|
|
377
341
|
|
|
@@ -389,6 +353,8 @@ export const AmplitudeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
389
353
|
});
|
|
390
354
|
const encoder = new TextEncoder();
|
|
391
355
|
const data = encoder.encode(eventData);
|
|
356
|
+
// calculate a hash of the event properties to use as the insert_id so that duplicate events
|
|
357
|
+
// are automatically dropped by Amplitude
|
|
392
358
|
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
|
|
393
359
|
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
394
360
|
const currentInsertId = hashArray
|
|
@@ -416,6 +382,7 @@ export const AmplitudeProvider: React.FC<{ children: React.ReactNode }> = ({
|
|
|
416
382
|
);
|
|
417
383
|
|
|
418
384
|
if (alsoSendToGoogleAnalytics && orgGaConfig) {
|
|
385
|
+
// TODO: Add in windowDataLayerService or context alternative and hook it up here
|
|
419
386
|
Logger.logDebug("[spiffy-ai] GA tracking", decoratedEventName);
|
|
420
387
|
if (window.dataLayer) {
|
|
421
388
|
(window.dataLayer as any[]).push({
|
|
@@ -4,7 +4,7 @@ import { FeatureGates } from "src/application/models/featureGates";
|
|
|
4
4
|
import Logger from "src/application/logging/logger";
|
|
5
5
|
|
|
6
6
|
// This is the class that was previously implicitly used or defined elsewhere
|
|
7
|
-
class FeatureFlagService {
|
|
7
|
+
export class FeatureFlagService {
|
|
8
8
|
private featureGates: OrgConfigFeatureGate[];
|
|
9
9
|
|
|
10
10
|
constructor(featureGates: OrgConfigFeatureGate[]) {
|