@envive-ai/react-hooks 0.2.6-alpha-7 → 0.2.6-alpha-9
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/{AmplitudeOperations-DjqOM3uE.js → AmplitudeOperations-D2r56Ptr.js} +2 -2
- package/dist/{AmplitudeOperations-DbUiR0N_.cjs → AmplitudeOperations-SkndCrhj.cjs} +2 -2
- package/dist/{NewOrgConfig-C_1T1iOt.js → NewOrgConfig-C9aQqGsb.js} +2 -2
- package/dist/{NewOrgConfig-D2Kvqa1z.cjs → NewOrgConfig-CHkHRqHx.cjs} +2 -2
- package/dist/{TrackComponentVisibleEvent-BxOhr9Da.js → TrackComponentVisibleEvent-BIGvzk4f.js} +2 -2
- package/dist/{TrackComponentVisibleEvent-CDbecFPM.cjs → TrackComponentVisibleEvent-DjZUt7LR.cjs} +2 -2
- package/dist/amplitudeContext-B3DsV6IO.cjs +248 -0
- package/dist/amplitudeContext-S3JYCxr4.js +232 -0
- package/dist/{app-Bs2KxG_8.js → app-BT3g-mDp.js} +5 -5
- package/dist/{app-DSnDDqcW.cjs → app-DxwdFQlv.cjs} +5 -5
- package/dist/application/utils/index.cjs +4 -4
- package/dist/application/utils/index.d.cts +2 -2
- package/dist/application/utils/index.js +4 -4
- package/dist/{atomStore-CfzCqWB9.js → atomStore-BuopbV9k.js} +1 -1
- package/dist/{atomStore-BQVO5haU.cjs → atomStore-CZKe3itM.cjs} +1 -1
- package/dist/atoms/app/index.cjs +9 -9
- package/dist/atoms/app/index.d.cts +7 -7
- package/dist/atoms/app/index.d.ts +7 -7
- package/dist/atoms/app/index.js +9 -9
- package/dist/atoms/atomStore/index.cjs +1 -1
- package/dist/atoms/atomStore/index.d.ts +1 -1
- package/dist/atoms/atomStore/index.js +1 -1
- package/dist/atoms/chat/index.cjs +10 -10
- package/dist/atoms/chat/index.d.cts +32 -32
- package/dist/atoms/chat/index.d.ts +32 -32
- package/dist/atoms/chat/index.js +10 -10
- package/dist/atoms/globalSearch/index.d.cts +6 -6
- package/dist/atoms/globalSearch/index.d.ts +6 -6
- package/dist/atoms/org/index.cjs +2 -2
- package/dist/atoms/org/index.d.cts +15 -15
- package/dist/atoms/org/index.d.ts +16 -16
- package/dist/atoms/org/index.js +2 -2
- package/dist/atoms/search/index.cjs +3 -3
- package/dist/atoms/search/index.d.cts +15 -15
- package/dist/atoms/search/index.d.ts +14 -14
- package/dist/atoms/search/index.js +3 -3
- package/dist/atoms/search/utils.d.cts +1 -1
- package/dist/cdnContext-i5iYA8ig.cjs +53 -0
- package/dist/cdnContext-td-gAam0.js +38 -0
- package/dist/{chat-EJbfGWRr.js → chat-ClvJ9xEj.js} +1 -1
- package/dist/{chat-CJ9D8n7g.cjs → chat-DCGriB7h.cjs} +1 -1
- package/dist/{chat-C5afTKUY.js → chat-ZaY3KY-R.js} +3 -3
- package/dist/{chat-CCjM6fS_.cjs → chat-rhEjVfrd.cjs} +3 -3
- package/dist/{common-CuwWqIJ1.cjs → common-DQPvV_S_.cjs} +1 -1
- package/dist/{common-Df2bwzd2.js → common-c_4eX0qn.js} +1 -1
- package/dist/{components-QGCWJ26c.js → components-CDpaMUjK.js} +1 -1
- package/dist/{components-BCfFLf9X.cjs → components-DKwVHIjq.cjs} +1 -1
- package/dist/config/index.cjs +4 -4
- package/dist/config/index.js +4 -4
- package/dist/config/locators/components/chat/index.cjs +1 -1
- package/dist/config/locators/components/chat/index.js +1 -1
- package/dist/config/locators/components/common/index.cjs +1 -1
- package/dist/config/locators/components/common/index.js +1 -1
- package/dist/config/locators/components/index.cjs +1 -1
- package/dist/config/locators/components/index.js +1 -1
- package/dist/config/locators/index.cjs +4 -4
- package/dist/config/locators/index.js +4 -4
- package/dist/contexts/amplitudeContext/index.cjs +12 -12
- package/dist/contexts/amplitudeContext/index.d.cts +1 -1
- package/dist/contexts/amplitudeContext/index.js +12 -12
- package/dist/contexts/cdnContext/index.cjs +2 -2
- package/dist/contexts/cdnContext/index.d.cts +1 -1
- package/dist/contexts/cdnContext/index.d.ts +1 -1
- package/dist/contexts/cdnContext/index.js +2 -2
- package/dist/contexts/enviveConfigContext/index.cjs +2 -2
- package/dist/contexts/enviveConfigContext/index.d.cts +1 -1
- package/dist/contexts/enviveConfigContext/index.js +2 -2
- package/dist/contexts/enviveCssContext/index.cjs +6 -6
- package/dist/contexts/enviveCssContext/index.js +6 -6
- package/dist/contexts/featureFlagContext/index.cjs +2 -2
- package/dist/contexts/featureFlagContext/index.js +2 -2
- package/dist/contexts/graphqlContext/index.cjs +2 -2
- package/dist/contexts/graphqlContext/index.js +2 -2
- package/dist/contexts/localStorageContext/index.d.cts +1 -1
- package/dist/contexts/newOrgConfigContext/index.cjs +5 -5
- package/dist/contexts/newOrgConfigContext/index.js +5 -5
- package/dist/contexts/searchContext/index.cjs +14 -14
- package/dist/contexts/searchContext/index.js +14 -14
- package/dist/contexts/shopifyUrlContext/index.cjs +2 -2
- package/dist/contexts/shopifyUrlContext/index.d.cts +1 -1
- package/dist/contexts/shopifyUrlContext/index.js +2 -2
- package/dist/contexts/systemSettingsContext/index.cjs +2 -2
- package/dist/contexts/systemSettingsContext/index.d.cts +1 -1
- package/dist/contexts/systemSettingsContext/index.d.ts +2 -2
- package/dist/contexts/systemSettingsContext/index.js +2 -2
- package/dist/contexts/userIdentityContext/index.cjs +9 -9
- package/dist/contexts/userIdentityContext/index.js +9 -9
- package/dist/{domObserver-DNeeSh1F.js → domObserver-CVhsCSkS.js} +1 -1
- package/dist/{domObserver-C2oQO8vi.cjs → domObserver-LCBj1xw4.cjs} +1 -1
- package/dist/{enviveConfig-Dp80h9yu.cjs → enviveConfig-CQ_8mT-g.cjs} +1 -1
- package/dist/{enviveConfig-Ciq4ASoV.js → enviveConfig-Cwlp7-Qz.js} +1 -1
- package/dist/{enviveConfigContext-CCjJUmwp.js → enviveConfigContext-BZbGEgOW.js} +2 -2
- package/dist/{enviveConfigContext-DoYP8KSw.cjs → enviveConfigContext-BinpxTCy.cjs} +2 -2
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.js +1 -1
- package/dist/{events-DBin1Z7o.cjs → events-CgFGtanE.cjs} +1 -1
- package/dist/{events-CXiS1aTc.js → events-WOOrnUAx.js} +1 -1
- package/dist/exceptions/index.d.ts +1 -1
- package/dist/{graphqlContext-ChXlE8Ul.cjs → graphqlContext-B8wuRZcp.cjs} +2 -2
- package/dist/{graphqlContext-0cg9fEUw.js → graphqlContext-CpHMbKoX.js} +2 -2
- package/dist/hooks/AmplitudeOperations/index.cjs +13 -13
- package/dist/hooks/AmplitudeOperations/index.d.cts +1 -1
- package/dist/hooks/AmplitudeOperations/index.js +13 -13
- package/dist/hooks/AppDetails/index.cjs +12 -12
- package/dist/hooks/AppDetails/index.d.cts +1 -1
- package/dist/hooks/AppDetails/index.js +12 -12
- package/dist/hooks/BlockBackButton/index.d.cts +1 -1
- package/dist/hooks/CdnOperations/index.cjs +2 -2
- package/dist/hooks/CdnOperations/index.d.ts +1 -1
- package/dist/hooks/CdnOperations/index.js +2 -2
- package/dist/hooks/ChatToggle/index.cjs +13 -13
- package/dist/hooks/ChatToggle/index.d.cts +1 -1
- package/dist/hooks/ChatToggle/index.js +13 -13
- package/dist/hooks/ChatToggleAnalytics/index.cjs +13 -13
- package/dist/hooks/ChatToggleAnalytics/index.d.cts +1 -1
- package/dist/hooks/ChatToggleAnalytics/index.js +13 -13
- package/dist/hooks/Debounce/index.d.cts +1 -1
- package/dist/hooks/ElementObserver/index.cjs +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 +3 -3
- package/dist/hooks/GraphQLConfig/index.d.cts +1 -1
- package/dist/hooks/GraphQLConfig/index.js +3 -3
- package/dist/hooks/IdentifyUser/index.cjs +9 -9
- package/dist/hooks/IdentifyUser/index.d.cts +1 -1
- package/dist/hooks/IdentifyUser/index.js +9 -9
- package/dist/hooks/ImageResolver/index.cjs +1 -1
- package/dist/hooks/ImageResolver/index.d.cts +1 -1
- package/dist/hooks/ImageResolver/index.js +1 -1
- package/dist/hooks/LocalStorageOperations/index.d.cts +1 -1
- package/dist/hooks/MessageFilter/index.d.cts +1 -1
- package/dist/hooks/MessageScrollObserver/index.d.cts +1 -1
- package/dist/hooks/NewOrgConfig/index.cjs +6 -6
- package/dist/hooks/NewOrgConfig/index.d.cts +2 -2
- package/dist/hooks/NewOrgConfig/index.d.ts +2 -2
- package/dist/hooks/NewOrgConfig/index.js +6 -6
- package/dist/hooks/Search/index.cjs +15 -15
- package/dist/hooks/Search/index.js +15 -15
- package/dist/hooks/SearchOperations/index.cjs +14 -14
- package/dist/hooks/SearchOperations/index.js +14 -14
- package/dist/hooks/ShopifyUrlOperations/index.cjs +2 -2
- package/dist/hooks/ShopifyUrlOperations/index.js +2 -2
- package/dist/hooks/SystemSettingsContext/index.cjs +2 -2
- package/dist/hooks/SystemSettingsContext/index.d.cts +3 -3
- package/dist/hooks/SystemSettingsContext/index.d.ts +4 -4
- package/dist/hooks/SystemSettingsContext/index.js +2 -2
- package/dist/hooks/TrackComponentVisibleEvent/index.cjs +13 -13
- package/dist/hooks/TrackComponentVisibleEvent/index.js +13 -13
- package/dist/hooks/UpdateAnalyticsProps/index.cjs +12 -12
- package/dist/hooks/UpdateAnalyticsProps/index.js +12 -12
- package/dist/hooks/utils.cjs +1 -1
- package/dist/hooks/utils.d.cts +1 -1
- package/dist/hooks/utils.js +1 -1
- package/dist/index-CMZcE7pk.d.cts +1 -1
- package/dist/index-ChiZg0yw.d.cts +1 -1
- package/dist/index-CsmO1rDH.d.ts +1 -1
- package/dist/index-DtzPIcQp.d.ts +1 -1
- package/dist/index-bEjLKG_Q.d.ts +1 -1
- package/dist/index-mv7KvWDq.d.ts +1 -1
- package/dist/{locators-C2fWd-74.js → locators-BMQGmGLq.js} +1 -1
- package/dist/{locators-Cx3q6Z_h.cjs → locators-DxYdak1F.cjs} +1 -1
- package/dist/{newOrgConfigAtom-BuQE_zPK.js → newOrgConfigAtom-C8h3w_Ji.js} +1 -1
- package/dist/{newOrgConfigAtom-rrYHmp1b.cjs → newOrgConfigAtom-CDttTiuu.cjs} +1 -1
- package/dist/{newOrgConfigContext-d3RHl430.cjs → newOrgConfigContext-Brsggue9.cjs} +4 -4
- package/dist/{newOrgConfigContext-D-gU5ppl.js → newOrgConfigContext-Dt_W-wlK.js} +4 -4
- package/dist/{org-CIFgIcO4.cjs → org-BNs_maoW.cjs} +1 -1
- package/dist/{org-15F128Ah.js → org-CScQqL4k.js} +1 -1
- package/dist/{search-Ch6LKNh4.cjs → search-CWkDtqQV.cjs} +2 -2
- package/dist/{search--80x6CfL.js → search-OWKKaQQj.js} +2 -2
- package/dist/{searchContext-BkPoTq1o.js → searchContext-B-rEZixl.js} +4 -4
- package/dist/{searchContext-B0qEUoKb.cjs → searchContext-JCUBg-lA.cjs} +4 -4
- package/dist/{shopifyUrlContext-Bw1kAZ2P.cjs → shopifyUrlContext-COc1eDR_.cjs} +2 -2
- package/dist/{shopifyUrlContext-DnJiUmMA.js → shopifyUrlContext-CToAt_98.js} +2 -2
- package/dist/{systemSettingsContext-DPdDfVhj.js → systemSettingsContext-D9iNGz5v.js} +2 -2
- package/dist/{systemSettingsContext-068vQuP2.cjs → systemSettingsContext-DdV7Yte8.cjs} +2 -2
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +1 -1
- package/dist/{types-B8HZYWV3.cjs → types-1iJ_FnQQ.cjs} +1 -1
- package/dist/{types-y3mhxOUA.js → types-D5du68Vp.js} +1 -1
- package/dist/{urlsParser-bb8ciRFg.cjs → urlsParser-Dax4iVNC.cjs} +1 -1
- package/dist/{urlsParser-v_1DKvyf.js → urlsParser-NAp2LwWP.js} +1 -1
- package/dist/{useAppDetails-eP2hBuid.cjs → useAppDetails-D3T6kJY_.cjs} +4 -4
- package/dist/{useAppDetails-BPXln8UE.js → useAppDetails-xPVs6fW7.js} +4 -4
- package/dist/{useGraphQLConfig-v9veUbvJ.cjs → useGraphQLConfig-B1DaVvFx.cjs} +2 -2
- package/dist/{useGraphQLConfig-Btszi6cG.js → useGraphQLConfig-BtPxjtxw.js} +2 -2
- package/dist/{utils-D_nGHczN.js → utils-BZT_oZ3n.js} +1 -1
- package/dist/{utils-SjlIHajO.cjs → utils-D3MjNkd3.cjs} +2 -2
- package/dist/{utils-CWzuvlOR.js → utils-DMwh3QbT.js} +2 -2
- package/dist/{utils-CJk5iwQI.cjs → utils-qtHPLFby.cjs} +1 -1
- package/package.json +1 -1
- package/src/contexts/amplitudeContext/amplitudeContext.tsx +11 -3
- package/src/contexts/cdnContext/cdnContext.tsx +11 -9
- package/dist/amplitudeContext-BWmXliMI.cjs +0 -243
- package/dist/amplitudeContext-BjMlg5RV.js +0 -227
- package/dist/cdnContext-CJ2BNLAD.js +0 -38
- package/dist/cdnContext-lkC-AE6A.cjs +0 -53
- package/dist/src/application/commerce-api.js +0 -408
- package/dist/src/application/logging/logger.js +0 -16
- package/dist/src/application/models/graphql/index.js +0 -3
- package/dist/src/application/models/graphql/queries/getMerchantColorsQuery.js +0 -13
- package/dist/src/application/models/graphql/queries/getMerchantFrontendConfigQuery.js +0 -13
- package/dist/src/application/models/graphql/queries/getMerchantOrgIdQuery.js +0 -10
- package/dist/src/application/models/guards/api/index.js +0 -12
- package/dist/src/application/models/guards/api/isApiFormResponse.js +0 -59
- package/dist/src/application/models/guards/api/isApiFormSubmittedResponseAttributes.js +0 -22
- package/dist/src/application/models/guards/api/isApiOrderResponseAttributes.js +0 -91
- package/dist/src/application/models/guards/api/isApiOrgConfigResults.js +0 -188
- package/dist/src/application/models/guards/api/isApiOrganizationConfig.js +0 -115
- package/dist/src/application/models/guards/api/isApiPDPEventAttributes.js +0 -16
- package/dist/src/application/models/guards/api/isApiPLPEventAttributes.js +0 -26
- package/dist/src/application/models/guards/api/isApiPageResponseAttributes.js +0 -15
- package/dist/src/application/models/guards/api/isApiProductResponseAttributes.js +0 -65
- package/dist/src/application/models/guards/api/isApiProductSearchAttributes.js +0 -15
- package/dist/src/application/models/guards/api/isApiProductSearchFilterAttributes.js +0 -10
- package/dist/src/application/models/guards/api/isApiQueryTypedEventAttributes.js +0 -4
- package/dist/src/application/models/guards/api/isApiResponse.js +0 -33
- package/dist/src/application/models/guards/api/isApiReviewResponseAttributes.js +0 -22
- package/dist/src/application/models/guards/api/isApiReviewRichInformation.js +0 -23
- package/dist/src/application/models/guards/api/isApiSearchEventAttributes.js +0 -20
- package/dist/src/application/models/guards/api/isApiSuggestion.js +0 -24
- package/dist/src/application/models/guards/api/isApiSuggestionClickedEventAttributes.js +0 -4
- package/dist/src/application/models/guards/api/isApiTextResponseAttributes.js +0 -4
- package/dist/src/application/models/guards/api/isApiUserEvent.js +0 -18
- package/dist/src/application/models/guards/graphQL/isGraphQLColorsConfig.js +0 -41
- package/dist/src/application/models/guards/isBaseEcommerceEvent.js +0 -14
- package/dist/src/application/models/guards/isGA4EcommerceEvent.js +0 -14
- package/dist/src/application/models/guards/isLegacyUAEcommerceEvent.js +0 -14
- package/dist/src/application/models/guards/isMobilePLPChatPlacementParameter.js +0 -4
- package/dist/src/application/models/guards/isSpanxTakeAQuizCtaParameter.js +0 -1
- package/dist/src/application/models/guards/isVariantInfo.js +0 -28
- package/dist/src/application/models/guards/utils.js +0 -34
- package/dist/src/application/models/index.js +0 -34
- package/dist/src/application/models/utils/snakeToCamelTransformer.js +0 -71
- package/dist/src/application/models/utils/stringToFulfillmentDisplayStatusEnumValue.js +0 -65
- package/dist/src/application/models/validators/validateGraphQLColorsConfig.js +0 -9
- package/dist/src/application/models/validators/validateGraphQLFrontendConfig.js +0 -420
- package/dist/src/application/models/validators/validateGraphQLOrgId.js +0 -6
- package/dist/src/application/models/validators/validateMobilePLPChatPlacementParameter.js +0 -9
- package/dist/src/application/models/validators/validateOrgConfigResults.js +0 -44
- package/dist/src/application/models/validators/validateOrganizationConfig.js +0 -34
- package/dist/src/application/models/validators/validateResponse.js +0 -173
- package/dist/src/application/models/validators/validateSuggestion.js +0 -13
- package/dist/src/application/models/validators/validateUserEvent.js +0 -91
- package/dist/src/application/utils/analyticsUtils.js +0 -95
- package/dist/src/application/utils/coreContextToApiContext.js +0 -8
- package/dist/src/application/utils/coreUserEventToApiUserEvent.js +0 -90
- package/dist/src/application/utils/divideArray.js +0 -7
- package/dist/src/application/utils/domObserver.js +0 -85
- package/dist/src/application/utils/elementObserver.js +0 -186
- package/dist/src/application/utils/imageFilter.js +0 -11
- package/dist/src/application/utils/index.js +0 -21
- package/dist/src/application/utils/merchantUtils.js +0 -15
- package/dist/src/application/utils/messageFromFormSubmittedEvent.js +0 -19
- package/dist/src/application/utils/messageFromQueryEvent.js +0 -35
- package/dist/src/application/utils/messageFromResponse.js +0 -123
- package/dist/src/application/utils/messageFromSuggestionEvent.js +0 -27
- package/dist/src/application/utils/mouseEventTypes.js +0 -1
- package/dist/src/application/utils/mutationHelper.js +0 -33
- package/dist/src/application/utils/nextMessageRequestToApiRequest.js +0 -29
- package/dist/src/application/utils/nodeSelector.js +0 -101
- package/dist/src/application/utils/overrides.js +0 -144
- package/dist/src/application/utils/stringUtils.js +0 -47
- package/dist/src/application/utils/supportedEventRequestToApiRequest.js +0 -7
- package/dist/src/application/utils/urlsParser.js +0 -33
- package/dist/src/application/utils/validation.js +0 -5
- package/dist/src/atoms/amplitude/amplitudeTrackEventAtom.js +0 -4
- package/dist/src/atoms/app/index.js +0 -23
- package/dist/src/atoms/app/variant.js +0 -102
- package/dist/src/atoms/atomStore/atomStore.js +0 -28
- package/dist/src/atoms/atomStore/index.js +0 -1
- package/dist/src/atoms/chat/chatState.js +0 -32
- package/dist/src/atoms/chat/form.js +0 -16
- package/dist/src/atoms/chat/index.js +0 -23
- package/dist/src/atoms/chat/lastMessage.js +0 -10
- package/dist/src/atoms/chat/messageQueue.js +0 -68
- package/dist/src/atoms/chat/performanceMetrics.js +0 -70
- package/dist/src/atoms/chat/renderedWidgetRefs.js +0 -24
- package/dist/src/atoms/chat/replies.js +0 -42
- package/dist/src/atoms/chat/suggestions.js +0 -29
- package/dist/src/atoms/envive/enviveConfig.js +0 -67
- package/dist/src/atoms/globalSearch/globalSearch.js +0 -8
- package/dist/src/atoms/globalSearch/index.js +0 -1
- package/dist/src/atoms/org/customerService.js +0 -6
- package/dist/src/atoms/org/graphqlConfig.js +0 -8
- package/dist/src/atoms/org/index.js +0 -4
- package/dist/src/atoms/org/newOrgConfigAtom.js +0 -2
- package/dist/src/atoms/org/orgAnalyticsConfig.js +0 -8
- package/dist/src/atoms/search/index.js +0 -1
- package/dist/src/atoms/search/productFilters.js +0 -163
- package/dist/src/atoms/search/productRetrievalAPI.js +0 -50
- package/dist/src/atoms/search/productRetrievalAdapter.js +0 -14
- package/dist/src/atoms/search/productSorter.js +0 -13
- package/dist/src/atoms/search/searchAPI.js +0 -140
- package/dist/src/atoms/search/searchServiceAdapter.js +0 -14
- package/dist/src/atoms/search/utils.js +0 -15
- package/dist/src/config/index.js +0 -1
- package/dist/src/config/locators/components/chat/entrypoints.js +0 -10
- package/dist/src/config/locators/components/chat/index.js +0 -21
- package/dist/src/config/locators/components/chat/preview.js +0 -11
- package/dist/src/config/locators/components/chat/variants/index.js +0 -12
- package/dist/src/config/locators/components/common/buttons.js +0 -6
- package/dist/src/config/locators/components/common/cards.js +0 -17
- package/dist/src/config/locators/components/common/index.js +0 -4
- package/dist/src/config/locators/components/common/links.js +0 -1
- package/dist/src/config/locators/components/common/tables.js +0 -1
- package/dist/src/config/locators/components/floating-button.js +0 -2
- package/dist/src/config/locators/components/index.js +0 -3
- package/dist/src/config/locators/components/report-issue.js +0 -13
- package/dist/src/config/locators/components/search/index.js +0 -5
- package/dist/src/config/locators/components/shadow-dom.js +0 -1
- package/dist/src/config/locators/embedded.js +0 -20
- package/dist/src/config/locators/index.js +0 -4
- package/dist/src/contexts/amplitudeContext/amplitudeContext.js +0 -271
- package/dist/src/contexts/amplitudeContext/index.js +0 -1
- package/dist/src/contexts/cdnContext/cdnContext.js +0 -28
- package/dist/src/contexts/cdnContext/index.js +0 -1
- package/dist/src/contexts/enviveConfigContext/enviveConfigContext.js +0 -37
- package/dist/src/contexts/enviveConfigContext/index.js +0 -1
- package/dist/src/contexts/enviveCssContext/enviveCssContext.js +0 -31
- package/dist/src/contexts/enviveCssContext/index.js +0 -1
- package/dist/src/contexts/featureFlagContext/featureFlagContext.js +0 -109
- package/dist/src/contexts/featureFlagContext/index.js +0 -1
- package/dist/src/contexts/featureFlagServiceContext/featureFlagServiceContext.js +0 -47
- package/dist/src/contexts/featureFlagServiceContext/index.js +0 -1
- package/dist/src/contexts/graphqlContext/graphqlContext.js +0 -87
- package/dist/src/contexts/graphqlContext/index.js +0 -1
- package/dist/src/contexts/localStorageContext/index.js +0 -1
- package/dist/src/contexts/localStorageContext/localStorageContext.js +0 -95
- package/dist/src/contexts/newOrgConfigContext/index.js +0 -1
- package/dist/src/contexts/newOrgConfigContext/newOrgConfigContext.js +0 -33
- package/dist/src/contexts/searchContext/index.js +0 -1
- package/dist/src/contexts/searchContext/searchContext.js +0 -131
- package/dist/src/contexts/sessionStorageContext/index.js +0 -1
- package/dist/src/contexts/sessionStorageContext/sessionStorageContext.js +0 -43
- package/dist/src/contexts/shopifyUrlContext/index.js +0 -1
- package/dist/src/contexts/shopifyUrlContext/shopifyUrlContext.js +0 -62
- package/dist/src/contexts/systemSettingsContext/index.js +0 -1
- package/dist/src/contexts/systemSettingsContext/systemSettingsContext.js +0 -29
- package/dist/src/contexts/userIdentityContext/index.js +0 -1
- package/dist/src/contexts/userIdentityContext/userIdentityContext.js +0 -118
- package/dist/src/events/index.js +0 -51
- package/dist/src/events/registerAnalyticsListeners.js +0 -32
- package/dist/src/exceptions/index.js +0 -2
- package/dist/src/exceptions/sessionExceptions.js +0 -6
- package/dist/src/exceptions/unsupportedProductExceptions.js +0 -6
- package/dist/src/hooks/AmplitudeOperations/index.js +0 -1
- package/dist/src/hooks/AmplitudeOperations/useAmplitudeOperations.js +0 -24
- package/dist/src/hooks/AppDetails/index.js +0 -1
- package/dist/src/hooks/AppDetails/useAppDetails.js +0 -26
- package/dist/src/hooks/BlockBackButton/index.js +0 -1
- package/dist/src/hooks/BlockBackButton/useBlockBackButton.js +0 -23
- package/dist/src/hooks/CdnOperations/index.js +0 -1
- package/dist/src/hooks/CdnOperations/useCdnOperations.js +0 -13
- package/dist/src/hooks/ChatToggle/index.js +0 -1
- package/dist/src/hooks/ChatToggle/useChatToggle.js +0 -50
- package/dist/src/hooks/ChatToggleAnalytics/index.js +0 -1
- package/dist/src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.js +0 -11
- package/dist/src/hooks/CustomerSupportHandoff/index.js +0 -1
- package/dist/src/hooks/CustomerSupportHandoff/useCustomerSupportHandoff.js +0 -32
- package/dist/src/hooks/Debounce/index.js +0 -1
- package/dist/src/hooks/Debounce/useDebounce.js +0 -13
- package/dist/src/hooks/ElementObserver/index.js +0 -1
- package/dist/src/hooks/ElementObserver/useElementObserver.js +0 -208
- package/dist/src/hooks/GrabAndScroll/index.js +0 -1
- package/dist/src/hooks/GrabAndScroll/useGrabAndScroll.js +0 -105
- package/dist/src/hooks/GraphQLConfig/index.js +0 -1
- package/dist/src/hooks/GraphQLConfig/useGraphQLConfig.js +0 -54
- package/dist/src/hooks/IdentifyUser/index.js +0 -1
- package/dist/src/hooks/IdentifyUser/useIdentifyUser.js +0 -28
- package/dist/src/hooks/ImageResolver/index.js +0 -1
- package/dist/src/hooks/ImageResolver/useImageResolver.js +0 -45
- package/dist/src/hooks/Intersection/index.js +0 -1
- package/dist/src/hooks/Intersection/useIntersection.js +0 -20
- package/dist/src/hooks/IsSmallScreen/index.js +0 -1
- package/dist/src/hooks/IsSmallScreen/useIsSmallScreen.js +0 -16
- package/dist/src/hooks/LocalStorageOperations/index.js +0 -1
- package/dist/src/hooks/LocalStorageOperations/useLocalStorageOperations.js +0 -64
- package/dist/src/hooks/MessageFilter/index.js +0 -1
- package/dist/src/hooks/MessageFilter/useMessageFilter.js +0 -37
- package/dist/src/hooks/MessageScrollObserver/index.js +0 -1
- package/dist/src/hooks/MessageScrollObserver/useMessageScrollObserver.js +0 -35
- package/dist/src/hooks/NewOrgConfig/index.js +0 -1
- package/dist/src/hooks/NewOrgConfig/useNewOrgConfig.js +0 -5
- package/dist/src/hooks/Search/index.js +0 -1
- package/dist/src/hooks/Search/useRecommendedProducts.js +0 -35
- package/dist/src/hooks/Search/useSearch.js +0 -224
- package/dist/src/hooks/Search/useSearchInput.js +0 -192
- package/dist/src/hooks/SearchOperations/index.js +0 -1
- package/dist/src/hooks/SearchOperations/useSearchOperations.js +0 -78
- package/dist/src/hooks/SessionStorageOperations/index.js +0 -1
- package/dist/src/hooks/SessionStorageOperations/useSessionStorageOperations.js +0 -20
- package/dist/src/hooks/ShopifyUrlOperations/index.js +0 -1
- package/dist/src/hooks/ShopifyUrlOperations/useShopifyUrlOperations.js +0 -34
- package/dist/src/hooks/SnapCalculator/index.js +0 -1
- package/dist/src/hooks/SnapCalculator/useSnapCalculator.js +0 -22
- package/dist/src/hooks/SystemSettingsContext/index.js +0 -1
- package/dist/src/hooks/SystemSettingsContext/useSystemSettingsContext.js +0 -9
- package/dist/src/hooks/TrackComponentVisibleEvent/index.js +0 -1
- package/dist/src/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.js +0 -45
- package/dist/src/hooks/UpdateAnalyticsProps/index.js +0 -1
- package/dist/src/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.js +0 -43
- package/dist/src/hooks/utils.js +0 -116
- package/dist/src/interceptors/index.js +0 -1
- package/dist/src/interceptors/useMessageInterceptor.js +0 -24
- package/dist/src/types/ApiResponse.js +0 -1
- package/dist/src/types/FilterAttribute.js +0 -3
- package/dist/src/types/Message.js +0 -24
- package/dist/src/types/Suggestion.js +0 -3
- package/dist/src/types/index.js +0 -4
- package/dist/src/util/colorVar.js +0 -3
- package/dist/src/util/configVersion.js +0 -4
- package/dist/src/util/domInsertion.js +0 -16
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const CHAT_PREVIEW_FOOTER_TESTID = 'spiffy-chat-preview-footer';
|
|
2
|
-
export const CHAT_PREVIEW_TESTID = 'spiffy-chat-preview';
|
|
3
|
-
export const CHAT_PREVIEW_SHADOW_DOM_TESTID = 'chat-preview-shadow-dom-container';
|
|
4
|
-
export const CHAT_PREVIEW_BODY_TESTID = 'spiffy-chat-preview-body';
|
|
5
|
-
export const CHAT_PREVIEW_HEADING_TESTID = 'spiffy-chat-preview-heading';
|
|
6
|
-
export const CHAT_PREVIEW_LOADING_TESTID = 'spiffy-chat-preview-loading';
|
|
7
|
-
export const CHAT_PREVIEW_USER_QUERY_BUTTON_TESTID = 'spiffy-chat-preview-user-query-button';
|
|
8
|
-
export const CHAT_PREVIEW_HEADER_TESTID = 'spiffy-chat-preview-header';
|
|
9
|
-
// used in spanx config
|
|
10
|
-
export const CHAT_PREVIEW_PLP_TESTID = 'spiffy-chat-preview-plp';
|
|
11
|
-
export const CHAT_PREVIEW_PDP_TESTID = 'spiffy-chat-preview-pdp';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const WELCOME_SECTION_TESTID = "welcome-section";
|
|
2
|
-
export const WELCOME_SECTION_WELCOME_ICON_TESTID = "welcome-section-icon";
|
|
3
|
-
export const WELCOME_SECTION_TITLE_TESTID = "welcome-section-title";
|
|
4
|
-
export const WELCOME_SECTION_SUBTITLE_TESTID = "welcome-section-subtitle";
|
|
5
|
-
export const ASSISTANT_AVATAR_TESTID = "assistant-avatar";
|
|
6
|
-
export const ASSISTANT_AVATAR_NAME_TESTID = "assistant-avatar-name";
|
|
7
|
-
export const ASSISTANT_AVATAR_SPARKLE_TESTID = "assistant-avatar-sparkle";
|
|
8
|
-
export const REVIEW_CARD_STAR_RATING_TESTID = "review-card-star-rating";
|
|
9
|
-
export const REVIEW_CARD_STAR_COUNT_TESTID = "review-card-star-count";
|
|
10
|
-
export const VERIFIED_BUYER_TESTID = "verified-buyer";
|
|
11
|
-
export const VERIFIED_BUYER_INCENTIVIZED_REVIEW_TESTID = "verified-buyer-incentivized-review";
|
|
12
|
-
export const VERIFIED_BUYER_TITLE_TESTID = "verified-buyer-title";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const BUTTON_BASE_TESTID = 'spiffy-button-base';
|
|
2
|
-
export const SUGGESTION_BUTTON_TESTID = 'spiffy-suggestion-button';
|
|
3
|
-
export const SWITCH_TO_AGENT_CONTAINER_TESTID = 'spiffy-switch-to-agent-button-container';
|
|
4
|
-
export const SWITCH_TO_LIVE_AGENT_BUTTON_TESTID = 'spiffy-switch-to-live-agent-button';
|
|
5
|
-
export const SWITCH_TO_AI_ASSISTANT_BUTTON_TESTID = 'spiffy-switch-to-ai-assistant-button';
|
|
6
|
-
export const USER_QUERY_BUTTON_TESTID = 'spiffy-user-query-button';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const ANIMATED_PRODUCT_CARD_TESTID = 'spiffy-animated-product-card';
|
|
2
|
-
export const MESSAGE_CARD_TESTID = 'spiffy-message-card';
|
|
3
|
-
export const MESSAGE_CONTENT_TESTID = 'spiffy-message-content';
|
|
4
|
-
export const MESSAGE_MARKDOWN_CONTENT_TESTID = 'spiffy-message-markdown-content';
|
|
5
|
-
export const MESSAGE_VARIANT_MARKDOWN = 'md';
|
|
6
|
-
export const MESSAGE_VARIANT_TEXT = 'txt';
|
|
7
|
-
export const EXPAND_COLLAPSE_CARD_TESTID = 'spiffy-product-review-card-read-more-container';
|
|
8
|
-
export const PAGE_CARDS_SCROLL_CONTAINER_TESTID = 'spiffy-page-cards-scroll-container';
|
|
9
|
-
export const PAGE_CARD_DESCRIPTION_TESTID = 'spiffy-page-card-description';
|
|
10
|
-
export const PAGE_CARD_LINK_TESTID = 'spiffy-page-card-link';
|
|
11
|
-
export const PAGE_CARD_TESTID = 'spiffy-page-card';
|
|
12
|
-
export const PAGE_CARD_TITLE_TESTID = 'spiffy-page-card-title';
|
|
13
|
-
export const PAGE_CARD_VIEW_SOURCE_BUTTON_TESTID = 'spiffy-page-card-view-source-button';
|
|
14
|
-
export const PRODUCT_REVIEW_CARD_TESTID = 'spiffy-product-review-card';
|
|
15
|
-
export const PRODUCT_REVIEW_CARD_BUTTON_TESTID = 'spiffy-product-review-card-button';
|
|
16
|
-
export const PRODUCT_CARD_TESTID = 'spiffy-product-card';
|
|
17
|
-
export const PRODUCT_CARDS_SCROLL_CONTAINER_TESTID = 'spiffy-product-cards-scroll-container';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const PRODUCT_LINK_TESTID = 'spiffy-product-link';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const PRODUCTS_COMPARISON_TABLE_CONTAINER_TESTID = 'spiffy-products-comparison-table-container';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const CHAT_FEEDBACK_BUTTON_TESTID = 'chat-feedback-button';
|
|
2
|
-
export const REPORT_ISSUE_CONTAINER_TESTID = 'report-issue-container';
|
|
3
|
-
export const REPORT_ISSUE_NAME_FORM_CONTROL_TESTID = 'report-issue-name-form-control';
|
|
4
|
-
export const REPORT_ISSUE_NAME_INPUT_TESTID = 'report-issue-name-input';
|
|
5
|
-
export const REPORT_ISSUE_DESCRIPTION_FORM_CONTROL_TESTID = 'report-issue-description-form-control';
|
|
6
|
-
export const REPORT_ISSUE_DESCRIPTION_INPUT_TESTID = 'report-issue-description-input';
|
|
7
|
-
export const REPORT_ISSUE_CORRECTED_MESSAGE_FORM_CONTROL_TESTID = 'report-issue-corrected-message-form-control';
|
|
8
|
-
export const REPORT_ISSUE_CORRECTED_MESSAGE_INPUT_TESTID = 'report-issue-corrected-message-input';
|
|
9
|
-
export const REPORT_ISSUE_SUGGESTED_RESPONSES_FORM_CONTROL_TESTID = 'report-issue-suggested-responses-form-control';
|
|
10
|
-
export const REPORT_ISSUE_SUGGESTED_RESPONSES_INPUT_TESTID = 'report-issue-suggested-responses-input';
|
|
11
|
-
export const REPORT_ISSUE_SEND_FEEDBACK_BUTTON_TESTID = 'report-issue-send-feedback-button';
|
|
12
|
-
export const REPORT_ISSUE_TURNS_FORM_CONTROL_TESTID = 'report-issue-turns-form-control';
|
|
13
|
-
export const REPORT_ISSUE_CANCEL_BUTTON_TESTID = 'report-issue-cancel-button';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// keeping spiffy- prefix to remain consistent with the existing test ids
|
|
2
|
-
export const SEARCH_SHADOW_DOM_CONTAINER_TESTID = 'spiffy-search-shadow-dom-container';
|
|
3
|
-
export const SEARCH_ENTRYPOINT_BUTTON_TESTID = 'spiffy-search-entrypoint-button';
|
|
4
|
-
export const SEARCH_ENTRYPOINT_INPUT_TESTID = 'spiffy-search-entrypoint-input';
|
|
5
|
-
export const SEARCH_INPUT_TESTID = 'spiffy-search-input';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const SHADOW_DOM_CONTAINER_TESTID = "shadow-dom-container";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Locators that embed on the pages
|
|
2
|
-
export const BOTTOM_PLP_BANNER_TESTID = 'bottom-plp-image-banner';
|
|
3
|
-
export const BOTTOM_SUGGESTION_BAR_TESTID = 'bottom-suggestion-bar-shadow-dom-container';
|
|
4
|
-
export const CHAT_PREVIEW_TESTID = 'chat-preview-shadow-dom-container';
|
|
5
|
-
export const GLOBAL_SEARCH_ENTRYPOINT_TESTID = 'global-search-entrypoint-shadow-dom-container';
|
|
6
|
-
export const SEARCH_OVERLAY_HOST_TESTID = 'search-overlay-host-shadow-dom-container';
|
|
7
|
-
export const SEARCH_RESULTS_ENTRYPOINT_TESTID = 'search-results-entrypoint-shadow-dom-container';
|
|
8
|
-
export const SEARCH_RESULTS_NO_OP_ENTRYPOINT_TESTID = 'search-results-no-op-shadow-dom-container';
|
|
9
|
-
export const MOBILE_SEARCH_ICON_NO_OP_ENTRYPOINT_TESTID = 'mobile-search-icon-no-op-shadow-dom-container';
|
|
10
|
-
export const PROMPT_CARD_TESTID = 'image-prompt-card-shadow-dom-container';
|
|
11
|
-
export const FLOATING_BUTTON_TESTID = 'floating-button-shadow-dom-container';
|
|
12
|
-
export const FLOATING_CHAT_TESTID = 'floating-chat-shadow-dom-container';
|
|
13
|
-
export const TAILWIND_FLOATING_CHAT_BUTTON_TESTID = 'floating-chat-button';
|
|
14
|
-
export const TOP_PLP_BANNER_TESTID = 'top-plp-image-banner';
|
|
15
|
-
export const TOP_SUGGESTION_BAR_TESTID = 'top-suggestion-bar-shadow-dom-container';
|
|
16
|
-
// used in spanx config
|
|
17
|
-
export const CHAT_PREVIEW_PDP_TESTID = 'spiffy-chat-preview-pdp';
|
|
18
|
-
export const CHAT_PREVIEW_PLP_TESTID = 'spiffy-chat-preview-plp';
|
|
19
|
-
export const TOP_SUGGESTION_BAR_PDP_TESTID = 'spiffy-top-suggestion-bar-pdp';
|
|
20
|
-
export const BOTTOM_SUGGESTION_BAR_PDP_TESTID = 'spiffy-bottom-suggestion-bar-pdp';
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { createContext, useContext, useCallback, useMemo, useEffect, } from "react";
|
|
3
|
-
import { useAtomValue } from "jotai";
|
|
4
|
-
import { createInstance } from "@amplitude/analytics-browser";
|
|
5
|
-
import { FeatureGates, OrgShortName, LocalStorageKeys, SpiffyEvent, SpiffyMetricsEventName, } from "@envive-ai/types";
|
|
6
|
-
import { amplitudeApiKeyAtom, contextSourceAtom, dataResidencyAtom, identifyingPrefixAtom, } from "src/atoms/envive/enviveConfig";
|
|
7
|
-
import { useLocalStorage } from "src/contexts/localStorageContext";
|
|
8
|
-
import { orgAnalyticsGoogleAnalyticsConfigAtom } from "src/atoms/org/orgAnalyticsConfig";
|
|
9
|
-
import { userIdAtom } from "src/atoms/app";
|
|
10
|
-
import { envAtom } from "src/atoms/envive/enviveConfig";
|
|
11
|
-
import Logger from "src/application/logging/logger";
|
|
12
|
-
import { useEnviveConfig } from "src/contexts/enviveConfigContext/enviveConfigContext";
|
|
13
|
-
import { useFeatureFlagService } from "src/contexts/featureFlagServiceContext/featureFlagServiceContext";
|
|
14
|
-
import { EventsDispatcher } from "src/events";
|
|
15
|
-
const AmplitudeContext = createContext(null);
|
|
16
|
-
export const AmplitudeProvider = ({ children, }) => {
|
|
17
|
-
const userId = useAtomValue(userIdAtom);
|
|
18
|
-
const amplitudeApiKey = useAtomValue(amplitudeApiKeyAtom);
|
|
19
|
-
const dataResidency = useAtomValue(dataResidencyAtom);
|
|
20
|
-
const orgGaConfig = useAtomValue(orgAnalyticsGoogleAnalyticsConfigAtom);
|
|
21
|
-
const env = useAtomValue(envAtom);
|
|
22
|
-
const contextSource = useAtomValue(contextSourceAtom);
|
|
23
|
-
const identifyingPrefix = useAtomValue(identifyingPrefixAtom);
|
|
24
|
-
const { getItem } = useLocalStorage();
|
|
25
|
-
const { publicKey, featureOverrides, variantUrlOverride, variantInfoOverride, show, orgShortName, featureGates, } = useEnviveConfig();
|
|
26
|
-
const { featureFlagService } = useFeatureFlagService();
|
|
27
|
-
const [amplitudeClient, setAmplitudeClient] = React.useState(undefined);
|
|
28
|
-
const [supplementalDefaultProps, setSupplementalDefaultProps] = React.useState({});
|
|
29
|
-
const isReady = Boolean(userId && featureFlagService && amplitudeApiKey && userId);
|
|
30
|
-
const getDefaultTrackingProps = useCallback(() => {
|
|
31
|
-
const gatesProps = featureGates
|
|
32
|
-
? featureGates.reduce((acc, curr) => {
|
|
33
|
-
if (curr.name && curr.value != null) {
|
|
34
|
-
return { ...acc, [`feature_gate.${curr.name}`]: curr.value };
|
|
35
|
-
}
|
|
36
|
-
return acc;
|
|
37
|
-
}, {})
|
|
38
|
-
: {};
|
|
39
|
-
const experimentProps = {}; // No direct equivalent for experiments in EnviveConfig yet
|
|
40
|
-
const orgLevelAmplitudeTrackingProps = {
|
|
41
|
-
...gatesProps,
|
|
42
|
-
...experimentProps,
|
|
43
|
-
};
|
|
44
|
-
return {
|
|
45
|
-
...orgLevelAmplitudeTrackingProps,
|
|
46
|
-
...supplementalDefaultProps,
|
|
47
|
-
// TODO: org_id is not directly available in EnviveConfig. Need to find a new source or derive it.
|
|
48
|
-
// org_id: orgConfig?.org?.org?.id,
|
|
49
|
-
app_id: "commerce-chat-react-component",
|
|
50
|
-
chat_id: getItem(LocalStorageKeys.ChatId),
|
|
51
|
-
env: env || "unknown",
|
|
52
|
-
app_source: contextSource,
|
|
53
|
-
"org.short_name": orgShortName,
|
|
54
|
-
"user.id": userId,
|
|
55
|
-
"cdp.user_id": null,
|
|
56
|
-
"cdp.provider": null,
|
|
57
|
-
"event.source": "web-browser",
|
|
58
|
-
"event.type": "user-activity",
|
|
59
|
-
"event.id": null,
|
|
60
|
-
"event.channel": "web",
|
|
61
|
-
"event.timestamp": null,
|
|
62
|
-
};
|
|
63
|
-
}, [
|
|
64
|
-
featureGates,
|
|
65
|
-
supplementalDefaultProps,
|
|
66
|
-
env,
|
|
67
|
-
contextSource,
|
|
68
|
-
orgShortName,
|
|
69
|
-
userId,
|
|
70
|
-
]);
|
|
71
|
-
const eventPropsToPrefixedEventProps = useCallback((eventName, eventProps) => {
|
|
72
|
-
const prefix = eventName.toLowerCase().replace(/\s+/g, "_");
|
|
73
|
-
return Object.entries(eventProps).reduce((acc, [key, value]) => {
|
|
74
|
-
acc[`${prefix}.${key}`] = value;
|
|
75
|
-
return acc;
|
|
76
|
-
}, {});
|
|
77
|
-
}, []);
|
|
78
|
-
const amplitudeSessionReplayInit = useCallback(() => {
|
|
79
|
-
const isEnabled = Boolean(orgShortName === OrgShortName.UniqueVintage &&
|
|
80
|
-
(featureFlagService === null || featureFlagService === void 0 ? void 0 : featureFlagService.isClientSessionEnabled()) &&
|
|
81
|
-
(featureFlagService === null || featureFlagService === void 0 ? void 0 : featureFlagService.isFeatureGateEnabled(FeatureGates.IsNewFeatureEnabled)));
|
|
82
|
-
const sampleRate = 1;
|
|
83
|
-
try {
|
|
84
|
-
Logger.logDebug(`[spiffy-ai] amplitude session-replay initializing isEnabled=${isEnabled} sampleRate=${sampleRate}`);
|
|
85
|
-
if (!isEnabled) {
|
|
86
|
-
return isEnabled;
|
|
87
|
-
}
|
|
88
|
-
// amplitudeInstance.add(sessionReplayPlugin({ sampleRate }));
|
|
89
|
-
return isEnabled;
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
Logger.logError("[spiffy-ai] Error initializing amplitude session-replay", e);
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
}, [orgShortName, featureFlagService]);
|
|
96
|
-
const eventTrackingEnrichment = useMemo(() => {
|
|
97
|
-
const enrichment = {
|
|
98
|
-
name: "page-view-tracking-enrichment",
|
|
99
|
-
type: "enrichment",
|
|
100
|
-
setup: async () => undefined,
|
|
101
|
-
execute: async (event) => {
|
|
102
|
-
var _a;
|
|
103
|
-
let enrichedEvent;
|
|
104
|
-
const eventsToEnrich = [
|
|
105
|
-
"[Amplitude] Page Viewed",
|
|
106
|
-
`[Spiffy] ${SpiffyMetricsEventName.BundleLoaded}`,
|
|
107
|
-
];
|
|
108
|
-
if (eventsToEnrich.includes(event.event_type)) {
|
|
109
|
-
const globalProperties = {};
|
|
110
|
-
if (publicKey) {
|
|
111
|
-
globalProperties["globalProperties.publicKey"] = publicKey;
|
|
112
|
-
}
|
|
113
|
-
if (featureOverrides) {
|
|
114
|
-
Object.entries(featureOverrides).forEach(([key, value]) => {
|
|
115
|
-
globalProperties[`globalProperties.featureOverrides.${key}`] =
|
|
116
|
-
String(value);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
if (variantUrlOverride) {
|
|
120
|
-
globalProperties["globalProperties.variantUrlOverride"] =
|
|
121
|
-
variantUrlOverride;
|
|
122
|
-
}
|
|
123
|
-
if (variantInfoOverride) {
|
|
124
|
-
globalProperties["globalProperties.variantInfoOverride"] =
|
|
125
|
-
JSON.stringify(variantInfoOverride);
|
|
126
|
-
}
|
|
127
|
-
if (show != null) {
|
|
128
|
-
globalProperties["globalProperties.show"] = String(show);
|
|
129
|
-
}
|
|
130
|
-
const enabledFeatures = featureFlagService.getFeatureFlags();
|
|
131
|
-
const enabledFeaturesProperties = Object.entries(enabledFeatures).reduce((acc, [key, value]) => ({
|
|
132
|
-
...acc,
|
|
133
|
-
[`enabledFeatures.${key}`]: `${value}`,
|
|
134
|
-
}), {});
|
|
135
|
-
const timingProperties = {
|
|
136
|
-
"timing.enriched_at_ms": (_a = window.performance) === null || _a === void 0 ? void 0 : _a.now(),
|
|
137
|
-
};
|
|
138
|
-
enrichedEvent = {
|
|
139
|
-
...event,
|
|
140
|
-
event_properties: {
|
|
141
|
-
...event.event_properties,
|
|
142
|
-
...getDefaultTrackingProps(),
|
|
143
|
-
...globalProperties,
|
|
144
|
-
...enabledFeaturesProperties,
|
|
145
|
-
...timingProperties,
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
enrichedEvent = event;
|
|
151
|
-
}
|
|
152
|
-
EventsDispatcher.dispatch(SpiffyEvent.AMPLITUDE_EVENT, enrichedEvent);
|
|
153
|
-
return enrichedEvent;
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
return enrichment;
|
|
157
|
-
}, [
|
|
158
|
-
getDefaultTrackingProps,
|
|
159
|
-
featureFlagService,
|
|
160
|
-
publicKey,
|
|
161
|
-
featureOverrides,
|
|
162
|
-
variantUrlOverride,
|
|
163
|
-
variantInfoOverride,
|
|
164
|
-
show,
|
|
165
|
-
]);
|
|
166
|
-
useEffect(() => {
|
|
167
|
-
if (isReady && !amplitudeClient) {
|
|
168
|
-
const currentAmplitudeInstance = createInstance();
|
|
169
|
-
const isSessionsEnabled = amplitudeSessionReplayInit();
|
|
170
|
-
currentAmplitudeInstance.add(eventTrackingEnrichment);
|
|
171
|
-
currentAmplitudeInstance.init(amplitudeApiKey, userId, {
|
|
172
|
-
serverZone: dataResidency,
|
|
173
|
-
trackingOptions: {
|
|
174
|
-
ipAddress: true,
|
|
175
|
-
},
|
|
176
|
-
autocapture: {
|
|
177
|
-
attribution: true,
|
|
178
|
-
pageViews: {
|
|
179
|
-
trackHistoryChanges: "pathOnly",
|
|
180
|
-
},
|
|
181
|
-
sessions: isSessionsEnabled,
|
|
182
|
-
formInteractions: false,
|
|
183
|
-
fileDownloads: false,
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
setAmplitudeClient(currentAmplitudeInstance);
|
|
187
|
-
}
|
|
188
|
-
}, [
|
|
189
|
-
isReady,
|
|
190
|
-
amplitudeClient,
|
|
191
|
-
amplitudeApiKey,
|
|
192
|
-
userId,
|
|
193
|
-
dataResidency,
|
|
194
|
-
amplitudeSessionReplayInit,
|
|
195
|
-
eventTrackingEnrichment,
|
|
196
|
-
]);
|
|
197
|
-
const trackEvent = useCallback(async ({ eventName, eventProps, eventGroups, alsoSendToGoogleAnalytics = false, }) => {
|
|
198
|
-
Logger.logDebug("Submitting event", eventName);
|
|
199
|
-
try {
|
|
200
|
-
const decoratedEventName = `[Spiffy] ${eventName}`;
|
|
201
|
-
if (!amplitudeClient) {
|
|
202
|
-
Logger.logWarn("amplitude client undefined", undefined, {
|
|
203
|
-
event_name: decoratedEventName,
|
|
204
|
-
});
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
const eventData = JSON.stringify({
|
|
208
|
-
eventName,
|
|
209
|
-
eventProps,
|
|
210
|
-
created_at: new Date().toISOString(),
|
|
211
|
-
});
|
|
212
|
-
const encoder = new TextEncoder();
|
|
213
|
-
const data = encoder.encode(eventData);
|
|
214
|
-
// calculate a hash of the event properties to use as the insert_id so that duplicate events
|
|
215
|
-
// are automatically dropped by Amplitude
|
|
216
|
-
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
|
|
217
|
-
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
218
|
-
const currentInsertId = hashArray
|
|
219
|
-
.map((b) => b.toString(16).padStart(2, "0"))
|
|
220
|
-
.join("");
|
|
221
|
-
Logger.logDebug(`amplitude tracking ${decoratedEventName}`, null, {
|
|
222
|
-
event_name: decoratedEventName,
|
|
223
|
-
props: eventProps,
|
|
224
|
-
});
|
|
225
|
-
amplitudeClient.track(decoratedEventName, {
|
|
226
|
-
...getDefaultTrackingProps(),
|
|
227
|
-
...eventProps,
|
|
228
|
-
...(eventProps
|
|
229
|
-
? eventPropsToPrefixedEventProps(eventName, eventProps)
|
|
230
|
-
: {}),
|
|
231
|
-
}, {
|
|
232
|
-
...eventGroups,
|
|
233
|
-
insert_id: currentInsertId,
|
|
234
|
-
});
|
|
235
|
-
if (alsoSendToGoogleAnalytics && orgGaConfig) {
|
|
236
|
-
// TODO: Add in windowDataLayerService or context alternative and hook it up here
|
|
237
|
-
Logger.logDebug("[spiffy-ai] GA tracking", decoratedEventName);
|
|
238
|
-
if (window.dataLayer) {
|
|
239
|
-
window.dataLayer.push({
|
|
240
|
-
event: decoratedEventName,
|
|
241
|
-
eventProps: eventProps,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
catch (err) {
|
|
247
|
-
Logger.logError("[spiffy-ai] Error tracking event", err, {
|
|
248
|
-
eventName,
|
|
249
|
-
eventProps,
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}, [
|
|
253
|
-
amplitudeClient,
|
|
254
|
-
getDefaultTrackingProps,
|
|
255
|
-
eventPropsToPrefixedEventProps,
|
|
256
|
-
orgGaConfig,
|
|
257
|
-
]);
|
|
258
|
-
const value = useMemo(() => ({
|
|
259
|
-
trackEvent,
|
|
260
|
-
isReady,
|
|
261
|
-
setSupplementalDefaultProps: (props) => setSupplementalDefaultProps(props),
|
|
262
|
-
}), [trackEvent, isReady, setSupplementalDefaultProps]);
|
|
263
|
-
return (_jsx(AmplitudeContext.Provider, { value: value, children: children }));
|
|
264
|
-
};
|
|
265
|
-
export const useAmplitude = () => {
|
|
266
|
-
const context = useContext(AmplitudeContext);
|
|
267
|
-
if (!context) {
|
|
268
|
-
throw new Error("useAmplitude must be used within AmplitudeProvider");
|
|
269
|
-
}
|
|
270
|
-
return context;
|
|
271
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./amplitudeContext";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useCallback, useMemo } from 'react';
|
|
3
|
-
import { useAtomValue } from 'jotai';
|
|
4
|
-
import { cdnUrlAtom } from '../../atoms/envive/enviveConfig';
|
|
5
|
-
const CdnContext = createContext(null);
|
|
6
|
-
export const CdnProvider = ({ children }) => {
|
|
7
|
-
const cdnUrlAtomValue = useAtomValue(cdnUrlAtom);
|
|
8
|
-
const cdnUrl = cdnUrlAtomValue || 'https://cdn.spiffy.ai/other';
|
|
9
|
-
const getCdnBasePath = useCallback(() => {
|
|
10
|
-
return cdnUrl;
|
|
11
|
-
}, [cdnUrl]);
|
|
12
|
-
const getAssetURL = useCallback((assetName, orgShortName) => {
|
|
13
|
-
return `${getCdnBasePath()}/assets/${orgShortName}/${assetName}`;
|
|
14
|
-
}, [getCdnBasePath]);
|
|
15
|
-
const value = useMemo(() => ({
|
|
16
|
-
cdnUrl,
|
|
17
|
-
getCdnBasePath,
|
|
18
|
-
getAssetURL,
|
|
19
|
-
}), [cdnUrl, getCdnBasePath, getAssetURL]);
|
|
20
|
-
return _jsx(CdnContext.Provider, { value: value, children: children });
|
|
21
|
-
};
|
|
22
|
-
export const useCdn = () => {
|
|
23
|
-
const context = useContext(CdnContext);
|
|
24
|
-
if (!context) {
|
|
25
|
-
throw new Error('useCdn must be used within a CdnProvider');
|
|
26
|
-
}
|
|
27
|
-
return context;
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./cdnContext";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useEffect } from 'react';
|
|
3
|
-
import { useSetAtom, useAtomValue } from 'jotai';
|
|
4
|
-
import { enviveConfigAtom } from '../../atoms/envive/enviveConfig';
|
|
5
|
-
import Logger from '../../application/logging/logger';
|
|
6
|
-
const EnviveConfigContext = createContext(undefined);
|
|
7
|
-
export const EnviveConfigProvider = ({ children, amplitudeApiKey, dataResidency, env, baseUrl, reactAppName, cdnUrl, contextSource, orgLevelApiKey, orgShortName, identifyingPrefix, featureOverrides, variantUrlOverride, variantInfoOverride, show, publicKey, featureGates, // Destructure new prop
|
|
8
|
-
}) => {
|
|
9
|
-
const setEnviveConfig = useSetAtom(enviveConfigAtom);
|
|
10
|
-
const config = {
|
|
11
|
-
amplitudeApiKey,
|
|
12
|
-
dataResidency,
|
|
13
|
-
env,
|
|
14
|
-
baseUrl,
|
|
15
|
-
reactAppName,
|
|
16
|
-
cdnUrl,
|
|
17
|
-
contextSource,
|
|
18
|
-
orgLevelApiKey,
|
|
19
|
-
orgShortName,
|
|
20
|
-
identifyingPrefix,
|
|
21
|
-
featureOverrides,
|
|
22
|
-
variantUrlOverride,
|
|
23
|
-
variantInfoOverride,
|
|
24
|
-
show,
|
|
25
|
-
publicKey,
|
|
26
|
-
featureGates, // Add to config
|
|
27
|
-
};
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
setEnviveConfig(config);
|
|
30
|
-
Logger.logDebug('EnviveConfigProvider: Setting EnviveConfig', config);
|
|
31
|
-
}, [setEnviveConfig, config]);
|
|
32
|
-
return (_jsx(EnviveConfigContext.Provider, { value: config, children: config ? children : null }));
|
|
33
|
-
};
|
|
34
|
-
export const useEnviveConfig = () => {
|
|
35
|
-
const config = useAtomValue(enviveConfigAtom);
|
|
36
|
-
return config ? config : {};
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./enviveConfigContext";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useNewOrgConfig } from '../../hooks/NewOrgConfig';
|
|
3
|
-
export const EnviveCssProvider = ({ children }) => {
|
|
4
|
-
const { colorsConfig, frontendConfig, loading } = useNewOrgConfig();
|
|
5
|
-
let merchantThemeCss = `* {}`;
|
|
6
|
-
if (colorsConfig && !loading) {
|
|
7
|
-
merchantThemeCss = `
|
|
8
|
-
* {
|
|
9
|
-
--spiffy-colors-text-primary: ${colorsConfig.textPrimary};
|
|
10
|
-
--spiffy-colors-text-secondary: ${colorsConfig.textSecondary};
|
|
11
|
-
--spiffy-colors-text-accent: ${colorsConfig.textAccent};
|
|
12
|
-
--spiffy-colors-text-link: ${colorsConfig.textLink};
|
|
13
|
-
--spiffy-colors-text-light: ${colorsConfig.textLight};
|
|
14
|
-
--spiffy-colors-background-primary: ${colorsConfig.backgroundPrimary};
|
|
15
|
-
--spiffy-colors-background-secondary: ${colorsConfig.backgroundSecondary};
|
|
16
|
-
--spiffy-colors-background-secondary-dark: ${colorsConfig.backgroundSecondaryDark};
|
|
17
|
-
--spiffy-colors-background-tertiary: ${colorsConfig.backgroundTertiary};
|
|
18
|
-
--spiffy-colors-background-dark: ${colorsConfig.backgroundDark};
|
|
19
|
-
--spiffy-colors-background-light: ${colorsConfig.backgroundLight};
|
|
20
|
-
--spiffy-colors-background-saturated: ${colorsConfig.backgroundSaturated};
|
|
21
|
-
--spiffy-colors-border-light: ${colorsConfig.borderLight};
|
|
22
|
-
--spiffy-colors-border-medium: ${colorsConfig.borderMedium};
|
|
23
|
-
--spiffy-colors-border-dark: ${colorsConfig.borderDark};
|
|
24
|
-
--spiffy-colors-border-outline: ${colorsConfig.borderOutline};
|
|
25
|
-
--spiffy-colors-accent-primary: ${colorsConfig.accentPrimary};
|
|
26
|
-
--spiffy-colors-accent-secondary: ${colorsConfig.accentSecondary};
|
|
27
|
-
}`;
|
|
28
|
-
}
|
|
29
|
-
console.log(frontendConfig);
|
|
30
|
-
return (_jsxs(_Fragment, { children: [frontendConfig ? (_jsx("style", { id: "merchant-css-overrides", children: `${frontendConfig.merchantOverrideCss}` })) : null, colorsConfig ? _jsx("style", { id: "merchant-css-colors", children: `${merchantThemeCss}` }) : null, children] }));
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./enviveCssContext";
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useCallback, useMemo } from 'react';
|
|
3
|
-
import Logger from '../../application/logging/logger';
|
|
4
|
-
import { useSessionStorage } from '../../contexts/sessionStorageContext';
|
|
5
|
-
import { useEnviveConfig } from '../../contexts/enviveConfigContext/enviveConfigContext';
|
|
6
|
-
import { FeatureGates } from '@envive-ai/types';
|
|
7
|
-
const FEATURE_FLAGS_STORAGE_KEY = 'spiffy-feature-flags';
|
|
8
|
-
const FeatureFlagContext = createContext(undefined);
|
|
9
|
-
export const FeatureFlagProvider = ({ featureGates, children }) => {
|
|
10
|
-
const { getItem, setItem } = useSessionStorage();
|
|
11
|
-
const { featureOverrides } = useEnviveConfig();
|
|
12
|
-
const getQueryParamFeatureGateOverrides = useCallback((featureGate) => {
|
|
13
|
-
const urlObj = new URL(window.location.href);
|
|
14
|
-
const params = new URLSearchParams(urlObj.search);
|
|
15
|
-
const paramsObj = Object.fromEntries(params.entries());
|
|
16
|
-
const value = paramsObj[featureGate];
|
|
17
|
-
if (value != null) {
|
|
18
|
-
return value === 'true';
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
}, []);
|
|
22
|
-
const getWindowFeatureGateOverrides = useCallback((featureGate) => {
|
|
23
|
-
const value = featureOverrides === null || featureOverrides === void 0 ? void 0 : featureOverrides[String(featureGate)];
|
|
24
|
-
if (value != null) {
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
return undefined;
|
|
28
|
-
}, [featureOverrides]);
|
|
29
|
-
const getStoredFeatureGateOverrides = useCallback((featureGate) => {
|
|
30
|
-
const featureFlags = getItem(FEATURE_FLAGS_STORAGE_KEY);
|
|
31
|
-
if (featureFlags) {
|
|
32
|
-
try {
|
|
33
|
-
const featureFlagsObj = JSON.parse(featureFlags);
|
|
34
|
-
return featureFlagsObj[featureGate];
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
Logger.logError('[spiffy-ai] getStoredFeatureGateOverrides: error parsing feature flags', err);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}, []);
|
|
42
|
-
const getFeatureFlagOverride = useCallback((featureGate) => {
|
|
43
|
-
const queryOverride = getQueryParamFeatureGateOverrides(featureGate);
|
|
44
|
-
if (queryOverride != null) {
|
|
45
|
-
Logger.logDebug(`[spiffy-ai] isFeatureGateEnabled featureGate:${featureGate} overridden by URL param. New value: ${queryOverride}`);
|
|
46
|
-
return queryOverride;
|
|
47
|
-
}
|
|
48
|
-
const windowOverride = getWindowFeatureGateOverrides(featureGate);
|
|
49
|
-
if (windowOverride != null) {
|
|
50
|
-
Logger.logDebug(`[spiffy-ai] isFeatureGateEnabled featureGate:${featureGate} overridden by window param. New value: ${windowOverride}`);
|
|
51
|
-
return windowOverride;
|
|
52
|
-
}
|
|
53
|
-
const storedOverride = getStoredFeatureGateOverrides(featureGate);
|
|
54
|
-
if (storedOverride != null) {
|
|
55
|
-
Logger.logDebug(`[spiffy-ai] isFeatureGateEnabled featureGate:${featureGate} overridden by stored value. New value: ${storedOverride}`);
|
|
56
|
-
return storedOverride;
|
|
57
|
-
}
|
|
58
|
-
return undefined;
|
|
59
|
-
}, [
|
|
60
|
-
getQueryParamFeatureGateOverrides,
|
|
61
|
-
getWindowFeatureGateOverrides,
|
|
62
|
-
getStoredFeatureGateOverrides,
|
|
63
|
-
]);
|
|
64
|
-
const isFeatureGateEnabled = useCallback((featureGate) => {
|
|
65
|
-
const gateValue = featureGates.find((gate) => gate.name === featureGate);
|
|
66
|
-
const featureFlagOverride = getFeatureFlagOverride(featureGate);
|
|
67
|
-
if (featureFlagOverride !== undefined) {
|
|
68
|
-
return featureFlagOverride;
|
|
69
|
-
}
|
|
70
|
-
if (gateValue == null || gateValue.value == null) {
|
|
71
|
-
Logger.logDebug(`[spiffy-ai] isFeatureGateEnabled featureGate:${featureGate} value is undefined - returning false`);
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
return gateValue.value;
|
|
75
|
-
}, [featureGates, getFeatureFlagOverride]);
|
|
76
|
-
const isClientSessionEnabled = useCallback(() => {
|
|
77
|
-
const gates = featureGates;
|
|
78
|
-
const isEnabled = gates == null ||
|
|
79
|
-
(gates === null || gates === void 0 ? void 0 : gates.filter((gate) => gate.name === FeatureGates.IsClientSessionEnabled && gate.value === true).length) > 0;
|
|
80
|
-
return isEnabled;
|
|
81
|
-
}, [featureGates]);
|
|
82
|
-
const getFeatureFlags = useCallback(() => {
|
|
83
|
-
return Object.fromEntries(Object.values(FeatureGates).map((featureGate) => [
|
|
84
|
-
featureGate,
|
|
85
|
-
isFeatureGateEnabled(featureGate),
|
|
86
|
-
]));
|
|
87
|
-
}, [isFeatureGateEnabled]);
|
|
88
|
-
const persistFeatureGateOverrides = useCallback(() => {
|
|
89
|
-
const featureFlags = Object.values(FeatureGates)
|
|
90
|
-
.map((featureGate) => [featureGate, getFeatureFlagOverride(featureGate)])
|
|
91
|
-
.filter(([, val]) => val !== undefined)
|
|
92
|
-
.reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {});
|
|
93
|
-
setItem(FEATURE_FLAGS_STORAGE_KEY, JSON.stringify(featureFlags));
|
|
94
|
-
}, [getFeatureFlagOverride, setItem]);
|
|
95
|
-
const value = useMemo(() => ({
|
|
96
|
-
isFeatureGateEnabled,
|
|
97
|
-
isClientSessionEnabled,
|
|
98
|
-
getFeatureFlags,
|
|
99
|
-
persistFeatureGateOverrides,
|
|
100
|
-
}), [isFeatureGateEnabled, isClientSessionEnabled, getFeatureFlags, persistFeatureGateOverrides]);
|
|
101
|
-
return _jsx(FeatureFlagContext.Provider, { value: value, children: children });
|
|
102
|
-
};
|
|
103
|
-
export const useFeatureFlag = () => {
|
|
104
|
-
const context = useContext(FeatureFlagContext);
|
|
105
|
-
if (context === undefined) {
|
|
106
|
-
throw new Error('useFeatureFlag must be used within a FeatureFlagProvider');
|
|
107
|
-
}
|
|
108
|
-
return context;
|
|
109
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./featureFlagContext";
|