@envive-ai/react-hooks 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +2 -0
- package/dist/_virtual/rolldown_runtime.js +29 -0
- package/dist/application/commerce-api.cjs +15 -5
- package/dist/application/commerce-api.js +14 -4
- package/dist/application/models/api/nextMessageRequest.d.cts +3 -1
- package/dist/application/models/api/nextMessageRequest.d.ts +3 -1
- 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 +18 -0
- package/dist/application/models/chatElementDisplayLocationV3.d.cts +15 -0
- package/dist/application/models/chatElementDisplayLocationV3.d.ts +15 -0
- package/dist/application/models/chatElementDisplayLocationV3.js +17 -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 +2 -1
- package/dist/application/models/featureGates.d.cts +2 -1
- package/dist/application/models/featureGates.d.ts +2 -1
- package/dist/application/models/featureGates.js +2 -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/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/models/variantInfo/variantInfo.cjs +4 -1
- package/dist/application/models/variantInfo/variantInfo.d.cts +4 -1
- package/dist/application/models/variantInfo/variantInfo.d.ts +4 -1
- package/dist/application/models/variantInfo/variantInfo.js +4 -1
- package/dist/application/utils/analyticsUtils.cjs +5 -4
- package/dist/application/utils/analyticsUtils.d.cts +1 -1
- package/dist/application/utils/analyticsUtils.d.ts +1 -1
- package/dist/application/utils/analyticsUtils.js +3 -2
- package/dist/application/utils/elementObserver.cjs +1 -1
- package/dist/application/utils/elementObserver.d.cts +2 -2
- package/dist/application/utils/elementObserver.d.ts +2 -2
- 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 +13 -1
- package/dist/atoms/app/index.d.cts +4 -3
- package/dist/atoms/app/index.d.ts +9 -8
- package/dist/atoms/app/index.js +13 -4
- package/dist/atoms/app/variant.cjs +6 -2
- package/dist/atoms/app/variant.d.cts +76 -5
- package/dist/atoms/app/variant.d.ts +76 -5
- 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 +4 -4
- package/dist/atoms/chat/index.d.ts +3 -3
- 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/messageQueue.cjs +1 -35
- package/dist/atoms/chat/messageQueue.js +2 -34
- 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 -2
- package/dist/atoms/envive/enviveConfig.js +5 -2
- package/dist/atoms/globalSearch/globalSearch.cjs +1 -3
- package/dist/atoms/globalSearch/globalSearch.d.cts +7 -10
- package/dist/atoms/globalSearch/globalSearch.d.ts +7 -10
- package/dist/atoms/globalSearch/globalSearch.js +2 -3
- package/dist/atoms/globalSearch/index.cjs +0 -1
- package/dist/atoms/globalSearch/index.d.cts +2 -2
- package/dist/atoms/globalSearch/index.d.ts +2 -2
- package/dist/atoms/globalSearch/index.js +2 -2
- 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/searchAPI.d.cts +15 -14
- package/dist/atoms/search/searchAPI.d.ts +15 -14
- package/dist/atoms/search/utils.d.cts +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 +41 -228
- package/dist/contexts/amplitudeContext/amplitudeContext.d.cts +4 -39
- package/dist/contexts/amplitudeContext/amplitudeContext.d.ts +4 -39
- package/dist/contexts/amplitudeContext/amplitudeContext.js +45 -231
- 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 +73 -18
- package/dist/contexts/enviveContext/enviveContext.d.cts +9 -1
- package/dist/contexts/enviveContext/enviveContext.d.ts +9 -1
- package/dist/contexts/enviveContext/enviveContext.js +75 -20
- package/dist/contexts/enviveCssContext/enviveCssContext.cjs +96 -24
- package/dist/contexts/enviveCssContext/enviveCssContext.js +96 -24
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.cjs +5 -7
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.cts +2 -2
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -2
- package/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.js +5 -7
- package/dist/contexts/graphqlContext/graphqlContext.cjs +70 -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 +70 -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 +208 -0
- package/dist/contexts/graphqlContext/mockV3Config.js +207 -0
- package/dist/contexts/hardcopyContext/hardcopyContext.cjs +169 -0
- package/dist/contexts/hardcopyContext/hardcopyContext.d.cts +24 -0
- package/dist/contexts/hardcopyContext/hardcopyContext.d.ts +24 -0
- package/dist/contexts/hardcopyContext/hardcopyContext.js +167 -0
- package/dist/contexts/hardcopyContext/index.cjs +4 -0
- package/dist/contexts/hardcopyContext/index.d.cts +2 -0
- package/dist/contexts/hardcopyContext/index.d.ts +2 -0
- package/dist/contexts/hardcopyContext/index.js +3 -0
- package/dist/contexts/newOrgConfigContext/newOrgConfigContext.cjs +7 -8
- package/dist/contexts/newOrgConfigContext/newOrgConfigContext.js +8 -9
- package/dist/contexts/pageContext/index.cjs +6 -0
- package/dist/contexts/pageContext/index.d.cts +3 -0
- package/dist/contexts/pageContext/index.d.ts +3 -0
- package/dist/contexts/pageContext/index.js +4 -0
- package/dist/contexts/pageContext/mapping.cjs +29 -0
- package/dist/contexts/pageContext/mapping.d.cts +8 -0
- package/dist/contexts/pageContext/mapping.d.ts +8 -0
- package/dist/contexts/pageContext/mapping.js +29 -0
- package/dist/contexts/pageContext/pageContext.cjs +86 -0
- package/dist/contexts/pageContext/pageContext.d.cts +14 -0
- package/dist/contexts/pageContext/pageContext.d.ts +14 -0
- package/dist/contexts/pageContext/pageContext.js +84 -0
- package/dist/contexts/pageContext/types.cjs +0 -0
- package/dist/contexts/pageContext/types.d.cts +31 -0
- package/dist/contexts/pageContext/types.d.ts +31 -0
- package/dist/contexts/pageContext/types.js +1 -0
- package/dist/contexts/salesAgentContext/chatAPI.cjs +48 -0
- package/dist/contexts/salesAgentContext/chatAPI.d.cts +35 -0
- package/dist/contexts/salesAgentContext/chatAPI.d.ts +35 -0
- package/dist/contexts/salesAgentContext/chatAPI.js +47 -0
- package/dist/contexts/salesAgentContext/index.cjs +20 -0
- package/dist/contexts/salesAgentContext/index.d.cts +4 -0
- package/dist/contexts/salesAgentContext/index.d.ts +4 -0
- package/dist/contexts/salesAgentContext/index.js +5 -0
- package/dist/contexts/salesAgentContext/salesAgentContext.cjs +130 -0
- package/dist/contexts/salesAgentContext/salesAgentContext.d.cts +22 -0
- package/dist/contexts/salesAgentContext/salesAgentContext.d.ts +22 -0
- package/dist/contexts/salesAgentContext/salesAgentContext.js +128 -0
- package/dist/contexts/salesAgentContext/salesAgentService.cjs +135 -0
- package/dist/contexts/salesAgentContext/salesAgentService.js +134 -0
- package/dist/contexts/salesAgentContext/statusCodeError.cjs +14 -0
- package/dist/contexts/salesAgentContext/statusCodeError.js +13 -0
- package/dist/contexts/systemSettingsContext/systemSettingsContext.d.cts +2 -2
- package/dist/contexts/types.cjs +2 -3
- package/dist/contexts/types.d.cts +12 -8
- package/dist/contexts/types.d.ts +12 -8
- package/dist/contexts/types.js +2 -3
- package/dist/contexts/typesV3.cjs +125 -0
- package/dist/contexts/typesV3.d.cts +246 -0
- package/dist/contexts/typesV3.d.ts +246 -0
- package/dist/contexts/typesV3.js +113 -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/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.js +3 -2
- package/dist/hooks/ChatToggleAnalytics/useChatToggleAnalytics.cjs +3 -3
- 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 +30 -21
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.d.cts +5 -4
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.d.ts +5 -4
- package/dist/hooks/GraphQLConfig/useGraphQLConfig.js +30 -21
- package/dist/hooks/ImageResolver/useImageResolver.cjs +1 -1
- package/dist/hooks/ImageResolver/useImageResolver.js +1 -1
- package/dist/hooks/Search/useSearch.cjs +10 -12
- package/dist/hooks/Search/useSearch.d.cts +1 -3
- package/dist/hooks/Search/useSearch.d.ts +1 -3
- package/dist/hooks/Search/useSearch.js +7 -9
- 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.ts +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/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/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/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/packages/components-v3/tokens/breakpoints/breakpoints.cjs +25 -0
- package/dist/packages/components-v3/dist/packages/components-v3/tokens/breakpoints/breakpoints.js +23 -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/_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/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 +40 -4
- 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 +12 -0
- package/src/application/models/colorsConfigV3.ts +26 -0
- package/src/application/models/featureGates.ts +1 -0
- package/src/application/models/frontendConfig.ts +5 -0
- package/src/application/models/frontendConfigV3.ts +10 -0
- 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 +3 -3
- package/src/atoms/app/variant.ts +5 -0
- package/src/atoms/chat/chatState.ts +10 -2
- package/src/atoms/envive/enviveConfig.ts +5 -0
- package/src/atoms/org/graphqlConfig.ts +0 -1
- package/src/atoms/widget/chatPreviewLoading.ts +36 -0
- package/src/atoms/widget/index.ts +1 -0
- package/src/contexts/amplitudeContext/__tests__/amplitudeContext.test.tsx +197 -187
- package/src/contexts/amplitudeContext/amplitudeContext.tsx +56 -334
- package/src/contexts/enviveConfigContext/enviveConfigContext.tsx +3 -0
- package/src/contexts/enviveContext/enviveContext.tsx +101 -27
- package/src/contexts/enviveCssContext/enviveCssContext.tsx +121 -22
- package/src/contexts/featureFlagServiceContext/featureFlagServiceContext.tsx +12 -11
- package/src/contexts/graphqlContext/graphqlContext.tsx +131 -13
- package/src/contexts/graphqlContext/mockV3Config.ts +209 -0
- package/src/contexts/hardcopyContext/hardcopyContext.tsx +136 -14
- 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 +24 -8
- package/src/contexts/pageContext/mapping.ts +4 -0
- package/src/contexts/pageContext/pageContext.tsx +41 -12
- package/src/contexts/pageContext/types.ts +4 -0
- package/src/contexts/salesAgentContext/chatAPI.ts +1 -0
- package/src/contexts/salesAgentContext/salesAgentContext.tsx +94 -42
- package/src/contexts/salesAgentContext/salesAgentService.ts +78 -3
- 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 +316 -0
- package/src/contexts/uiConfigContext/__tests__/uiConfigContext.test.tsx +321 -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/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/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/contexts/chatContext/chatContext.cjs +0 -306
- package/dist/contexts/chatContext/chatContext.d.cts +0 -15
- package/dist/contexts/chatContext/chatContext.d.ts +0 -15
- package/dist/contexts/chatContext/chatContext.js +0 -304
- package/dist/contexts/chatContext/index.cjs +0 -4
- package/dist/contexts/chatContext/index.d.cts +0 -2
- package/dist/contexts/chatContext/index.d.ts +0 -2
- package/dist/contexts/chatContext/index.js +0 -3
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { FrontendConfigV3 } from 'src/application/models/frontendConfigV3';
|
|
2
3
|
import { useNewOrgConfig } from 'src/hooks/NewOrgConfig';
|
|
4
|
+
import { CamelCasedPropertiesDeep } from 'src/application/models/utilityTypes';
|
|
5
|
+
import { ColorMapping } from '../types';
|
|
6
|
+
import {
|
|
7
|
+
AspectRatioCSSVar,
|
|
8
|
+
BorderRadiusCSSVar,
|
|
9
|
+
ButtonColorsVars,
|
|
10
|
+
ColorsNamesVars,
|
|
11
|
+
ConfigVersionEnum,
|
|
12
|
+
FontFamilyCSSVar,
|
|
13
|
+
FontSizeCSSVar,
|
|
14
|
+
FontWeightCSSVar,
|
|
15
|
+
LetterSpacingCSSVar,
|
|
16
|
+
LineHeightCSSVar,
|
|
17
|
+
ThemeCSSVar,
|
|
18
|
+
} from '../typesV3';
|
|
3
19
|
|
|
4
20
|
interface EnviveCssProviderProps {
|
|
5
21
|
children: ReactNode;
|
|
@@ -7,37 +23,120 @@ interface EnviveCssProviderProps {
|
|
|
7
23
|
|
|
8
24
|
export const EnviveCssProvider: React.FC<EnviveCssProviderProps> = ({ children }) => {
|
|
9
25
|
const { colorsConfig, frontendConfig, loading } = useNewOrgConfig();
|
|
26
|
+
|
|
27
|
+
const configVersion = frontendConfig?.uiConfigs?.version;
|
|
28
|
+
|
|
10
29
|
let merchantThemeCss = `* {}`;
|
|
11
|
-
if (colorsConfig && !loading) {
|
|
30
|
+
if (colorsConfig && !loading && configVersion !== ConfigVersionEnum.V3) {
|
|
31
|
+
const colorConfigV2 = colorsConfig as CamelCasedPropertiesDeep<ColorMapping>;
|
|
12
32
|
merchantThemeCss = `
|
|
13
33
|
* {
|
|
14
|
-
--spiffy-colors-text-primary: ${
|
|
15
|
-
--spiffy-colors-text-secondary: ${
|
|
16
|
-
--spiffy-colors-text-accent: ${
|
|
17
|
-
--spiffy-colors-text-link: ${
|
|
18
|
-
--spiffy-colors-text-light: ${
|
|
19
|
-
--spiffy-colors-background-primary: ${
|
|
20
|
-
--spiffy-colors-background-secondary: ${
|
|
21
|
-
--spiffy-colors-background-secondary-dark: ${
|
|
22
|
-
--spiffy-colors-background-tertiary: ${
|
|
23
|
-
--spiffy-colors-background-dark: ${
|
|
24
|
-
--spiffy-colors-background-light: ${
|
|
25
|
-
--spiffy-colors-background-saturated: ${
|
|
26
|
-
--spiffy-colors-border-light: ${
|
|
27
|
-
--spiffy-colors-border-medium: ${
|
|
28
|
-
--spiffy-colors-border-dark: ${
|
|
29
|
-
--spiffy-colors-border-outline: ${
|
|
30
|
-
--spiffy-colors-accent-primary: ${
|
|
31
|
-
--spiffy-colors-accent-secondary: ${
|
|
34
|
+
--spiffy-colors-text-primary: ${colorConfigV2.textPrimary};
|
|
35
|
+
--spiffy-colors-text-secondary: ${colorConfigV2.textSecondary};
|
|
36
|
+
--spiffy-colors-text-accent: ${colorConfigV2.textAccent};
|
|
37
|
+
--spiffy-colors-text-link: ${colorConfigV2.textLink};
|
|
38
|
+
--spiffy-colors-text-light: ${colorConfigV2.textLight};
|
|
39
|
+
--spiffy-colors-background-primary: ${colorConfigV2.backgroundPrimary};
|
|
40
|
+
--spiffy-colors-background-secondary: ${colorConfigV2.backgroundSecondary};
|
|
41
|
+
--spiffy-colors-background-secondary-dark: ${colorConfigV2.backgroundSecondaryDark};
|
|
42
|
+
--spiffy-colors-background-tertiary: ${colorConfigV2.backgroundTertiary};
|
|
43
|
+
--spiffy-colors-background-dark: ${colorConfigV2.backgroundDark};
|
|
44
|
+
--spiffy-colors-background-light: ${colorConfigV2.backgroundLight};
|
|
45
|
+
--spiffy-colors-background-saturated: ${colorConfigV2.backgroundSaturated};
|
|
46
|
+
--spiffy-colors-border-light: ${colorConfigV2.borderLight};
|
|
47
|
+
--spiffy-colors-border-medium: ${colorConfigV2.borderMedium};
|
|
48
|
+
--spiffy-colors-border-dark: ${colorConfigV2.borderDark};
|
|
49
|
+
--spiffy-colors-border-outline: ${colorConfigV2.borderOutline};
|
|
50
|
+
--spiffy-colors-accent-primary: ${colorConfigV2.accentPrimary};
|
|
51
|
+
--spiffy-colors-accent-secondary: ${colorConfigV2.accentSecondary};
|
|
52
|
+
}`;
|
|
53
|
+
} else if (colorsConfig && frontendConfig && !loading && configVersion === ConfigVersionEnum.V3) {
|
|
54
|
+
const configV3 = frontendConfig as FrontendConfigV3;
|
|
55
|
+
merchantThemeCss = `
|
|
56
|
+
* {
|
|
57
|
+
--${ColorsNamesVars.TextPrimary}: ${colorsConfig.textPrimary};
|
|
58
|
+
--${ColorsNamesVars.TextSecondary}: ${colorsConfig.textSecondary};
|
|
59
|
+
--${ColorsNamesVars.TextAccent}: ${colorsConfig.textAccent};
|
|
60
|
+
--${ColorsNamesVars.TextLink}: ${colorsConfig.textLink};
|
|
61
|
+
--${ColorsNamesVars.TextLight}: ${colorsConfig.textLight};
|
|
62
|
+
--${ColorsNamesVars.BackgroundPrimary}: ${colorsConfig.backgroundPrimary};
|
|
63
|
+
--${ColorsNamesVars.BackgroundSecondary}: ${colorsConfig.backgroundSecondary};
|
|
64
|
+
--${ColorsNamesVars.BackgroundTertiary}: ${colorsConfig.backgroundTertiary};
|
|
65
|
+
--${ColorsNamesVars.BackgroundDark}: ${colorsConfig.backgroundDark};
|
|
66
|
+
--${ColorsNamesVars.BackgroundLight}: ${colorsConfig.backgroundLight};
|
|
67
|
+
--${ColorsNamesVars.BorderLight}: ${colorsConfig.borderLight};
|
|
68
|
+
--${ColorsNamesVars.BorderMedium}: ${colorsConfig.borderMedium};
|
|
69
|
+
--${ColorsNamesVars.BorderDark}: ${colorsConfig.borderDark};
|
|
70
|
+
--${ColorsNamesVars.AccentPrimary}: ${colorsConfig.accentPrimary};
|
|
71
|
+
--${ColorsNamesVars.AccentSecondary}: ${colorsConfig.accentSecondary};
|
|
72
|
+
|
|
73
|
+
--${ButtonColorsVars.LightButtonBackgroundColor}: ${configV3.uiConfigs?.lookAndFeel?.buttonColors?.lightButtonBackgroundColor};
|
|
74
|
+
--${ButtonColorsVars.LightButtonIconColor}: ${configV3.uiConfigs?.lookAndFeel?.buttonColors?.lightButtonIconColor};
|
|
75
|
+
--${ButtonColorsVars.DarkButtonBackgroundColor}: ${configV3.uiConfigs?.lookAndFeel?.buttonColors?.darkButtonBackgroundColor};
|
|
76
|
+
--${ButtonColorsVars.DarkButtonIconColor}: ${configV3.uiConfigs?.lookAndFeel?.buttonColors?.darkButtonIconColor};
|
|
77
|
+
|
|
78
|
+
--${FontFamilyCSSVar.Title}: ${configV3.uiConfigs?.lookAndFeel?.typography?.titleFontFamily};
|
|
79
|
+
--${FontFamilyCSSVar.Header}: ${configV3.uiConfigs?.lookAndFeel?.typography?.headerFontFamily};
|
|
80
|
+
--${FontFamilyCSSVar.Body}: ${configV3.uiConfigs?.lookAndFeel?.typography?.bodyFontFamily};
|
|
81
|
+
|
|
82
|
+
--${FontSizeCSSVar.T1}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.t1};
|
|
83
|
+
--${FontSizeCSSVar.T2}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.t2};
|
|
84
|
+
--${FontSizeCSSVar.T3}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.t3};
|
|
85
|
+
--${FontSizeCSSVar.H1}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.h1};
|
|
86
|
+
--${FontSizeCSSVar.H2}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.h2};
|
|
87
|
+
--${FontSizeCSSVar.H3}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.h3};
|
|
88
|
+
--${FontSizeCSSVar.B1}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.b1};
|
|
89
|
+
--${FontSizeCSSVar.B2}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.b2};
|
|
90
|
+
--${FontSizeCSSVar.B3}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.b3};
|
|
91
|
+
--${FontSizeCSSVar.B4}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.b4};
|
|
92
|
+
--${FontSizeCSSVar.B5}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.b5};
|
|
93
|
+
--${FontSizeCSSVar.L1}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.l1};
|
|
94
|
+
--${FontSizeCSSVar.L2}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontSize?.l2};
|
|
95
|
+
|
|
96
|
+
--${FontWeightCSSVar.RG}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontWeight?.rg};
|
|
97
|
+
--${FontWeightCSSVar.MD}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontWeight?.md};
|
|
98
|
+
--${FontWeightCSSVar.SB}: ${configV3.uiConfigs?.lookAndFeel?.typography?.fontWeight?.sb};
|
|
99
|
+
|
|
100
|
+
--${LetterSpacingCSSVar.Tight0}: ${configV3.uiConfigs?.lookAndFeel?.typography?.letterSpacing?.['0']};
|
|
101
|
+
--${LetterSpacingCSSVar.Wide1}: ${configV3.uiConfigs?.lookAndFeel?.typography?.letterSpacing?.['wide-1']};
|
|
102
|
+
|
|
103
|
+
--${LineHeightCSSVar.LineHeight124}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[124]};
|
|
104
|
+
--${LineHeightCSSVar.LineHeight120}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[120]};
|
|
105
|
+
--${LineHeightCSSVar.LineHeight118}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[118]};
|
|
106
|
+
--${LineHeightCSSVar.LineHeight116}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[116]};
|
|
107
|
+
--${LineHeightCSSVar.LineHeight114}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[114]};
|
|
108
|
+
--${LineHeightCSSVar.LineHeight148}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[148]};
|
|
109
|
+
--${LineHeightCSSVar.LineHeight140}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[140]};
|
|
110
|
+
--${LineHeightCSSVar.LineHeight128}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[128]};
|
|
111
|
+
--${LineHeightCSSVar.LineHeight130}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[130]};
|
|
112
|
+
--${LineHeightCSSVar.LineHeight133}: ${configV3.uiConfigs?.lookAndFeel?.typography?.lineHeight?.[133]};
|
|
113
|
+
|
|
114
|
+
--${ThemeCSSVar.GlobalCustom}: ${configV3.uiConfigs?.lookAndFeel?.theme};
|
|
115
|
+
|
|
116
|
+
--${AspectRatioCSSVar.GlobalCustom}: ${configV3.uiConfigs?.lookAndFeel?.imageAspectRatio};
|
|
117
|
+
|
|
118
|
+
--${BorderRadiusCSSVar.GlobalCustom}: ${configV3.uiConfigs?.lookAndFeel?.elementRadius}px;
|
|
32
119
|
}`;
|
|
33
120
|
}
|
|
34
|
-
|
|
121
|
+
|
|
122
|
+
const hasV3ConfigEdited = document.getElementById('merchant-css-config-edited') !== null;
|
|
123
|
+
|
|
35
124
|
return (
|
|
36
125
|
<>
|
|
37
126
|
{frontendConfig ? (
|
|
38
|
-
<style id="merchant-css-overrides">
|
|
127
|
+
<style id="merchant-css-overrides">
|
|
128
|
+
{frontendConfig.merchantOverrideCss ? `${frontendConfig.merchantOverrideCss}` : ''}
|
|
129
|
+
</style>
|
|
130
|
+
) : null}
|
|
131
|
+
{colorsConfig &&
|
|
132
|
+
((!hasV3ConfigEdited && configVersion === ConfigVersionEnum.V3) ||
|
|
133
|
+
configVersion !== ConfigVersionEnum.V3) ? (
|
|
134
|
+
<style
|
|
135
|
+
id={
|
|
136
|
+
configVersion === ConfigVersionEnum.V3 ? 'merchant-css-config' : 'merchant-css-colors'
|
|
137
|
+
}
|
|
138
|
+
>{`${merchantThemeCss}`}</style>
|
|
39
139
|
) : null}
|
|
40
|
-
{colorsConfig ? <style id="merchant-css-colors">{`${merchantThemeCss}`}</style> : null}
|
|
41
140
|
|
|
42
141
|
{children}
|
|
43
142
|
</>
|
|
@@ -26,13 +26,9 @@ export class FeatureFlagService {
|
|
|
26
26
|
return gateValue.value;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
gate => gate.name === FeatureGates.IsClientSessionEnabled && gate.value === true,
|
|
33
|
-
).length > 0;
|
|
34
|
-
return isEnabled;
|
|
35
|
-
};
|
|
29
|
+
// Ensure that standard overrides work as expected
|
|
30
|
+
isClientSessionEnabled = (): boolean =>
|
|
31
|
+
this.isFeatureGateEnabled(FeatureGates.IsClientSessionEnabled);
|
|
36
32
|
|
|
37
33
|
getFeatureFlags = (): Record<string, boolean> => {
|
|
38
34
|
return Object.fromEntries(
|
|
@@ -51,18 +47,23 @@ export interface FeatureFlagContextType {
|
|
|
51
47
|
const FeatureFlagServiceContext = createContext<FeatureFlagContextType | undefined>(undefined);
|
|
52
48
|
|
|
53
49
|
interface FeatureFlagServiceProviderProps {
|
|
54
|
-
|
|
50
|
+
featureFlagService: FeatureFlagService;
|
|
55
51
|
children: ReactNode;
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
export const FeatureFlagServiceProvider: React.FC<FeatureFlagServiceProviderProps> = ({
|
|
59
|
-
|
|
55
|
+
featureFlagService: inputService,
|
|
60
56
|
children,
|
|
61
57
|
}) => {
|
|
62
|
-
const
|
|
58
|
+
const contextValue = useMemo(
|
|
59
|
+
() => ({
|
|
60
|
+
featureFlagService: inputService,
|
|
61
|
+
}),
|
|
62
|
+
[inputService],
|
|
63
|
+
);
|
|
63
64
|
|
|
64
65
|
return (
|
|
65
|
-
<FeatureFlagServiceContext.Provider value={
|
|
66
|
+
<FeatureFlagServiceContext.Provider value={contextValue}>
|
|
66
67
|
{children}
|
|
67
68
|
</FeatureFlagServiceContext.Provider>
|
|
68
69
|
);
|
|
@@ -11,7 +11,17 @@ import { ColorMapping } from 'src/application/models/colorsConfig';
|
|
|
11
11
|
import { FrontendConfig } from 'src/application/models/frontendConfig';
|
|
12
12
|
import Logger from 'src/application/logging/logger';
|
|
13
13
|
import { configVersion } from 'src/types/config-versions';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
CamelCasedPropertiesDeep,
|
|
16
|
+
transformSnakeToCamel,
|
|
17
|
+
validateAndTransformMountingConfig,
|
|
18
|
+
validateAndTransformPageVariants,
|
|
19
|
+
} from 'src/application/models';
|
|
20
|
+
import { FrontendConfigV3 } from 'src/application/models/frontendConfigV3';
|
|
21
|
+
import { ColorMappingV3 } from 'src/application/models/colorsConfigV3';
|
|
22
|
+
import { mockV3ColorsConfig, mockV3FrontendConfig } from './mockV3Config';
|
|
23
|
+
import { ConfigVersionEnum, WidgetConfigV3 } from '../typesV3';
|
|
24
|
+
import { OrgPageConfig, PageVariantConfig, WidgetMountingConfig } from '../types';
|
|
15
25
|
|
|
16
26
|
interface BaseMeConfigQueryResponse {
|
|
17
27
|
me: {
|
|
@@ -28,16 +38,21 @@ interface BaseMeConfigQueryResponse {
|
|
|
28
38
|
}
|
|
29
39
|
export type ColorsConfigResponse = CamelCasedPropertiesDeep<ColorMapping>;
|
|
30
40
|
export type FrontendConfigResponse = CamelCasedPropertiesDeep<FrontendConfig>;
|
|
41
|
+
export type ColorsConfigV3Response = CamelCasedPropertiesDeep<ColorMappingV3>;
|
|
42
|
+
export type FrontendConfigV3Response = CamelCasedPropertiesDeep<FrontendConfigV3>;
|
|
31
43
|
|
|
32
44
|
export type GraphQlConfigValues = {
|
|
33
|
-
colorsConfig?: ColorsConfigResponse;
|
|
34
|
-
frontendConfig?: CamelCasedPropertiesDeep<FrontendConfig>;
|
|
45
|
+
colorsConfig?: ColorsConfigResponse | ColorsConfigV3Response;
|
|
46
|
+
frontendConfig?: CamelCasedPropertiesDeep<FrontendConfig | FrontendConfigV3>;
|
|
47
|
+
orgPageConfig?: OrgPageConfig;
|
|
35
48
|
};
|
|
36
49
|
|
|
37
50
|
interface GraphQLContextValue {
|
|
38
51
|
executeQuery: <T>(query: string, variables?: Record<string, unknown>) => Promise<T>;
|
|
39
52
|
getOrgId: () => Promise<string | undefined>;
|
|
40
53
|
getColorsAndFrontendConfig: () => Promise<GraphQlConfigValues>;
|
|
54
|
+
getV3Config: () => Promise<GraphQlConfigValues>;
|
|
55
|
+
getConfig: () => Promise<GraphQlConfigValues>;
|
|
41
56
|
isReady: boolean;
|
|
42
57
|
}
|
|
43
58
|
|
|
@@ -56,13 +71,18 @@ const colorsAndFrontendConfigQuery = () => `
|
|
|
56
71
|
|
|
57
72
|
type GraphQLProviderProps = {
|
|
58
73
|
children: ReactNode;
|
|
74
|
+
requestV3Config?: boolean;
|
|
75
|
+
mockV3ConfigToDeprecatedConfig?: boolean;
|
|
59
76
|
};
|
|
60
77
|
|
|
61
|
-
export const GraphQLProvider = ({
|
|
78
|
+
export const GraphQLProvider = ({
|
|
79
|
+
children,
|
|
80
|
+
requestV3Config = false,
|
|
81
|
+
mockV3ConfigToDeprecatedConfig = false,
|
|
82
|
+
}: GraphQLProviderProps) => {
|
|
62
83
|
const apiKey = useAtomValue(orgLevelApiKeyAtom);
|
|
63
84
|
const baseUrl = useAtomValue(baseUrlAtom);
|
|
64
|
-
|
|
65
|
-
const isReady = Boolean(apiKey && baseUrl);
|
|
85
|
+
const isReady = useMemo(() => Boolean(apiKey && baseUrl), [apiKey, baseUrl]);
|
|
66
86
|
|
|
67
87
|
const executeQuery = useCallback(
|
|
68
88
|
async (query: string, variables?: Record<string, unknown>) => {
|
|
@@ -98,6 +118,74 @@ export const GraphQLProvider = ({ children }: GraphQLProviderProps) => {
|
|
|
98
118
|
return validateGraphQLOrgId(response.me.org?.id);
|
|
99
119
|
}, [executeQuery]);
|
|
100
120
|
|
|
121
|
+
const getV3Config = useCallback(async (): Promise<GraphQlConfigValues> => {
|
|
122
|
+
try {
|
|
123
|
+
const query = await colorsAndFrontendConfigQuery();
|
|
124
|
+
if (!query) {
|
|
125
|
+
throw new Error('Colors and frontend config query is not defined');
|
|
126
|
+
}
|
|
127
|
+
const response = await executeQuery(query);
|
|
128
|
+
|
|
129
|
+
// We may update this root config location in the future
|
|
130
|
+
const v3RootConfig =
|
|
131
|
+
response.me.getProductsConfigByVersion?.frontend?.values?.ui_configs?.v_three_config;
|
|
132
|
+
|
|
133
|
+
const v3FrontendConfig = transformSnakeToCamel(v3RootConfig) as FrontendConfigV3Response;
|
|
134
|
+
|
|
135
|
+
const v3MountingConfigsArray = (transformSnakeToCamel(v3RootConfig?.mounting_configs) ??
|
|
136
|
+
[]) as unknown as { key: string; config: WidgetMountingConfig }[];
|
|
137
|
+
|
|
138
|
+
const v3MountingConfigs = v3MountingConfigsArray.reduce(
|
|
139
|
+
(acc, { key, config }) => {
|
|
140
|
+
acc[key] = validateAndTransformMountingConfig(config, key);
|
|
141
|
+
return acc;
|
|
142
|
+
},
|
|
143
|
+
{} as Record<string, WidgetMountingConfig>,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const v3widgetConfigsArray = (transformSnakeToCamel(v3RootConfig?.widget_configs) ??
|
|
147
|
+
[]) as unknown as WidgetConfigV3[];
|
|
148
|
+
const v3WidgetConfigs = Object.fromEntries(
|
|
149
|
+
v3widgetConfigsArray?.map(({ widgetConfigId, ...rest }: WidgetConfigV3) => [
|
|
150
|
+
widgetConfigId,
|
|
151
|
+
{ widgetConfigId, ...rest } as WidgetConfigV3,
|
|
152
|
+
]),
|
|
153
|
+
) as Record<string, WidgetConfigV3>;
|
|
154
|
+
const v3pageVariants = v3RootConfig?.page_variants.map(
|
|
155
|
+
validateAndTransformPageVariants,
|
|
156
|
+
) as PageVariantConfig[];
|
|
157
|
+
|
|
158
|
+
const v3ColorsConfig = transformSnakeToCamel(v3RootConfig?.colors?.values);
|
|
159
|
+
|
|
160
|
+
// If the v3 root config is not found and we are configured to return the deprecated config, we will return the mocked config
|
|
161
|
+
if (!v3RootConfig && mockV3ConfigToDeprecatedConfig) {
|
|
162
|
+
const isSemanticColors = !window.location.href.includes('globals=merchant');
|
|
163
|
+
const colorsConfig = mockV3ColorsConfig;
|
|
164
|
+
const frontendConfig = mockV3FrontendConfig;
|
|
165
|
+
return {
|
|
166
|
+
colorsConfig: isSemanticColors
|
|
167
|
+
? (colorsConfig as ColorsConfigV3Response)
|
|
168
|
+
: (v3ColorsConfig as ColorsConfigV3Response),
|
|
169
|
+
frontendConfig: frontendConfig as FrontendConfigV3Response,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
colorsConfig: v3ColorsConfig as ColorsConfigV3Response,
|
|
175
|
+
frontendConfig: v3FrontendConfig as FrontendConfigV3Response,
|
|
176
|
+
orgPageConfig: {
|
|
177
|
+
pageVariants: v3pageVariants,
|
|
178
|
+
widgetConfigs: v3WidgetConfigs,
|
|
179
|
+
mountingConfigs: v3MountingConfigs,
|
|
180
|
+
},
|
|
181
|
+
// TODO: Add widgets and other config here
|
|
182
|
+
};
|
|
183
|
+
} catch (err) {
|
|
184
|
+
Logger.logError('Error fetching graphql colors and frontend config', err);
|
|
185
|
+
return { colorsConfig: undefined, frontendConfig: undefined };
|
|
186
|
+
}
|
|
187
|
+
}, [executeQuery, mockV3ConfigToDeprecatedConfig]);
|
|
188
|
+
|
|
101
189
|
const getColorsAndFrontendConfig = useCallback(async (): Promise<GraphQlConfigValues> => {
|
|
102
190
|
try {
|
|
103
191
|
const query = await colorsAndFrontendConfigQuery();
|
|
@@ -105,13 +193,33 @@ export const GraphQLProvider = ({ children }: GraphQLProviderProps) => {
|
|
|
105
193
|
throw new Error('Colors and frontend config query is not defined');
|
|
106
194
|
}
|
|
107
195
|
const response = await executeQuery(query);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
196
|
+
if (
|
|
197
|
+
response.me.getProductsConfigByVersion?.version !== ConfigVersionEnum.V3 &&
|
|
198
|
+
!mockV3ConfigToDeprecatedConfig
|
|
199
|
+
) {
|
|
200
|
+
const colorsConfig = response.me.getProductsConfigByVersion?.colors?.values;
|
|
201
|
+
const frontendConfig = response.me.getProductsConfigByVersion?.frontend?.values;
|
|
202
|
+
const transformedColorConfig = transformSnakeToCamel(colorsConfig);
|
|
203
|
+
const transformedFrontendConfig = transformSnakeToCamel(frontendConfig);
|
|
204
|
+
return {
|
|
205
|
+
colorsConfig: transformedColorConfig as ColorsConfigResponse,
|
|
206
|
+
frontendConfig: transformedFrontendConfig as FrontendConfigResponse,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// TODO: REMOVE MOCKED CONFIG ONCE WE HAVE THE NEW CONFIG IMPLEMENTED ON BACKEND
|
|
210
|
+
const merchantColorsConfig = response.me.getProductsConfigByVersion?.colors?.values;
|
|
211
|
+
const transformedMerchantColorConfig = transformSnakeToCamel(merchantColorsConfig);
|
|
212
|
+
|
|
213
|
+
const isSemanticColors = !window.location.href.includes('globals=merchant');
|
|
214
|
+
|
|
215
|
+
const colorsConfig = mockV3ColorsConfig;
|
|
216
|
+
const frontendConfig = mockV3FrontendConfig;
|
|
217
|
+
|
|
112
218
|
return {
|
|
113
|
-
colorsConfig:
|
|
114
|
-
|
|
219
|
+
colorsConfig: isSemanticColors
|
|
220
|
+
? (colorsConfig as ColorsConfigV3Response)
|
|
221
|
+
: (transformedMerchantColorConfig as ColorsConfigV3Response),
|
|
222
|
+
frontendConfig: frontendConfig as FrontendConfigV3Response,
|
|
115
223
|
};
|
|
116
224
|
} catch (err) {
|
|
117
225
|
Logger.logError('Error fetching graphql colors and frontend config', err);
|
|
@@ -119,14 +227,24 @@ export const GraphQLProvider = ({ children }: GraphQLProviderProps) => {
|
|
|
119
227
|
}
|
|
120
228
|
}, [executeQuery]);
|
|
121
229
|
|
|
230
|
+
const getConfig = useCallback(async (): Promise<GraphQlConfigValues> => {
|
|
231
|
+
console.log('GraphQLProvider: getConfig: requestV3Config', requestV3Config);
|
|
232
|
+
if (requestV3Config) {
|
|
233
|
+
return getV3Config();
|
|
234
|
+
}
|
|
235
|
+
return getColorsAndFrontendConfig();
|
|
236
|
+
}, [getColorsAndFrontendConfig, getV3Config, requestV3Config]);
|
|
237
|
+
|
|
122
238
|
const value = useMemo(
|
|
123
239
|
() => ({
|
|
124
240
|
executeQuery,
|
|
125
241
|
getOrgId,
|
|
126
242
|
getColorsAndFrontendConfig,
|
|
243
|
+
getV3Config,
|
|
244
|
+
getConfig,
|
|
127
245
|
isReady,
|
|
128
246
|
}),
|
|
129
|
-
[executeQuery, getOrgId, getColorsAndFrontendConfig, isReady],
|
|
247
|
+
[executeQuery, getOrgId, getColorsAndFrontendConfig, getV3Config, getConfig, isReady],
|
|
130
248
|
);
|
|
131
249
|
|
|
132
250
|
return <GraphQLContext.Provider value={value}>{children}</GraphQLContext.Provider>;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { FrontendConfigV3 } from 'src/application/models/frontendConfigV3';
|
|
2
|
+
import { ColorMappingV3, ColorNames, colorVar } from 'src/application/models/colorsConfigV3';
|
|
3
|
+
import { CamelCasedPropertiesDeep } from 'src/application/models';
|
|
4
|
+
import { ImageGalleryLayout } from '@envive-ai/react-toolkit-v3/ImageGallery';
|
|
5
|
+
import { PromptButtonVariant } from '@envive-ai/react-toolkit-v3/PromptButton';
|
|
6
|
+
import { PromptCarouselRows, AnimationSpeed } from '@envive-ai/react-toolkit-v3/PromptCarousel';
|
|
7
|
+
import { WidgetWrapperVariant } from '@envive-ai/react-toolkit-v3/WidgetWrapper';
|
|
8
|
+
import { ConfigVersionEnum, SocialProofWidgetKind, WidgetTypeV3 } from '../typesV3';
|
|
9
|
+
|
|
10
|
+
const mockImages = [
|
|
11
|
+
{
|
|
12
|
+
src: 'https://picsum.photos/400/600',
|
|
13
|
+
alt: 'Image 1',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
src: 'https://picsum.photos/400/600',
|
|
17
|
+
alt: 'Image 2',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
src: 'https://picsum.photos/400/600',
|
|
21
|
+
alt: 'Image 3',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
src: 'https://picsum.photos/400/600',
|
|
25
|
+
alt: 'Image 4',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export const mockV3ColorsConfig: CamelCasedPropertiesDeep<ColorMappingV3> = {
|
|
30
|
+
textPrimary: '#021414',
|
|
31
|
+
textSecondary: '#666666',
|
|
32
|
+
textAccent: '#478D87',
|
|
33
|
+
textLink: '#042E2C',
|
|
34
|
+
textLight: '#FFFFFF',
|
|
35
|
+
backgroundPrimary: '#1F5F51',
|
|
36
|
+
backgroundSecondary: '#F9F6EA',
|
|
37
|
+
backgroundTertiary: '#EEECDD',
|
|
38
|
+
backgroundDark: '#021414',
|
|
39
|
+
backgroundLight: '#FFFFFF',
|
|
40
|
+
borderLight: '#E6E7E7',
|
|
41
|
+
borderMedium: '#B3B8B8',
|
|
42
|
+
borderDark: '#021414',
|
|
43
|
+
accentPrimary: '#1F5F51',
|
|
44
|
+
accentSecondary: '#AE8659',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const mockV3FrontendConfig: FrontendConfigV3 = {
|
|
48
|
+
uiConfigs: {
|
|
49
|
+
version: ConfigVersionEnum.V3,
|
|
50
|
+
shortName: 'Envive AI',
|
|
51
|
+
lookAndFeel: {
|
|
52
|
+
theme: 'standard',
|
|
53
|
+
agentName: 'Envive AI',
|
|
54
|
+
chatHeaderLogoSrc: 'https://cdn.spiffy.ai/other/assets/envive-ai/Envive_Logo_Lt.svg',
|
|
55
|
+
widgetLogoSrc: 'https://cdn.spiffy.ai/other/assets/envive-ai/Envive_Logo_DK.svg',
|
|
56
|
+
hideWidgetLogo: false,
|
|
57
|
+
elementRadius: 8,
|
|
58
|
+
imageAspectRatio: '3/4',
|
|
59
|
+
buttonColors: {
|
|
60
|
+
lightButtonBackgroundColor: colorVar(ColorNames.BackgroundSecondary),
|
|
61
|
+
lightButtonIconColor: colorVar(ColorNames.AccentPrimary),
|
|
62
|
+
darkButtonBackgroundColor: colorVar(ColorNames.BackgroundDark),
|
|
63
|
+
darkButtonIconColor: colorVar(ColorNames.AccentPrimary),
|
|
64
|
+
},
|
|
65
|
+
typography: {
|
|
66
|
+
titleFontFamily: 'Poppins',
|
|
67
|
+
headerFontFamily: 'Poppins',
|
|
68
|
+
bodyFontFamily: 'Inter Variable',
|
|
69
|
+
fontSize: {
|
|
70
|
+
t1: '32px',
|
|
71
|
+
t2: '28px',
|
|
72
|
+
t3: '24px',
|
|
73
|
+
h1: '20px',
|
|
74
|
+
h2: '16px',
|
|
75
|
+
h3: '14px',
|
|
76
|
+
b1: '20px',
|
|
77
|
+
b2: '16px',
|
|
78
|
+
b3: '14px',
|
|
79
|
+
b4: '12px',
|
|
80
|
+
b5: '10px',
|
|
81
|
+
l1: '14px',
|
|
82
|
+
l2: '12px',
|
|
83
|
+
},
|
|
84
|
+
fontWeight: {
|
|
85
|
+
rg: '400',
|
|
86
|
+
md: '500',
|
|
87
|
+
sb: '600',
|
|
88
|
+
},
|
|
89
|
+
letterSpacing: {
|
|
90
|
+
'0': '0em',
|
|
91
|
+
'wide-1': '1px',
|
|
92
|
+
},
|
|
93
|
+
lineHeight: {
|
|
94
|
+
'124': 1.24,
|
|
95
|
+
'120': 1.2,
|
|
96
|
+
'118': 1.18,
|
|
97
|
+
'116': 1.16,
|
|
98
|
+
'114': 1.14,
|
|
99
|
+
'148': 1.48,
|
|
100
|
+
'140': 1.4,
|
|
101
|
+
'128': 1.28,
|
|
102
|
+
'130': 1.3,
|
|
103
|
+
'133': 1.33,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
floatingButton: {
|
|
108
|
+
position: 'bottom-right',
|
|
109
|
+
backgroundColor: colorVar(ColorNames.BackgroundPrimary),
|
|
110
|
+
mode: 'light',
|
|
111
|
+
showOption: 'always',
|
|
112
|
+
style: 'attached',
|
|
113
|
+
iconSVGSrc: '',
|
|
114
|
+
},
|
|
115
|
+
floatingChat: {
|
|
116
|
+
headerBackgroundColor: colorVar(ColorNames.BackgroundPrimary),
|
|
117
|
+
headerMode: 'dark',
|
|
118
|
+
welcomeMessageIconColor: colorVar(ColorNames.AccentPrimary),
|
|
119
|
+
showVerifiedBuyer: false,
|
|
120
|
+
userCanEditQueries: true,
|
|
121
|
+
showEnviveLogo: true,
|
|
122
|
+
ignoreFirstModelResponse: false,
|
|
123
|
+
neverShowSingleProductCards: false,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
pageVariants: [],
|
|
127
|
+
mountingConfigs: {},
|
|
128
|
+
widgetConfigs: {
|
|
129
|
+
'prompt-carousel-test-light-widget': {
|
|
130
|
+
widgetConfigId: 'prompt-carousel-test-light-widget',
|
|
131
|
+
contentId: 'prompt-carousel-test-light-widget',
|
|
132
|
+
type: WidgetTypeV3.PromptCarouselV3,
|
|
133
|
+
|
|
134
|
+
promptButtonType: PromptButtonVariant.LIGHT,
|
|
135
|
+
boldFirstButton: false,
|
|
136
|
+
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
137
|
+
animationSpeed: AnimationSpeed.FAST,
|
|
138
|
+
},
|
|
139
|
+
'prompt-carousel-test-dark-widget': {
|
|
140
|
+
widgetConfigId: 'prompt-carousel-test-dark-widget',
|
|
141
|
+
contentId: 'prompt-carousel-test-dark-widget',
|
|
142
|
+
type: WidgetTypeV3.PromptCarouselV3,
|
|
143
|
+
|
|
144
|
+
promptButtonType: PromptButtonVariant.DARK,
|
|
145
|
+
boldFirstButton: false,
|
|
146
|
+
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
147
|
+
animationSpeed: AnimationSpeed.FAST,
|
|
148
|
+
},
|
|
149
|
+
'titled-prompt-carousel-test-light-widget': {
|
|
150
|
+
widgetConfigId: 'titled-prompt-carousel-test-light-widget',
|
|
151
|
+
contentId: 'titled-prompt-carousel-test-light-widget',
|
|
152
|
+
type: WidgetTypeV3.TitledPromptCarouselV3,
|
|
153
|
+
|
|
154
|
+
promptButtonType: PromptButtonVariant.LIGHT,
|
|
155
|
+
boldFirstButton: false,
|
|
156
|
+
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
157
|
+
animationSpeed: AnimationSpeed.FAST,
|
|
158
|
+
},
|
|
159
|
+
'titled-prompt-carousel-test-dark-widget': {
|
|
160
|
+
widgetConfigId: 'titled-prompt-carousel-test-dark-widget',
|
|
161
|
+
contentId: 'titled-prompt-carousel-test-dark-widget',
|
|
162
|
+
type: WidgetTypeV3.TitledPromptCarouselV3,
|
|
163
|
+
|
|
164
|
+
promptButtonType: PromptButtonVariant.DARK,
|
|
165
|
+
boldFirstButton: false,
|
|
166
|
+
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
167
|
+
animationSpeed: AnimationSpeed.FAST,
|
|
168
|
+
},
|
|
169
|
+
'social-proof-test-widget-four-grid': {
|
|
170
|
+
widgetConfigId: 'social-proof-test-widget-four-grid',
|
|
171
|
+
contentId: 'social-proof-test-widget-four-grid',
|
|
172
|
+
type: WidgetTypeV3.SocialProofV3,
|
|
173
|
+
|
|
174
|
+
imageGalleryLayout: ImageGalleryLayout.FOUR_GRID,
|
|
175
|
+
kind: SocialProofWidgetKind.STATIC,
|
|
176
|
+
variant: WidgetWrapperVariant.INLINE_WITH_BORDER,
|
|
177
|
+
promptCarouselRows: PromptCarouselRows.TWO_ON_MOBILE_ONE_ON_DESKTOP,
|
|
178
|
+
primaryButtonVariant: PromptButtonVariant.DARK,
|
|
179
|
+
secondaryButtonVariant: PromptButtonVariant.LIGHT,
|
|
180
|
+
images: mockImages,
|
|
181
|
+
},
|
|
182
|
+
'social-proof-test-widget-single': {
|
|
183
|
+
widgetConfigId: 'social-proof-test-widget-single',
|
|
184
|
+
contentId: 'social-proof-test-widget-single',
|
|
185
|
+
type: WidgetTypeV3.SocialProofV3,
|
|
186
|
+
|
|
187
|
+
imageGalleryLayout: ImageGalleryLayout.SINGLE,
|
|
188
|
+
kind: SocialProofWidgetKind.STATIC,
|
|
189
|
+
variant: WidgetWrapperVariant.CARD_NO_BORDER,
|
|
190
|
+
promptCarouselRows: PromptCarouselRows.TWO_ON_MOBILE_ONE_ON_DESKTOP,
|
|
191
|
+
primaryButtonVariant: PromptButtonVariant.DARK,
|
|
192
|
+
secondaryButtonVariant: PromptButtonVariant.LIGHT,
|
|
193
|
+
images: mockImages,
|
|
194
|
+
},
|
|
195
|
+
'social-proof-test-widget-four-horizontal': {
|
|
196
|
+
widgetConfigId: 'social-proof-test-widget-four-horizontal',
|
|
197
|
+
contentId: 'social-proof-test-widget-four-horizontal',
|
|
198
|
+
type: WidgetTypeV3.SocialProofV3,
|
|
199
|
+
|
|
200
|
+
imageGalleryLayout: ImageGalleryLayout.FOUR_HORIZONTAL,
|
|
201
|
+
kind: SocialProofWidgetKind.STATIC,
|
|
202
|
+
variant: WidgetWrapperVariant.CARD_WITH_BORDER,
|
|
203
|
+
promptCarouselRows: PromptCarouselRows.TWO_ON_MOBILE_ONE_ON_DESKTOP,
|
|
204
|
+
primaryButtonVariant: PromptButtonVariant.DARK,
|
|
205
|
+
secondaryButtonVariant: PromptButtonVariant.LIGHT,
|
|
206
|
+
images: mockImages,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|