@envive-ai/react-hooks 0.3.3 → 0.3.5
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/_virtual/rolldown_runtime.cjs +2 -0
- package/dist/_virtual/rolldown_runtime.js +29 -0
- package/dist/application/commerce-api.cjs +12 -4
- package/dist/application/commerce-api.js +12 -4
- package/dist/application/models/api/userEvent.d.cts +4 -2
- package/dist/application/models/api/userEvent.d.ts +4 -2
- package/dist/application/models/chatElementDisplayLocationV3.cjs +24 -0
- package/dist/application/models/chatElementDisplayLocationV3.d.cts +21 -0
- package/dist/application/models/chatElementDisplayLocationV3.d.ts +21 -0
- package/dist/application/models/chatElementDisplayLocationV3.js +23 -0
- package/dist/application/models/colorsConfigV3.cjs +26 -0
- package/dist/application/models/colorsConfigV3.d.cts +22 -0
- package/dist/application/models/colorsConfigV3.d.ts +22 -0
- package/dist/application/models/colorsConfigV3.js +24 -0
- package/dist/application/models/featureGates.cjs +6 -1
- package/dist/application/models/featureGates.d.cts +6 -1
- package/dist/application/models/featureGates.d.ts +6 -1
- package/dist/application/models/featureGates.js +6 -1
- package/dist/application/models/frontendConfig.d.cts +4 -2
- package/dist/application/models/frontendConfig.d.ts +4 -2
- package/dist/application/models/frontendConfigV3.d.cts +14 -0
- package/dist/application/models/frontendConfigV3.d.ts +14 -0
- package/dist/application/models/guards/api/isApiFormResponse.cjs +1 -1
- package/dist/application/models/guards/api/isApiFormResponse.js +1 -1
- package/dist/application/models/guards/api/isApiFormSubmittedResponseAttributes.cjs +1 -1
- package/dist/application/models/guards/api/isApiFormSubmittedResponseAttributes.js +1 -1
- package/dist/application/models/guards/api/isApiOrderResponseAttributes.cjs +1 -1
- package/dist/application/models/guards/api/isApiOrderResponseAttributes.js +1 -1
- package/dist/application/models/guards/api/isApiPDPEventAttributes.cjs +2 -2
- package/dist/application/models/guards/api/isApiPDPEventAttributes.js +2 -2
- package/dist/application/models/guards/api/isApiProductResponseAttributes.cjs +1 -1
- package/dist/application/models/guards/api/isApiProductResponseAttributes.js +1 -1
- package/dist/application/models/guards/api/isApiResponse.cjs +1 -1
- package/dist/application/models/guards/api/isApiResponse.js +1 -1
- package/dist/application/models/index.cjs +3 -0
- package/dist/application/models/index.d.cts +4 -3
- package/dist/application/models/index.d.ts +4 -3
- package/dist/application/models/index.js +3 -2
- package/dist/application/models/utils/snakeToCamelTransformer.cjs +2 -1
- package/dist/application/models/utils/snakeToCamelTransformer.d.cts +7 -2
- package/dist/application/models/utils/snakeToCamelTransformer.d.ts +7 -2
- package/dist/application/models/utils/snakeToCamelTransformer.js +2 -2
- package/dist/application/utils/analyticsUtils.cjs +6 -5
- package/dist/application/utils/analyticsUtils.d.cts +1 -1
- package/dist/application/utils/analyticsUtils.d.ts +1 -1
- package/dist/application/utils/analyticsUtils.js +4 -3
- package/dist/application/utils/elementObserver.cjs +1 -1
- package/dist/application/utils/elementObserver.js +1 -1
- package/dist/application/utils/index.d.cts +1 -1
- package/dist/application/utils/index.d.ts +1 -1
- package/dist/application/utils/widgetTextFromApiWidgetTextResponse.cjs +14 -0
- package/dist/application/utils/widgetTextFromApiWidgetTextResponse.js +13 -0
- package/dist/application/utils/widgetTextRequestToApiRequest.cjs +30 -0
- package/dist/application/utils/widgetTextRequestToApiRequest.js +29 -0
- package/dist/atoms/amplitude/amplitudeTrackEventAtom.cjs +1 -1
- package/dist/atoms/amplitude/amplitudeTrackEventAtom.js +1 -1
- package/dist/atoms/app/index.cjs +6 -3
- package/dist/atoms/app/index.d.cts +3 -3
- package/dist/atoms/app/index.d.ts +3 -3
- package/dist/atoms/app/index.js +4 -5
- package/dist/atoms/app/variant.cjs +6 -1
- package/dist/atoms/app/variant.d.cts +21 -6
- package/dist/atoms/app/variant.d.ts +21 -6
- package/dist/atoms/app/variant.js +4 -2
- package/dist/atoms/chat/chatState.cjs +9 -4
- package/dist/atoms/chat/chatState.d.cts +25 -18
- package/dist/atoms/chat/chatState.d.ts +25 -18
- package/dist/atoms/chat/chatState.js +6 -3
- package/dist/atoms/chat/form.cjs +4 -4
- package/dist/atoms/chat/form.d.cts +2 -2
- package/dist/atoms/chat/form.d.ts +2 -2
- package/dist/atoms/chat/index.cjs +32 -30
- package/dist/atoms/chat/index.d.cts +5 -5
- package/dist/atoms/chat/index.d.ts +4 -4
- package/dist/atoms/chat/index.js +2 -2
- package/dist/atoms/chat/lastMessage.cjs +4 -4
- package/dist/atoms/chat/lastMessage.d.cts +2 -2
- package/dist/atoms/chat/lastMessage.d.ts +2 -2
- package/dist/atoms/chat/performanceMetrics.d.cts +6 -6
- package/dist/atoms/chat/performanceMetrics.d.ts +6 -6
- package/dist/atoms/chat/renderedWidgetRefs.d.cts +2 -2
- package/dist/atoms/chat/renderedWidgetRefs.d.ts +2 -2
- package/dist/atoms/chat/replies.cjs +9 -8
- package/dist/atoms/chat/replies.d.cts +3 -3
- package/dist/atoms/chat/replies.d.ts +3 -3
- package/dist/atoms/chat/replies.js +3 -2
- package/dist/atoms/chat/suggestions.cjs +6 -6
- package/dist/atoms/chat/suggestions.d.cts +2 -2
- package/dist/atoms/chat/suggestions.d.ts +2 -2
- package/dist/atoms/envive/enviveConfig.cjs +5 -12
- package/dist/atoms/envive/enviveConfig.js +5 -12
- package/dist/atoms/globalSearch/globalSearch.d.cts +5 -5
- package/dist/atoms/globalSearch/globalSearch.d.ts +5 -5
- package/dist/atoms/org/customerService.d.cts +6 -6
- package/dist/atoms/org/customerService.d.ts +6 -6
- package/dist/atoms/org/graphqlConfig.cjs +1 -3
- package/dist/atoms/org/graphqlConfig.d.cts +6 -9
- package/dist/atoms/org/graphqlConfig.d.ts +6 -9
- package/dist/atoms/org/graphqlConfig.js +2 -3
- package/dist/atoms/org/index.cjs +2 -3
- package/dist/atoms/org/index.d.cts +2 -2
- package/dist/atoms/org/index.d.ts +2 -2
- package/dist/atoms/org/index.js +2 -2
- package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
- package/dist/atoms/org/newOrgConfigAtom.d.ts +2 -2
- package/dist/atoms/org/orgAnalyticsConfig.d.cts +5 -5
- package/dist/atoms/org/orgAnalyticsConfig.d.ts +5 -5
- package/dist/atoms/search/chatSearch.cjs +7 -7
- package/dist/atoms/search/chatSearch.d.cts +20 -18
- package/dist/atoms/search/chatSearch.d.ts +20 -18
- package/dist/atoms/search/productRetrievalAPI.cjs +1 -7
- package/dist/atoms/search/productRetrievalAPI.js +1 -7
- package/dist/atoms/search/productRetrievalAdapter.cjs +4 -4
- package/dist/atoms/search/productRetrievalAdapter.js +4 -4
- package/dist/atoms/search/searchAPI.cjs +1 -1
- package/dist/atoms/search/searchAPI.d.cts +15 -14
- package/dist/atoms/search/searchAPI.d.ts +15 -14
- package/dist/atoms/search/searchAPI.js +1 -1
- package/dist/atoms/search/types.d.cts +1 -1
- package/dist/atoms/search/types.d.ts +1 -1
- package/dist/atoms/search/utils.d.ts +1 -1
- package/dist/atoms/widget/chatPreviewLoading.cjs +23 -0
- package/dist/atoms/widget/chatPreviewLoading.d.cts +26 -0
- package/dist/atoms/widget/chatPreviewLoading.d.ts +26 -0
- package/dist/atoms/widget/chatPreviewLoading.js +22 -0
- package/dist/atoms/widget/index.cjs +3 -0
- package/dist/atoms/widget/index.d.cts +2 -0
- package/dist/atoms/widget/index.d.ts +2 -0
- package/dist/atoms/widget/index.js +3 -0
- package/dist/contexts/amplitudeContext/amplitudeContext.cjs +40 -227
- package/dist/contexts/amplitudeContext/amplitudeContext.d.cts +4 -39
- package/dist/contexts/amplitudeContext/amplitudeContext.d.ts +4 -39
- package/dist/contexts/amplitudeContext/amplitudeContext.js +44 -230
- package/dist/contexts/amplitudeContext/index.cjs +2 -1
- package/dist/contexts/amplitudeContext/index.d.cts +2 -1
- package/dist/contexts/amplitudeContext/index.d.ts +2 -1
- package/dist/contexts/amplitudeContext/index.js +2 -1
- package/dist/contexts/enviveConfigContext/enviveConfigContext.cjs +3 -2
- package/dist/contexts/enviveConfigContext/enviveConfigContext.d.cts +2 -1
- package/dist/contexts/enviveConfigContext/enviveConfigContext.d.ts +2 -1
- package/dist/contexts/enviveConfigContext/enviveConfigContext.js +3 -2
- package/dist/contexts/enviveContext/enviveContext.cjs +70 -16
- package/dist/contexts/enviveContext/enviveContext.d.cts +10 -1
- package/dist/contexts/enviveContext/enviveContext.d.ts +10 -1
- package/dist/contexts/enviveContext/enviveContext.js +72 -18
- package/dist/contexts/enviveContext/types.d.ts +1 -1
- package/dist/contexts/enviveCssContext/enviveCssContext.cjs +96 -24
- package/dist/contexts/enviveCssContext/enviveCssContext.js +96 -24
- package/dist/contexts/featureFlagContext/featureFlagContext.cjs +1 -1
- package/dist/contexts/featureFlagContext/featureFlagContext.js +1 -1
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.cjs +6 -8
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.cts +2 -2
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -2
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.js +6 -8
- package/dist/contexts/graphqlContext/graphqlContext.cjs +151 -8
- package/dist/contexts/graphqlContext/graphqlContext.d.cts +17 -5
- package/dist/contexts/graphqlContext/graphqlContext.d.ts +17 -5
- package/dist/contexts/graphqlContext/graphqlContext.js +151 -8
- package/dist/contexts/graphqlContext/index.d.cts +2 -2
- package/dist/contexts/graphqlContext/index.d.ts +2 -2
- package/dist/contexts/graphqlContext/mockV3Config.cjs +250 -0
- package/dist/contexts/graphqlContext/mockV3Config.js +249 -0
- package/dist/contexts/hardcopyContext/hardcopyContext.cjs +144 -24
- package/dist/contexts/hardcopyContext/hardcopyContext.d.cts +4 -3
- package/dist/contexts/hardcopyContext/hardcopyContext.d.ts +4 -3
- package/dist/contexts/hardcopyContext/hardcopyContext.js +145 -25
- package/dist/contexts/newOrgConfigContext/newOrgConfigContext.cjs +7 -8
- package/dist/contexts/newOrgConfigContext/newOrgConfigContext.js +8 -9
- package/dist/contexts/pageContext/index.cjs +1 -0
- package/dist/contexts/pageContext/index.d.cts +2 -2
- package/dist/contexts/pageContext/index.d.ts +2 -2
- package/dist/contexts/pageContext/index.js +2 -2
- package/dist/contexts/pageContext/mapping.cjs +95 -1
- package/dist/contexts/pageContext/mapping.d.cts +6 -3
- package/dist/contexts/pageContext/mapping.d.ts +6 -3
- package/dist/contexts/pageContext/mapping.js +94 -2
- package/dist/contexts/pageContext/pageContext.cjs +59 -11
- package/dist/contexts/pageContext/pageContext.d.cts +6 -2
- package/dist/contexts/pageContext/pageContext.d.ts +6 -2
- package/dist/contexts/pageContext/pageContext.js +61 -13
- package/dist/contexts/pageContext/types.d.cts +6 -2
- package/dist/contexts/pageContext/types.d.ts +6 -2
- package/dist/contexts/salesAgentContext/chatAPI.cjs +9 -3
- package/dist/contexts/salesAgentContext/chatAPI.d.cts +4 -1
- package/dist/contexts/salesAgentContext/chatAPI.d.ts +4 -1
- package/dist/contexts/salesAgentContext/chatAPI.js +9 -3
- package/dist/contexts/salesAgentContext/index.d.cts +2 -2
- package/dist/contexts/salesAgentContext/index.d.ts +2 -2
- package/dist/contexts/salesAgentContext/salesAgentContext.cjs +68 -26
- package/dist/contexts/salesAgentContext/salesAgentContext.d.cts +2 -2
- package/dist/contexts/salesAgentContext/salesAgentContext.d.ts +2 -2
- package/dist/contexts/salesAgentContext/salesAgentContext.js +67 -25
- package/dist/contexts/salesAgentContext/salesAgentService.cjs +49 -10
- package/dist/contexts/salesAgentContext/salesAgentService.js +47 -8
- package/dist/contexts/salesAgentContext/statusCodeError.cjs +14 -0
- package/dist/contexts/salesAgentContext/statusCodeError.js +13 -0
- package/dist/contexts/searchContext/searchContext.cjs +1 -1
- package/dist/contexts/searchContext/searchContext.js +1 -1
- package/dist/contexts/systemSettingsContext/systemSettingsContext.d.cts +2 -2
- package/dist/contexts/types.cjs +2 -13
- package/dist/contexts/types.d.cts +12 -16
- package/dist/contexts/types.d.ts +12 -16
- package/dist/contexts/types.js +3 -13
- package/dist/contexts/typesV3.cjs +128 -0
- package/dist/contexts/typesV3.d.cts +273 -0
- package/dist/contexts/typesV3.d.ts +273 -0
- package/dist/contexts/typesV3.js +116 -0
- package/dist/contexts/uiConfigContext/index.cjs +4 -0
- package/dist/contexts/uiConfigContext/index.d.cts +2 -0
- package/dist/contexts/uiConfigContext/index.d.ts +2 -0
- package/dist/contexts/uiConfigContext/index.js +3 -0
- package/dist/contexts/uiConfigContext/uiConfigContext.cjs +44 -0
- package/dist/contexts/uiConfigContext/uiConfigContext.d.cts +15 -0
- package/dist/contexts/uiConfigContext/uiConfigContext.d.ts +15 -0
- package/dist/contexts/uiConfigContext/uiConfigContext.js +42 -0
- package/dist/contexts/userIdentityContext/userIdentityContext.cjs +1 -1
- package/dist/contexts/userIdentityContext/userIdentityContext.js +1 -1
- package/dist/contexts/widgetConfigContext/index.cjs +4 -0
- package/dist/contexts/widgetConfigContext/index.d.cts +2 -0
- package/dist/contexts/widgetConfigContext/index.d.ts +2 -0
- package/dist/contexts/widgetConfigContext/index.js +3 -0
- package/dist/contexts/widgetConfigContext/widgetConfigContext.cjs +67 -0
- package/dist/contexts/widgetConfigContext/widgetConfigContext.d.cts +19 -0
- package/dist/contexts/widgetConfigContext/widgetConfigContext.d.ts +19 -0
- package/dist/contexts/widgetConfigContext/widgetConfigContext.js +65 -0
- package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.d.cts +1 -1
- package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.d.ts +1 -1
- package/dist/hooks/AppDetails/useAppDetails.cjs +2 -4
- package/dist/hooks/AppDetails/useAppDetails.js +3 -5
- package/dist/hooks/ChatToggle/useChatToggle.cjs +6 -5
- package/dist/hooks/ChatToggle/useChatToggle.d.cts +5 -5
- package/dist/hooks/ChatToggle/useChatToggle.d.ts +5 -5
- package/dist/hooks/ChatToggle/useChatToggle.js +3 -2
- package/dist/hooks/ElementObserver/useElementObserver.cjs +10 -10
- package/dist/hooks/ElementObserver/useElementObserver.js +10 -10
- package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.cts +3 -3
- package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.ts +2 -2
- package/dist/hooks/GraphQLConfig/index.cjs +1 -1
- package/dist/hooks/GraphQLConfig/index.d.cts +2 -2
- package/dist/hooks/GraphQLConfig/index.d.ts +2 -2
- package/dist/hooks/GraphQLConfig/index.js +2 -2
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.cjs +27 -24
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.d.cts +5 -4
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.d.ts +5 -4
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.js +27 -24
- package/dist/hooks/Search/useSearch.cjs +11 -10
- package/dist/hooks/Search/useSearch.js +7 -6
- package/dist/hooks/Search/useSearchInput.cjs +4 -4
- package/dist/hooks/Search/useSearchInput.js +1 -1
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.cjs +5 -4
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.d.cts +1 -1
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.d.ts +1 -1
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.js +3 -2
- package/dist/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.cjs +3 -2
- package/dist/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.js +3 -2
- package/dist/hooks/utils.d.cts +1 -1
- package/dist/merchants/domInsertion.cjs +1 -1
- package/dist/merchants/domInsertion.d.cts +1 -1
- package/dist/merchants/domInsertion.d.ts +1 -1
- package/dist/merchants/domInsertion.js +1 -1
- package/dist/node_modules/classnames/index.cjs +52 -0
- package/dist/node_modules/classnames/index.js +49 -0
- package/dist/packages/components-v3/dist/ChatHeader/ChatHeader.cjs +2 -0
- package/dist/packages/components-v3/dist/ChatHeader/ChatHeader.js +4 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/CloseButton.cjs +16 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/CloseButton.js +17 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Handle.cjs +6 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Handle.js +8 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Layout.cjs +4 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Layout.js +6 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Logo.cjs +3 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Logo.js +5 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Toggle.cjs +7 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/Toggle.js +9 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/ToggleItem.cjs +6 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/ToggleItem.js +8 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/index.cjs +6 -0
- package/dist/packages/components-v3/dist/ChatHeader/components/index.js +8 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetCloseButtonProperties.cjs +22 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +23 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetHandleProperties.cjs +58 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetHandleProperties.js +59 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +8 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetLayoutProperties.js +9 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetToggleOptionProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetToggleOptionProperties.js +3 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetToggleProperties.cjs +12 -0
- package/dist/packages/components-v3/dist/ChatHeader/hooks/useGetToggleProperties.js +13 -0
- package/dist/packages/components-v3/dist/ChatHeader/index.cjs +2 -0
- package/dist/packages/components-v3/dist/ChatHeader/index.js +4 -0
- package/dist/packages/components-v3/dist/ChatHeader/types/index.cjs +11 -0
- package/dist/packages/components-v3/dist/ChatHeader/types/index.js +10 -0
- package/dist/packages/components-v3/dist/Container/Container.cjs +11 -0
- package/dist/packages/components-v3/dist/Container/Container.js +12 -0
- package/dist/packages/components-v3/dist/Container/hooks/useGetCenterContentProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Container/hooks/useGetCenterContentProperties.js +3 -0
- package/dist/packages/components-v3/dist/Container/hooks/useGetFluidProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Container/hooks/useGetFluidProperties.js +3 -0
- package/dist/packages/components-v3/dist/Container/index.cjs +1 -0
- package/dist/packages/components-v3/dist/Container/index.js +3 -0
- package/dist/packages/components-v3/dist/Image/Image.cjs +16 -0
- package/dist/packages/components-v3/dist/Image/Image.js +17 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetAccessibilityProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetAccessibilityProperties.js +3 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetAspectRatioProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetAspectRatioProperties.js +3 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetObjectFitProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetObjectFitProperties.js +3 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetRoundedProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetRoundedProperties.js +3 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetSkeletonProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetSkeletonProperties.js +3 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetWidthProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useGetWidthProperties.js +3 -0
- package/dist/packages/components-v3/dist/Image/hooks/useHandleImageLoading.cjs +1 -0
- package/dist/packages/components-v3/dist/Image/hooks/useHandleImageLoading.js +3 -0
- package/dist/packages/components-v3/dist/ImageGallery/ImageGallery.cjs +2 -0
- package/dist/packages/components-v3/dist/ImageGallery/ImageGallery.js +4 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/ImageItem.cjs +2 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/ImageItem.js +4 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/Layout.cjs +15 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/Layout.js +16 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/NormalLayout.cjs +4 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/NormalLayout.js +4 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/OverlappedLayout.cjs +1 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/OverlappedLayout.js +3 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/index.cjs +4 -0
- package/dist/packages/components-v3/dist/ImageGallery/components/index.js +6 -0
- package/dist/packages/components-v3/dist/ImageGallery/hooks/useGetContainerProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/ImageGallery/hooks/useGetContainerProperties.js +3 -0
- package/dist/packages/components-v3/dist/ImageGallery/index.cjs +2 -0
- package/dist/packages/components-v3/dist/ImageGallery/index.js +4 -0
- package/dist/packages/components-v3/dist/ImageGallery/types/types.cjs +13 -0
- package/dist/packages/components-v3/dist/ImageGallery/types/types.js +12 -0
- package/dist/packages/components-v3/dist/PromptButton/PromptButton.cjs +12 -0
- package/dist/packages/components-v3/dist/PromptButton/PromptButton.js +13 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Icon.cjs +1 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Icon.js +3 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Label.cjs +3 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Label.js +5 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Layout.cjs +12 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Layout.js +13 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Loading.cjs +9 -0
- package/dist/packages/components-v3/dist/PromptButton/components/Loading.js +10 -0
- package/dist/packages/components-v3/dist/PromptButton/components/index.cjs +4 -0
- package/dist/packages/components-v3/dist/PromptButton/components/index.js +6 -0
- package/dist/packages/components-v3/dist/PromptButton/hooks/useGetBoldTextProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/PromptButton/hooks/useGetBoldTextProperties.js +3 -0
- package/dist/packages/components-v3/dist/PromptButton/hooks/useGetLayoutBaseProperties.cjs +8 -0
- package/dist/packages/components-v3/dist/PromptButton/hooks/useGetLayoutBaseProperties.js +9 -0
- package/dist/packages/components-v3/dist/PromptButton/index.cjs +2 -0
- package/dist/packages/components-v3/dist/PromptButton/index.js +4 -0
- package/dist/packages/components-v3/dist/PromptButton/types/index.cjs +13 -0
- package/dist/packages/components-v3/dist/PromptButton/types/index.js +12 -0
- package/dist/packages/components-v3/dist/PromptCarousel/PromptCarousel.cjs +12 -0
- package/dist/packages/components-v3/dist/PromptCarousel/PromptCarousel.js +14 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/BlockScrollContainer.cjs +9 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/BlockScrollContainer.js +10 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/ButtonContainerRow.cjs +11 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/ButtonContainerRow.js +12 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/CarouselContentWithBlockScroll.cjs +4 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/CarouselContentWithBlockScroll.js +6 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/CarouselContentWithRowScroll.cjs +4 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/CarouselContentWithRowScroll.js +6 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/index.cjs +3 -0
- package/dist/packages/components-v3/dist/PromptCarousel/components/index.js +5 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/index.cjs +5 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/index.js +7 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useButtonScrollPosition.cjs +1 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useButtonScrollPosition.js +3 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useCarouselAnimation.cjs +3 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useCarouselAnimation.js +5 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useCarouselButtons.cjs +1 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useCarouselButtons.js +3 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useCarouselRefs.cjs +1 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useCarouselRefs.js +3 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.cjs +1 -0
- package/dist/packages/components-v3/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.js +3 -0
- package/dist/packages/components-v3/dist/PromptCarousel/index.cjs +2 -0
- package/dist/packages/components-v3/dist/PromptCarousel/index.js +4 -0
- package/dist/packages/components-v3/dist/PromptCarousel/types/types.cjs +19 -0
- package/dist/packages/components-v3/dist/PromptCarousel/types/types.js +17 -0
- package/dist/packages/components-v3/dist/Stack/Stack.cjs +36 -0
- package/dist/packages/components-v3/dist/Stack/Stack.js +36 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useFormatStackChildren.cjs +27 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useFormatStackChildren.js +26 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetAlignProperties.cjs +20 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetAlignProperties.js +19 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetDirectionProperties.cjs +19 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetDirectionProperties.js +18 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetGapProperties.cjs +16 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetGapProperties.js +15 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetJustifyProperties.cjs +21 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetJustifyProperties.js +20 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetStyleProperties.cjs +38 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetStyleProperties.js +38 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetWrapProperties.cjs +13 -0
- package/dist/packages/components-v3/dist/Stack/hooks/useGetWrapProperties.js +12 -0
- package/dist/packages/components-v3/dist/Stack/index.cjs +1 -0
- package/dist/packages/components-v3/dist/Stack/index.js +3 -0
- package/dist/packages/components-v3/dist/Stack/utils/constants.cjs +42 -0
- package/dist/packages/components-v3/dist/Stack/utils/constants.js +41 -0
- package/dist/packages/components-v3/dist/Tokens/index.cjs +11 -0
- package/dist/packages/components-v3/dist/Tokens/index.js +13 -0
- package/dist/packages/components-v3/dist/Typography/Typography.cjs +15 -0
- package/dist/packages/components-v3/dist/Typography/Typography.js +16 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetAccessibilityAttributes.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetAccessibilityAttributes.js +3 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetAlignProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetAlignProperties.js +3 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetColorProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetColorProperties.js +3 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetNoWrapProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetNoWrapProperties.js +3 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetNumberOfLinesProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetNumberOfLinesProperties.js +3 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetVariantProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/hooks/useGetVariantProperties.js +3 -0
- package/dist/packages/components-v3/dist/Typography/index.cjs +1 -0
- package/dist/packages/components-v3/dist/Typography/index.js +3 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/WelcomeMessage.cjs +2 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/WelcomeMessage.js +4 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/Container.cjs +14 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/Container.js +15 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/SparkleIcon.cjs +3 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/SparkleIcon.js +5 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/Text.cjs +3 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/Text.js +5 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/Title.cjs +3 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/Title.js +5 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/index.cjs +4 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/components/index.js +6 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/hooks/useGetContainerProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/hooks/useGetContainerProperties.js +3 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/hooks/useGetSparkleIconProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/hooks/useGetSparkleIconProperties.js +3 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/index.cjs +2 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/index.js +4 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/types/types.cjs +14 -0
- package/dist/packages/components-v3/dist/WelcomeMessage/types/types.js +14 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/WidgetWrapper.cjs +12 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/WidgetWrapper.js +13 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/hooks/useGetWrapperProperties.cjs +1 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/hooks/useGetWrapperProperties.js +3 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/index.cjs +2 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/index.js +4 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/types/types.cjs +13 -0
- package/dist/packages/components-v3/dist/WidgetWrapper/types/types.js +12 -0
- package/dist/packages/components-v3/dist/src/models/colorsConfig.cjs +26 -0
- package/dist/packages/components-v3/dist/src/models/colorsConfig.js +25 -0
- package/dist/packages/components-v3/dist/tokens/aspectRatio/aspectRatio.cjs +16 -0
- package/dist/packages/components-v3/dist/tokens/aspectRatio/aspectRatio.js +17 -0
- package/dist/packages/components-v3/dist/tokens/breakpoints/breakpoints.cjs +25 -0
- package/dist/packages/components-v3/dist/tokens/breakpoints/breakpoints.js +23 -0
- package/dist/packages/components-v3/dist/tokens/colors/colors.cjs +51 -0
- package/dist/packages/components-v3/dist/tokens/colors/colors.js +51 -0
- package/dist/packages/components-v3/dist/tokens/radius/radius.cjs +64 -0
- package/dist/packages/components-v3/dist/tokens/radius/radius.js +65 -0
- package/dist/packages/components-v3/dist/tokens/theme/theme.cjs +13 -0
- package/dist/packages/components-v3/dist/tokens/theme/theme.js +12 -0
- package/dist/packages/components-v3/dist/tokens/typography/fontFamily.cjs +25 -0
- package/dist/packages/components-v3/dist/tokens/typography/fontFamily.js +25 -0
- package/dist/packages/components-v3/dist/tokens/typography/fontSize.cjs +37 -0
- package/dist/packages/components-v3/dist/tokens/typography/fontSize.js +38 -0
- package/dist/packages/components-v3/dist/tokens/typography/fontWeight.cjs +17 -0
- package/dist/packages/components-v3/dist/tokens/typography/fontWeight.js +18 -0
- package/dist/packages/components-v3/dist/tokens/typography/letterSpacing.cjs +15 -0
- package/dist/packages/components-v3/dist/tokens/typography/letterSpacing.js +16 -0
- package/dist/packages/components-v3/dist/tokens/typography/lineHeight.cjs +31 -0
- package/dist/packages/components-v3/dist/tokens/typography/lineHeight.js +32 -0
- package/dist/packages/components-v3/dist/tokens/typography/typography.cjs +5 -0
- package/dist/packages/components-v3/dist/tokens/typography/typography.js +7 -0
- package/dist/packages/components-v3/dist/tokens/utils.cjs +7 -0
- package/dist/packages/components-v3/dist/tokens/utils.js +6 -0
- package/dist/packages/components-v3/dist/utils/useCheckIsMobile.cjs +1 -0
- package/dist/packages/components-v3/dist/utils/useCheckIsMobile.js +3 -0
- package/dist/packages/components-v3/dist/utils/useResponsiveValue.cjs +57 -0
- package/dist/packages/components-v3/dist/utils/useResponsiveValue.js +56 -0
- package/dist/packages/icons/dist/FourPointStar.cjs +8 -0
- package/dist/packages/icons/dist/FourPointStar.js +9 -0
- package/dist/packages/icons/dist/IconCloseRounded.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseRounded.js +22 -0
- package/dist/packages/icons/dist/IconCloseSharp.cjs +31 -0
- package/dist/packages/icons/dist/IconCloseSharp.js +31 -0
- package/dist/packages/icons/dist/IconCloseTransparent.cjs +24 -0
- package/dist/packages/icons/dist/IconCloseTransparent.js +24 -0
- package/dist/packages/icons/dist/Sparkles.cjs +8 -0
- package/dist/packages/icons/dist/Sparkles.js +9 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +28 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +26 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +697 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +697 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +44 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +44 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1529 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1529 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +330 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +330 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +14 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +14 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +14 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +14 -0
- package/dist/services/amplitudeService/amplitudeService.cjs +204 -0
- package/dist/services/amplitudeService/amplitudeService.d.cts +75 -0
- package/dist/services/amplitudeService/amplitudeService.d.ts +75 -0
- package/dist/services/amplitudeService/amplitudeService.js +202 -0
- package/dist/services/amplitudeService/index.cjs +4 -0
- package/dist/services/amplitudeService/index.d.cts +2 -0
- package/dist/services/amplitudeService/index.d.ts +2 -0
- package/dist/services/amplitudeService/index.js +3 -0
- package/dist/services/enviveConfigService/enviveConfigService.cjs +36 -0
- package/dist/services/enviveConfigService/enviveConfigService.d.cts +43 -0
- package/dist/services/enviveConfigService/enviveConfigService.d.ts +43 -0
- package/dist/services/enviveConfigService/enviveConfigService.js +36 -0
- package/dist/services/enviveConfigService/index.cjs +3 -0
- package/dist/services/enviveConfigService/index.d.cts +2 -0
- package/dist/services/enviveConfigService/index.d.ts +2 -0
- package/dist/services/enviveConfigService/index.js +3 -0
- package/dist/types/customerService.cjs +20 -0
- package/dist/types/customerService.js +19 -0
- package/dist/types/enviveConfig.d.cts +29 -0
- package/dist/types/enviveConfig.d.ts +29 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +36 -8
- package/src/application/commerce-api.ts +14 -1
- package/src/application/models/api/userEvent.ts +3 -1
- package/src/application/models/api/widgetText.ts +9 -0
- package/src/application/models/api/widgetTextRequest.ts +10 -0
- package/src/application/models/chatElementDisplayLocationV3.ts +18 -0
- package/src/application/models/colorsConfigV3.ts +26 -0
- package/src/application/models/featureGates.ts +6 -0
- package/src/application/models/frontendConfig.ts +5 -0
- package/src/application/models/frontendConfigV3.ts +10 -0
- package/src/application/models/guards/api/isApiPDPEventAttributes.ts +5 -1
- package/src/application/models/index.ts +1 -0
- package/src/application/models/utils/snakeToCamelTransformer.ts +1 -1
- package/src/application/utils/elementObserver.ts +2 -2
- package/src/application/utils/widgetTextFromApiWidgetTextResponse.ts +30 -0
- package/src/application/utils/widgetTextRequestToApiRequest.ts +45 -0
- package/src/atoms/amplitude/amplitudeTrackEventAtom.ts +1 -8
- package/src/atoms/app/index.ts +9 -3
- package/src/atoms/app/variant.ts +8 -2
- package/src/atoms/chat/chatState.ts +10 -2
- package/src/atoms/envive/enviveConfig.ts +5 -11
- package/src/atoms/org/graphqlConfig.ts +0 -1
- package/src/atoms/search/productRetrievalAPI.ts +0 -8
- package/src/atoms/search/productRetrievalAdapter.ts +6 -10
- package/src/atoms/widget/chatPreviewLoading.ts +36 -0
- package/src/atoms/widget/index.ts +1 -0
- package/src/contexts/amplitudeContext/__tests__/amplitudeContext.test.tsx +196 -187
- package/src/contexts/amplitudeContext/amplitudeContext.tsx +56 -334
- package/src/contexts/enviveConfigContext/enviveConfigContext.tsx +3 -0
- package/src/contexts/enviveContext/enviveContext.tsx +103 -27
- package/src/contexts/enviveCssContext/enviveCssContext.tsx +121 -22
- package/src/contexts/featureFlagServiceContext/featureFlagServiceContext.tsx +12 -11
- package/src/contexts/graphqlContext/graphqlContext.tsx +250 -13
- package/src/contexts/graphqlContext/mockV3Config.ts +250 -0
- package/src/contexts/hardcopyContext/hardcopyContext.tsx +159 -21
- package/src/contexts/newOrgConfigContext/__tests__/newOrgConfigContext.test.tsx +6 -6
- package/src/contexts/newOrgConfigContext/newOrgConfigContext.tsx +5 -13
- package/src/contexts/pageContext/__tests__/pageContext.test.tsx +141 -75
- package/src/contexts/pageContext/mapping.ts +188 -2
- package/src/contexts/pageContext/pageContext.tsx +68 -14
- package/src/contexts/pageContext/types.ts +5 -2
- package/src/contexts/salesAgentContext/chatAPI.ts +10 -0
- package/src/contexts/salesAgentContext/salesAgentContext.tsx +104 -45
- package/src/contexts/salesAgentContext/salesAgentService.ts +91 -4
- package/src/contexts/salesAgentContext/statusCodeError.ts +10 -0
- package/src/contexts/searchContext/__tests__/searchContext.test.tsx +8 -2
- package/src/contexts/types.ts +15 -19
- package/src/contexts/typesV3.ts +348 -0
- package/src/contexts/uiConfigContext/__tests__/uiConfigContext.test.tsx +329 -0
- package/src/contexts/uiConfigContext/index.ts +1 -0
- package/src/contexts/uiConfigContext/uiConfigContext.tsx +44 -0
- package/src/contexts/widgetConfigContext/__tests__/widgetConfigContext.test.tsx +512 -0
- package/src/contexts/widgetConfigContext/index.ts +1 -0
- package/src/contexts/widgetConfigContext/widgetConfigContext.tsx +84 -0
- package/src/hooks/AppDetails/useAppDetails.ts +2 -2
- package/src/hooks/ChatToggle/useChatToggle.ts +4 -4
- package/src/hooks/ElementObserver/useElementObserver.ts +9 -9
- package/src/hooks/GraphQLConfig/useGraphQLConfig.ts +22 -21
- package/src/hooks/Search/__tests__/useSearch.test.tsx +15 -6
- package/src/hooks/Search/useSearch.tsx +6 -5
- package/src/merchants/domInsertion.ts +0 -16
- package/src/services/amplitudeService/__tests__/amplitudeService.test.ts +558 -0
- package/src/services/amplitudeService/amplitudeService.ts +324 -0
- package/src/services/amplitudeService/index.ts +1 -0
- package/src/services/enviveConfigService/enviveConfigService.ts +72 -0
- package/src/services/enviveConfigService/index.ts +1 -0
- package/src/types/enviveConfig.ts +27 -0
- package/src/types/index.ts +1 -0
- package/dist/hooks/ChatToggleAnalytics/index.cjs +0 -3
- package/dist/hooks/ChatToggleAnalytics/index.d.cts +0 -2
- package/dist/hooks/ChatToggleAnalytics/index.d.ts +0 -2
- package/dist/hooks/ChatToggleAnalytics/index.js +0 -3
- package/dist/hooks/ChatToggleAnalytics/useChatToggleAnalytics.cjs +0 -19
- package/dist/hooks/ChatToggleAnalytics/useChatToggleAnalytics.d.cts +0 -9
- package/dist/hooks/ChatToggleAnalytics/useChatToggleAnalytics.d.ts +0 -9
- package/dist/hooks/ChatToggleAnalytics/useChatToggleAnalytics.js +0 -18
- package/src/application/utils/cdnUtils.ts +0 -8
- package/src/config/divIds.ts +0 -31
- package/src/config/locators/components/chat/entrypoints.ts +0 -13
- package/src/config/locators/components/chat/preview.ts +0 -12
- package/src/config/locators/components/report-issue.ts +0 -21
- package/src/config/socialProofClasses.ts +0 -12
- package/src/events/registerAnalyticsListeners.ts +0 -44
- package/src/hooks/ChatToggleAnalytics/index.ts +0 -1
- package/src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.ts +0 -15
- package/src/types/FilterAttribute.ts +0 -32
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { createInstance } from '@amplitude/analytics-browser';
|
|
2
|
+
import { EventsDispatcher, SpiffyEvent } from 'src/events';
|
|
3
|
+
import { LocalStorageKeys } from 'src/contexts/localStorageContext';
|
|
4
|
+
import Logger from 'src/application/logging/logger';
|
|
5
|
+
import type {
|
|
6
|
+
BrowserClient,
|
|
7
|
+
EnrichmentPlugin,
|
|
8
|
+
Event,
|
|
9
|
+
ServerZoneType,
|
|
10
|
+
} from '@amplitude/analytics-types';
|
|
11
|
+
import { FeatureFlagService } from 'src/contexts/featureFlagServiceContext/featureFlagServiceContext';
|
|
12
|
+
|
|
13
|
+
export enum SpiffyMetricsEventName {
|
|
14
|
+
BundleLoaded = 'Bundle Loaded',
|
|
15
|
+
ChatLiveAgentBtnClick = 'Chat Live Agent Btn Click',
|
|
16
|
+
ChatFloatingButtonVisible = 'Chat Floating Button Visible',
|
|
17
|
+
ChatComponentVisible = 'Chat Component Visible',
|
|
18
|
+
ChatComponentExpanded = 'Chat Component Expanded',
|
|
19
|
+
ChatComponentCollapsed = 'Chat Component Collapsed',
|
|
20
|
+
ChatUserMessageInput = 'Chat User Message Input',
|
|
21
|
+
ChatSuggestionClicked = 'Chat Suggestion Clicked',
|
|
22
|
+
ChatAssistantResponse = 'Chat Assistant Response',
|
|
23
|
+
ProductCardClicked = 'Product Card Clicked',
|
|
24
|
+
ProductReviewCardClicked = 'Product Review Card Clicked',
|
|
25
|
+
AddToCartClicked = 'Add To Cart Clicked',
|
|
26
|
+
PromptCardClicked = 'Prompt Card Clicked',
|
|
27
|
+
SupportedEvent = 'Supported Event',
|
|
28
|
+
SearchBackToResponseClicked = 'Search Back to Response Clicked',
|
|
29
|
+
PerformanceMetrics = 'Performance Metrics',
|
|
30
|
+
SearchBarClicked = 'Search Bar Clicked',
|
|
31
|
+
OrderLookupStarted = 'Order Lookup Started',
|
|
32
|
+
OrderLookupFormSubmitted = 'Order Lookup Form Submitted',
|
|
33
|
+
SearchComponentVisible = 'Search Component Visible',
|
|
34
|
+
SearchZeroStateSuggestionClicked = 'Search Zero State Suggestion Clicked', // This is the scrolling list of suggestion buttons in global search
|
|
35
|
+
SearchInputStarted = 'Search Input Started',
|
|
36
|
+
SearchQuerySubmitted = 'Search Query Submitted',
|
|
37
|
+
// SearchAutocompleteViewed = 'Search Autocomplete Viewed', // TODO: add this when autocomplete is added
|
|
38
|
+
// SearchAutocompleteClicked = 'Search Autocomplete Clicked', // TODO: add this when autocomplete is added
|
|
39
|
+
SearchResultsViewed = 'Search Results Viewed',
|
|
40
|
+
SearchTimeToFirstClick = 'Search Time to First Click',
|
|
41
|
+
SearchZeroResultsRate = 'Search Zero Results Rate',
|
|
42
|
+
SearchFilterClicked = 'Search Filter Clicked',
|
|
43
|
+
SearchSortClicked = 'Search Sort Clicked',
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface TrackEventParams {
|
|
47
|
+
eventName: SpiffyMetricsEventName;
|
|
48
|
+
eventProps?: Record<string, unknown>;
|
|
49
|
+
eventGroups?: Record<string, unknown>;
|
|
50
|
+
alsoSendToGoogleAnalytics?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AmplitudeServiceConfig {
|
|
54
|
+
userId: string;
|
|
55
|
+
amplitudeApiKey: string;
|
|
56
|
+
dataResidency: string;
|
|
57
|
+
env: string;
|
|
58
|
+
contextSource: string;
|
|
59
|
+
orgShortName: string;
|
|
60
|
+
featureFlagService: FeatureFlagService;
|
|
61
|
+
orgGaConfig?: unknown;
|
|
62
|
+
show?: boolean;
|
|
63
|
+
getLocalStorageItem?: (key: string) => string | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class AmplitudeService {
|
|
67
|
+
private amplitudeClient: BrowserClient | undefined;
|
|
68
|
+
|
|
69
|
+
private internalEventTrackingEnrichment: EnrichmentPlugin | undefined;
|
|
70
|
+
|
|
71
|
+
private supplementalDefaultProps: Record<string, unknown> = {};
|
|
72
|
+
|
|
73
|
+
private config: AmplitudeServiceConfig;
|
|
74
|
+
|
|
75
|
+
constructor(config: AmplitudeServiceConfig) {
|
|
76
|
+
this.config = config;
|
|
77
|
+
this.initialize();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get isReady(): boolean {
|
|
81
|
+
return Boolean(
|
|
82
|
+
this.config.userId &&
|
|
83
|
+
this.config.featureFlagService &&
|
|
84
|
+
this.config.amplitudeApiKey &&
|
|
85
|
+
this.amplitudeClient,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private getLocalStorageItem(key: string): string | null {
|
|
90
|
+
if (this.config.getLocalStorageItem) {
|
|
91
|
+
return this.config.getLocalStorageItem(key);
|
|
92
|
+
}
|
|
93
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
94
|
+
return window.localStorage.getItem(key);
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private getDefaultTrackingProps(): Record<string, unknown> {
|
|
100
|
+
const featureGates = Object.entries(this.config.featureFlagService.getFeatureFlags());
|
|
101
|
+
const gatesProps =
|
|
102
|
+
featureGates.length > 0
|
|
103
|
+
? featureGates.reduce<Record<string, boolean>>((acc, [name, value]) => {
|
|
104
|
+
if (name && value != null) {
|
|
105
|
+
return { ...acc, [`feature_gate.${name}`]: value };
|
|
106
|
+
}
|
|
107
|
+
return acc;
|
|
108
|
+
}, {})
|
|
109
|
+
: {};
|
|
110
|
+
const experimentProps = {}; // No direct equivalent for experiments in EnviveConfig yet
|
|
111
|
+
|
|
112
|
+
const orgLevelAmplitudeTrackingProps = {
|
|
113
|
+
...gatesProps,
|
|
114
|
+
...experimentProps,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
...orgLevelAmplitudeTrackingProps,
|
|
119
|
+
...this.supplementalDefaultProps,
|
|
120
|
+
// TODO: org_id is not directly available in EnviveConfig. Need to find a new source or derive it.
|
|
121
|
+
// org_id: orgConfig?.org?.org?.id,
|
|
122
|
+
app_id: 'commerce-chat-react-component',
|
|
123
|
+
chat_id: this.getLocalStorageItem(LocalStorageKeys.ChatId),
|
|
124
|
+
env: this.config.env || 'unknown',
|
|
125
|
+
app_source: this.config.contextSource,
|
|
126
|
+
'org.short_name': this.config.orgShortName,
|
|
127
|
+
'user.id': this.config.userId,
|
|
128
|
+
'cdp.user_id': null,
|
|
129
|
+
'cdp.provider': null,
|
|
130
|
+
'event.source': 'web-browser',
|
|
131
|
+
'event.type': 'user-activity',
|
|
132
|
+
'event.id': null,
|
|
133
|
+
'event.channel': 'web',
|
|
134
|
+
'event.timestamp': null,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// eslint-disable-next-line class-methods-use-this
|
|
139
|
+
private eventPropsToPrefixedEventProps(
|
|
140
|
+
eventName: SpiffyMetricsEventName,
|
|
141
|
+
eventProps: Record<string, unknown>,
|
|
142
|
+
): Record<string, unknown> {
|
|
143
|
+
const prefix = eventName.toLowerCase().replace(/\s+/g, '_');
|
|
144
|
+
return Object.entries(eventProps).reduce(
|
|
145
|
+
(acc, [key, value]) => {
|
|
146
|
+
acc[`${prefix}.${key}`] = value;
|
|
147
|
+
return acc;
|
|
148
|
+
},
|
|
149
|
+
{} as Record<string, unknown>,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private getEventTrackingEnrichment(): EnrichmentPlugin {
|
|
154
|
+
if (this.internalEventTrackingEnrichment !== undefined) {
|
|
155
|
+
return this.internalEventTrackingEnrichment;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const enrichment: EnrichmentPlugin = {
|
|
159
|
+
name: 'page-view-tracking-enrichment',
|
|
160
|
+
type: 'enrichment',
|
|
161
|
+
setup: async () => undefined,
|
|
162
|
+
execute: async (event: Event): Promise<Event> => {
|
|
163
|
+
let enrichedEvent: Event;
|
|
164
|
+
|
|
165
|
+
const eventsToEnrich = [
|
|
166
|
+
'[Amplitude] Page Viewed',
|
|
167
|
+
`[Spiffy] ${SpiffyMetricsEventName.BundleLoaded}`,
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
if (eventsToEnrich.includes(event.event_type)) {
|
|
171
|
+
const globalProperties: Record<string, string> = {};
|
|
172
|
+
|
|
173
|
+
if (this.config.show != null) {
|
|
174
|
+
globalProperties['globalProperties.show'] = String(this.config.show);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const enabledFeatures = this.config.featureFlagService.getFeatureFlags();
|
|
178
|
+
const enabledFeaturesProperties = Object.entries(enabledFeatures).reduce<
|
|
179
|
+
Record<string, string>
|
|
180
|
+
>(
|
|
181
|
+
(acc, [key, value]) => ({
|
|
182
|
+
...acc,
|
|
183
|
+
[`enabledFeatures.${key}`]: `${value}`,
|
|
184
|
+
}),
|
|
185
|
+
{},
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
const timingProperties = {
|
|
189
|
+
'timing.enriched_at_ms':
|
|
190
|
+
typeof window !== 'undefined' ? window.performance?.now() : undefined,
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
enrichedEvent = {
|
|
194
|
+
...event,
|
|
195
|
+
event_properties: {
|
|
196
|
+
...event.event_properties,
|
|
197
|
+
...this.getDefaultTrackingProps(),
|
|
198
|
+
...globalProperties,
|
|
199
|
+
...enabledFeaturesProperties,
|
|
200
|
+
...timingProperties,
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
} else {
|
|
204
|
+
enrichedEvent = event;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
EventsDispatcher.dispatch(SpiffyEvent.AMPLITUDE_EVENT, enrichedEvent);
|
|
208
|
+
|
|
209
|
+
return enrichedEvent;
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
this.internalEventTrackingEnrichment = enrichment;
|
|
213
|
+
return enrichment;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
private initialize(): void {
|
|
217
|
+
const isReady = Boolean(
|
|
218
|
+
this.config.userId && this.config.featureFlagService && this.config.amplitudeApiKey,
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
if (!isReady) {
|
|
222
|
+
Logger.logDebug('AmplitudeService is not ready', {
|
|
223
|
+
isReady,
|
|
224
|
+
userId: this.config.userId,
|
|
225
|
+
hasFeatureFlagService: !!this.config.featureFlagService,
|
|
226
|
+
hasAmplitudeApiKey: !!this.config.amplitudeApiKey,
|
|
227
|
+
});
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (!this.amplitudeClient) {
|
|
232
|
+
const currentAmplitudeInstance: BrowserClient = createInstance();
|
|
233
|
+
|
|
234
|
+
currentAmplitudeInstance.add(this.getEventTrackingEnrichment());
|
|
235
|
+
currentAmplitudeInstance.init(this.config.amplitudeApiKey, this.config.userId, {
|
|
236
|
+
serverZone: this.config.dataResidency as ServerZoneType,
|
|
237
|
+
trackingOptions: {
|
|
238
|
+
ipAddress: true,
|
|
239
|
+
},
|
|
240
|
+
autocapture: {
|
|
241
|
+
attribution: true,
|
|
242
|
+
pageViews: {
|
|
243
|
+
trackHistoryChanges: 'pathOnly',
|
|
244
|
+
},
|
|
245
|
+
sessions: false,
|
|
246
|
+
formInteractions: false,
|
|
247
|
+
fileDownloads: false,
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
this.amplitudeClient = currentAmplitudeInstance;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
async trackEvent({
|
|
255
|
+
eventName,
|
|
256
|
+
eventProps,
|
|
257
|
+
eventGroups,
|
|
258
|
+
alsoSendToGoogleAnalytics = false,
|
|
259
|
+
}: TrackEventParams): Promise<void> {
|
|
260
|
+
Logger.logDebug('Submitting event', eventName);
|
|
261
|
+
try {
|
|
262
|
+
const decoratedEventName = `[Spiffy] ${eventName}`;
|
|
263
|
+
|
|
264
|
+
if (!this.amplitudeClient) {
|
|
265
|
+
Logger.logWarn('amplitude client undefined', undefined, {
|
|
266
|
+
event_name: decoratedEventName,
|
|
267
|
+
});
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const eventData = JSON.stringify({
|
|
272
|
+
eventName,
|
|
273
|
+
eventProps,
|
|
274
|
+
created_at: new Date().toISOString(),
|
|
275
|
+
});
|
|
276
|
+
const encoder = new TextEncoder();
|
|
277
|
+
const data = encoder.encode(eventData);
|
|
278
|
+
// calculate a hash of the event properties to use as the insert_id so that duplicate events
|
|
279
|
+
// are automatically dropped by Amplitude
|
|
280
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
281
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
282
|
+
const currentInsertId = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
283
|
+
|
|
284
|
+
Logger.logDebug(`amplitude tracking ${decoratedEventName}`, null, {
|
|
285
|
+
event_name: decoratedEventName,
|
|
286
|
+
props: eventProps,
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
this.amplitudeClient.track(
|
|
290
|
+
decoratedEventName,
|
|
291
|
+
{
|
|
292
|
+
...this.getDefaultTrackingProps(),
|
|
293
|
+
...eventProps,
|
|
294
|
+
...(eventProps ? this.eventPropsToPrefixedEventProps(eventName, eventProps) : {}),
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
...eventGroups,
|
|
298
|
+
insert_id: currentInsertId,
|
|
299
|
+
},
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
if (alsoSendToGoogleAnalytics && this.config.orgGaConfig) {
|
|
303
|
+
// TODO: Add in windowDataLayerService or context alternative and hook it up here
|
|
304
|
+
Logger.logDebug('[spiffy-ai] GA tracking', decoratedEventName);
|
|
305
|
+
if (typeof window !== 'undefined' && window.dataLayer) {
|
|
306
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
|
+
(window.dataLayer as any[]).push({
|
|
308
|
+
event: decoratedEventName,
|
|
309
|
+
eventProps,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
} catch (err) {
|
|
314
|
+
Logger.logError('[spiffy-ai] Error tracking event', err, {
|
|
315
|
+
eventName,
|
|
316
|
+
eventProps,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
setSupplementalDefaultProps(props: Record<string, unknown>): void {
|
|
322
|
+
this.supplementalDefaultProps = props;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './amplitudeService';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { OrgConfigFeatureGate } from 'src/application/models';
|
|
2
|
+
import { FeatureGates } from 'src/application/models/featureGates';
|
|
3
|
+
|
|
4
|
+
type EnviveConfigServiceProps = {
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
source: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type EnviveServiceConfig = {
|
|
13
|
+
org: {
|
|
14
|
+
org: {
|
|
15
|
+
id: string;
|
|
16
|
+
short_name: string;
|
|
17
|
+
display_name: string;
|
|
18
|
+
domain: string;
|
|
19
|
+
status: string;
|
|
20
|
+
created_at: string;
|
|
21
|
+
updated_at: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
gates: OrgConfigFeatureGate[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export class EnviveConfigService {
|
|
28
|
+
private readonly baseUrl: string;
|
|
29
|
+
|
|
30
|
+
private readonly apiKey: string;
|
|
31
|
+
|
|
32
|
+
private readonly userId: string;
|
|
33
|
+
|
|
34
|
+
private readonly namespace: string;
|
|
35
|
+
|
|
36
|
+
private readonly source: string;
|
|
37
|
+
|
|
38
|
+
private response: EnviveServiceConfig | null = null;
|
|
39
|
+
|
|
40
|
+
constructor({ baseUrl, apiKey, userId, namespace, source }: EnviveConfigServiceProps) {
|
|
41
|
+
this.baseUrl = baseUrl;
|
|
42
|
+
this.apiKey = apiKey;
|
|
43
|
+
this.userId = userId;
|
|
44
|
+
this.namespace = namespace;
|
|
45
|
+
this.source = source;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getEnviveConfig(): Promise<EnviveServiceConfig> {
|
|
49
|
+
if (this.response !== null) {
|
|
50
|
+
return this.response;
|
|
51
|
+
}
|
|
52
|
+
const queryParams = new URLSearchParams({
|
|
53
|
+
namespace: this.namespace,
|
|
54
|
+
source: this.source,
|
|
55
|
+
user_id: this.userId,
|
|
56
|
+
include_experiments: 'default',
|
|
57
|
+
include_feature_gates: Object.values(FeatureGates)
|
|
58
|
+
.map(featureGate => featureGate.toString())
|
|
59
|
+
.join(','),
|
|
60
|
+
});
|
|
61
|
+
const response = await fetch(`${this.baseUrl}/v1/org/config?${queryParams.toString()}`, {
|
|
62
|
+
method: 'GET',
|
|
63
|
+
headers: {
|
|
64
|
+
'Content-Type': 'application/json',
|
|
65
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
const data = (await response.json()) as EnviveServiceConfig;
|
|
69
|
+
this.response = data;
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enviveConfigService';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FrontendConfigOverrides, VariantInfo } from 'src/application/models';
|
|
2
|
+
|
|
3
|
+
export interface EnviveConfig {
|
|
4
|
+
publicKey?: string;
|
|
5
|
+
userID?: string;
|
|
6
|
+
env?: 'prod' | 'dev';
|
|
7
|
+
clientID?: string;
|
|
8
|
+
show?: boolean;
|
|
9
|
+
featureOverrides?: Record<string, boolean>;
|
|
10
|
+
variantInfoOverride?: VariantInfo;
|
|
11
|
+
variantUrlOverride?: string;
|
|
12
|
+
pageVariantIdOverride?: string;
|
|
13
|
+
selectedCustomizeOption?: string;
|
|
14
|
+
reducedMotionOverride?: boolean;
|
|
15
|
+
initialOpenSearchOverlay?: boolean;
|
|
16
|
+
WidgetMountingOverride?: Record<string, any>[];
|
|
17
|
+
configChanges?: FrontendConfigOverrides[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare global {
|
|
21
|
+
interface Window {
|
|
22
|
+
_spiffy?: EnviveConfig;
|
|
23
|
+
_envive?: EnviveConfig;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {};
|
package/src/types/index.ts
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_chatState = require('../../atoms/chat/chatState.cjs');
|
|
3
|
-
const require_useAmplitudeOperations = require('../AmplitudeOperations/useAmplitudeOperations.cjs');
|
|
4
|
-
require('../AmplitudeOperations/index.cjs');
|
|
5
|
-
let jotai = require("jotai");
|
|
6
|
-
|
|
7
|
-
//#region src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.ts
|
|
8
|
-
const useChatToggleAnalytics = () => {
|
|
9
|
-
const setChatOnToggle = (0, jotai.useSetAtom)(require_chatState.chatOnToggleAtom);
|
|
10
|
-
const { track } = require_useAmplitudeOperations.useAmplitudeTracking();
|
|
11
|
-
const toggleChat = (triggerLocation) => {
|
|
12
|
-
setChatOnToggle(triggerLocation, track);
|
|
13
|
-
};
|
|
14
|
-
return { toggleChat };
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
exports.useChatToggleAnalytics = useChatToggleAnalytics;
|
|
19
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlQ2hhdFRvZ2dsZUFuYWx5dGljcy5janMiLCJuYW1lcyI6WyJjaGF0T25Ub2dnbGVBdG9tIiwidXNlQW1wbGl0dWRlVHJhY2tpbmciXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvaG9va3MvQ2hhdFRvZ2dsZUFuYWx5dGljcy91c2VDaGF0VG9nZ2xlQW5hbHl0aWNzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZVNldEF0b20gfSBmcm9tICdqb3RhaSc7XG5pbXBvcnQgeyBjaGF0T25Ub2dnbGVBdG9tIH0gZnJvbSAnc3JjL2F0b21zL2NoYXQvY2hhdFN0YXRlJztcbmltcG9ydCB7IENoYXRFbGVtZW50RGlzcGxheUxvY2F0aW9uIH0gZnJvbSAnc3JjL2FwcGxpY2F0aW9uL21vZGVscy9jaGF0RWxlbWVudERpc3BsYXlMb2NhdGlvbic7XG5pbXBvcnQgeyB1c2VBbXBsaXR1ZGVUcmFja2luZyB9IGZyb20gJy4uL0FtcGxpdHVkZU9wZXJhdGlvbnMnO1xuXG5leHBvcnQgY29uc3QgdXNlQ2hhdFRvZ2dsZUFuYWx5dGljcyA9ICgpID0+IHtcbiAgY29uc3Qgc2V0Q2hhdE9uVG9nZ2xlID0gdXNlU2V0QXRvbShjaGF0T25Ub2dnbGVBdG9tKTtcbiAgY29uc3QgeyB0cmFjayB9ID0gdXNlQW1wbGl0dWRlVHJhY2tpbmcoKTtcblxuICBjb25zdCB0b2dnbGVDaGF0ID0gKHRyaWdnZXJMb2NhdGlvbj86IENoYXRFbGVtZW50RGlzcGxheUxvY2F0aW9uKSA9PiB7XG4gICAgc2V0Q2hhdE9uVG9nZ2xlKHRyaWdnZXJMb2NhdGlvbiwgdHJhY2spO1xuICB9O1xuXG4gIHJldHVybiB7IHRvZ2dsZUNoYXQgfTtcbn07XG4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFLQSxNQUFhLCtCQUErQjtDQUMxQyxNQUFNLHdDQUE2QkEsbUNBQWlCO0NBQ3BELE1BQU0sRUFBRSxVQUFVQyxxREFBc0I7Q0FFeEMsTUFBTSxjQUFjLG9CQUFpRDtBQUNuRSxrQkFBZ0IsaUJBQWlCLE1BQU07O0FBR3pDLFFBQU8sRUFBRSxZQUFZIn0=
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ChatElementDisplayLocation } from "../../application/models/chatElementDisplayLocation.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.d.ts
|
|
4
|
-
declare const useChatToggleAnalytics: () => {
|
|
5
|
-
toggleChat: (triggerLocation?: ChatElementDisplayLocation) => void;
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { useChatToggleAnalytics };
|
|
9
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlQ2hhdFRvZ2dsZUFuYWx5dGljcy5kLmN0cyIsIm5hbWVzIjpbXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvaG9va3MvQ2hhdFRvZ2dsZUFuYWx5dGljcy91c2VDaGF0VG9nZ2xlQW5hbHl0aWNzLmQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ2hhdEVsZW1lbnREaXNwbGF5TG9jYXRpb24gfSBmcm9tICdzcmMvYXBwbGljYXRpb24vbW9kZWxzL2NoYXRFbGVtZW50RGlzcGxheUxvY2F0aW9uJztcbmV4cG9ydCBkZWNsYXJlIGNvbnN0IHVzZUNoYXRUb2dnbGVBbmFseXRpY3M6ICgpID0+IHtcbiAgICB0b2dnbGVDaGF0OiAodHJpZ2dlckxvY2F0aW9uPzogQ2hhdEVsZW1lbnREaXNwbGF5TG9jYXRpb24pID0+IHZvaWQ7XG59O1xuIl0sIm1hcHBpbmdzIjoiOzs7QUFDQSxJQUFXLHlCQUF5QixDQUFDLFdBQVcsMkJBQUcifQ==
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ChatElementDisplayLocation } from "../../application/models/chatElementDisplayLocation.js";
|
|
2
|
-
|
|
3
|
-
//#region src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.d.ts
|
|
4
|
-
declare const useChatToggleAnalytics: () => {
|
|
5
|
-
toggleChat: (triggerLocation?: ChatElementDisplayLocation) => void;
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { useChatToggleAnalytics };
|
|
9
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlQ2hhdFRvZ2dsZUFuYWx5dGljcy5kLnRzIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ob29rcy9DaGF0VG9nZ2xlQW5hbHl0aWNzL3VzZUNoYXRUb2dnbGVBbmFseXRpY3MuZC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDaGF0RWxlbWVudERpc3BsYXlMb2NhdGlvbiB9IGZyb20gJ3NyYy9hcHBsaWNhdGlvbi9tb2RlbHMvY2hhdEVsZW1lbnREaXNwbGF5TG9jYXRpb24nO1xuZXhwb3J0IGRlY2xhcmUgY29uc3QgdXNlQ2hhdFRvZ2dsZUFuYWx5dGljczogKCkgPT4ge1xuICAgIHRvZ2dsZUNoYXQ6ICh0cmlnZ2VyTG9jYXRpb24/OiBDaGF0RWxlbWVudERpc3BsYXlMb2NhdGlvbikgPT4gdm9pZDtcbn07XG4iXSwibWFwcGluZ3MiOiI7OztBQUNBLElBQVcseUJBQXlCLENBQUMsV0FBVywyQkFBRyJ9
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { chatOnToggleAtom } from "../../atoms/chat/chatState.js";
|
|
2
|
-
import { useAmplitudeTracking } from "../AmplitudeOperations/useAmplitudeOperations.js";
|
|
3
|
-
import "../AmplitudeOperations/index.js";
|
|
4
|
-
import { useSetAtom } from "jotai";
|
|
5
|
-
|
|
6
|
-
//#region src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.ts
|
|
7
|
-
const useChatToggleAnalytics = () => {
|
|
8
|
-
const setChatOnToggle = useSetAtom(chatOnToggleAtom);
|
|
9
|
-
const { track } = useAmplitudeTracking();
|
|
10
|
-
const toggleChat = (triggerLocation) => {
|
|
11
|
-
setChatOnToggle(triggerLocation, track);
|
|
12
|
-
};
|
|
13
|
-
return { toggleChat };
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { useChatToggleAnalytics };
|
|
18
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlQ2hhdFRvZ2dsZUFuYWx5dGljcy5qcyIsIm5hbWVzIjpbXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvaG9va3MvQ2hhdFRvZ2dsZUFuYWx5dGljcy91c2VDaGF0VG9nZ2xlQW5hbHl0aWNzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZVNldEF0b20gfSBmcm9tICdqb3RhaSc7XG5pbXBvcnQgeyBjaGF0T25Ub2dnbGVBdG9tIH0gZnJvbSAnc3JjL2F0b21zL2NoYXQvY2hhdFN0YXRlJztcbmltcG9ydCB7IENoYXRFbGVtZW50RGlzcGxheUxvY2F0aW9uIH0gZnJvbSAnc3JjL2FwcGxpY2F0aW9uL21vZGVscy9jaGF0RWxlbWVudERpc3BsYXlMb2NhdGlvbic7XG5pbXBvcnQgeyB1c2VBbXBsaXR1ZGVUcmFja2luZyB9IGZyb20gJy4uL0FtcGxpdHVkZU9wZXJhdGlvbnMnO1xuXG5leHBvcnQgY29uc3QgdXNlQ2hhdFRvZ2dsZUFuYWx5dGljcyA9ICgpID0+IHtcbiAgY29uc3Qgc2V0Q2hhdE9uVG9nZ2xlID0gdXNlU2V0QXRvbShjaGF0T25Ub2dnbGVBdG9tKTtcbiAgY29uc3QgeyB0cmFjayB9ID0gdXNlQW1wbGl0dWRlVHJhY2tpbmcoKTtcblxuICBjb25zdCB0b2dnbGVDaGF0ID0gKHRyaWdnZXJMb2NhdGlvbj86IENoYXRFbGVtZW50RGlzcGxheUxvY2F0aW9uKSA9PiB7XG4gICAgc2V0Q2hhdE9uVG9nZ2xlKHRyaWdnZXJMb2NhdGlvbiwgdHJhY2spO1xuICB9O1xuXG4gIHJldHVybiB7IHRvZ2dsZUNoYXQgfTtcbn07XG4iXSwibWFwcGluZ3MiOiI7Ozs7OztBQUtBLE1BQWEsK0JBQStCO0NBQzFDLE1BQU0sa0JBQWtCLFdBQVcsaUJBQWlCO0NBQ3BELE1BQU0sRUFBRSxVQUFVLHNCQUFzQjtDQUV4QyxNQUFNLGNBQWMsb0JBQWlEO0FBQ25FLGtCQUFnQixpQkFBaUIsTUFBTTs7QUFHekMsUUFBTyxFQUFFLFlBQVkifQ==
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { getAtomStore } from 'src/atoms/atomStore/atomStore';
|
|
2
|
-
import { cdnUrlAtom } from 'src/atoms/envive/enviveConfig';
|
|
3
|
-
|
|
4
|
-
export const getCdnAssetURL = (assetName: string, orgShortName: string): string => {
|
|
5
|
-
const atomStore = getAtomStore();
|
|
6
|
-
const cdnUrl = atomStore.get(cdnUrlAtom) || 'https://cdn.spiffy.ai/other';
|
|
7
|
-
return `${cdnUrl}/assets/${orgShortName}/${assetName}`;
|
|
8
|
-
};
|
package/src/config/divIds.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// TODO turn this into an enum
|
|
2
|
-
export const SPIFFY_ROOT_ID = 'spiffy-ai-root';
|
|
3
|
-
export const CONTAINER_ID = 'spiffy-ai-container';
|
|
4
|
-
|
|
5
|
-
export const FLOATING_BUTTON_ID = 'spiffy-ai-floating-button';
|
|
6
|
-
export const CHAT_PREVIEW_CONTAINER_ID = 'spiffy-ai-chat-preview';
|
|
7
|
-
export const GLOBAL_SEARCH_ENTRYPOINT_ID = 'spiffy-ai-global-search-entrypoint';
|
|
8
|
-
export const SEARCH_RESULTS_ENTRYPOINT_ID = 'spiffy-ai-search-results-entrypoint';
|
|
9
|
-
export const SEARCH_RESULTS_NO_OP_ID = 'spiffy-ai-search-results-no-op-entrypoint';
|
|
10
|
-
export const SEARCH_OVERLAY_ENTRYPOINT_ID = 'spiffy-ai-search-overlay-entrypoint';
|
|
11
|
-
export const SEARCH_OVERLAY_PORTAL_ID = 'spiffy-ai-search-overlay-portal'; // The inner div the overlay portal will render into
|
|
12
|
-
export const HOMEPAGE_DESKTOP_GLOBAL_SEARCH_ENTRYPOINT_ID =
|
|
13
|
-
'spiffy-ai-global-search-entrypoint-desktop-homepage';
|
|
14
|
-
export const HOMEPAGE_TABLET_GLOBAL_SEARCH_ENTRYPOINT_ID =
|
|
15
|
-
'spiffy-ai-global-search-entrypoint-tablet-homepage';
|
|
16
|
-
export const HOMEPAGE_MOBILE_GLOBAL_SEARCH_ENTRYPOINT_ID =
|
|
17
|
-
'spiffy-ai-global-search-entrypoint-mobile-homepage';
|
|
18
|
-
export const MOBILE_GLOBAL_SEARCH_ENTRYPOINT_ID = 'spiffy-ai-global-search-entrypoint-mobile';
|
|
19
|
-
export const MOBILE_ICON_ONLY_GLOBAL_SEARCH_ENTRYPOINT_ID =
|
|
20
|
-
'spiffy-ai-global-search-entrypoint-mobile-icon-only';
|
|
21
|
-
export const TABLET_GLOBAL_SEARCH_ENTYPOINT_ID = 'spiffy-ai-global-search-entrypoint-tablet';
|
|
22
|
-
export const BOTTOM_REVIEWS_BAR_ID = 'spiffy-bottom-reviews-bar-id';
|
|
23
|
-
export const TOP_SUGGESTION_BAR_PDP_ID = 'spiffy-top-suggestion-bar-id';
|
|
24
|
-
|
|
25
|
-
export const TOP_PLP_IMAGE_BANNER_ID = 'spiffy-top-plp-image-banner-id';
|
|
26
|
-
export const BOTTOM_PLP_IMAGE_BANNER_ID = 'spiffy-bottom-plp-image-banner-id';
|
|
27
|
-
export const PROMPT_CARD_ID = 'spiffy-ai-prompt-card';
|
|
28
|
-
|
|
29
|
-
export const CONVERSATIONAL_SEARCH_ENTRYPOINT_ID = 'spiffy-ai-conversational-search-entrypoint';
|
|
30
|
-
export const CONVERSATIONAL_SEARCH_INPUT_ID = 'spiffy-ai-conversational-search-input';
|
|
31
|
-
export const CONVERSATIONAL_SEARCH_MODAL_ID = 'spiffy-ai-conversational-search-modal';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const SOCIAL_PROOF_CUSTOMER_COUNT_MESSAGE_TESTID =
|
|
2
|
-
'spiffy-social-proof-customer-count-message';
|
|
3
|
-
export const SOCIAL_PROOF_CUSTOMER_COUNT_BUTTON_TESTID =
|
|
4
|
-
'spiffy-social-proof-customer-count-button';
|
|
5
|
-
export const SOCIAL_PROOF_PDP_CONTENTS_TESTID = 'spiffy-social-proof-pdp-contents';
|
|
6
|
-
export const SOCIAL_PROOF_PLP_CONTENTS_TESTID = 'spiffy-social-proof-plp-contents';
|
|
7
|
-
export const SOCIAL_PROOF_SUGGESTION_FOOTER_TESTID = 'spiffy-social-proof-suggestion-footer';
|
|
8
|
-
export const SOCIAL_PROOF_WIDGET_TESTID = 'spiffy-social-proof-widget';
|
|
9
|
-
export const SOCIAL_PROOF_WIDGET_HEADER_TESTID = 'spiffy-social-proof-widget-header';
|
|
10
|
-
|
|
11
|
-
// used in spanx config
|
|
12
|
-
export const TOP_IMAGE_BANNER_PLP_TESTID = 'spiffy-top-image-banner-plp';
|
|
13
|
-
export const BOTTOM_IMAGE_BANNER_PLP_TESTID = 'spiffy-bottom-image-banner-plp';
|
|
@@ -1,12 +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
|
-
|
|
10
|
-
// used in spanx config
|
|
11
|
-
export const CHAT_PREVIEW_PLP_TESTID = 'spiffy-chat-preview-plp';
|
|
12
|
-
export const CHAT_PREVIEW_PDP_TESTID = 'spiffy-chat-preview-pdp';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const CHAT_FEEDBACK_BUTTON_TESTID = 'chat-feedback-button';
|
|
2
|
-
export const REPORT_ISSUE_CONTAINER_TESTID = 'report-issue-container';
|
|
3
|
-
|
|
4
|
-
export const REPORT_ISSUE_NAME_FORM_CONTROL_TESTID = 'report-issue-name-form-control';
|
|
5
|
-
export const REPORT_ISSUE_NAME_INPUT_TESTID = 'report-issue-name-input';
|
|
6
|
-
|
|
7
|
-
export const REPORT_ISSUE_DESCRIPTION_FORM_CONTROL_TESTID = 'report-issue-description-form-control';
|
|
8
|
-
export const REPORT_ISSUE_DESCRIPTION_INPUT_TESTID = 'report-issue-description-input';
|
|
9
|
-
|
|
10
|
-
export const REPORT_ISSUE_CORRECTED_MESSAGE_FORM_CONTROL_TESTID =
|
|
11
|
-
'report-issue-corrected-message-form-control';
|
|
12
|
-
export const REPORT_ISSUE_CORRECTED_MESSAGE_INPUT_TESTID = 'report-issue-corrected-message-input';
|
|
13
|
-
|
|
14
|
-
export const REPORT_ISSUE_SUGGESTED_RESPONSES_FORM_CONTROL_TESTID =
|
|
15
|
-
'report-issue-suggested-responses-form-control';
|
|
16
|
-
export const REPORT_ISSUE_SUGGESTED_RESPONSES_INPUT_TESTID =
|
|
17
|
-
'report-issue-suggested-responses-input';
|
|
18
|
-
|
|
19
|
-
export const REPORT_ISSUE_SEND_FEEDBACK_BUTTON_TESTID = 'report-issue-send-feedback-button';
|
|
20
|
-
export const REPORT_ISSUE_TURNS_FORM_CONTROL_TESTID = 'report-issue-turns-form-control';
|
|
21
|
-
export const REPORT_ISSUE_CANCEL_BUTTON_TESTID = 'report-issue-cancel-button';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const SPIFFY_SOCIAL_PROOF_SUGGESTION_BUTTON_CLASS = 'spiffy-social-proof-suggestion-button';
|
|
2
|
-
export const SPIFFY_SOCIAL_PROOF_SUGGESTION_BUTTON_TEXT_CLASS =
|
|
3
|
-
'spiffy-social-proof-suggestion-button-text';
|
|
4
|
-
export const SPIFFY_SOCIAL_PROOF_SUGGESTION_BUTTON_CONTAINER_CLASS =
|
|
5
|
-
'spiffy-social-proof-suggestion-button-container';
|
|
6
|
-
export const SPIFFY_SOCIAL_PROOF_CUSTOMER_COUNT_CLASS = 'spiffy-social-proof-customer-count';
|
|
7
|
-
export const SPIFFY_SOCIAL_PROOF_CONTENT_CONTAINER_CLASS = 'spiffy-social-proof-content-container';
|
|
8
|
-
export const SPIFFY_SOCIAL_PROOF_CONTENT_BUTTON_CLASS = 'spiffy-social-proof-content-button';
|
|
9
|
-
export const SPIFFY_SOCIAL_PROOF_CONTENT_IMAGE_CLASS = 'spiffy-social-proof-content-image';
|
|
10
|
-
export const SPIFFY_SOCIAL_PROOF_SUGGESTION_FOOTER_TITLE_CLASS =
|
|
11
|
-
'spiffy-social-proof-suggestion-footer-title';
|
|
12
|
-
export const SPIFFY_SOCIAL_PROOF_HEADER = 'spiffy-social-proof-header';
|