@envive-ai/react-widgets-v3 0.3.2
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/CXIntegration/hooks/useUnifiedCXButton.cjs +23 -0
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +22 -0
- package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.cjs +11 -0
- package/dist/CXIntegration/implementations/useDefaultUnifiedCXButton.js +10 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +20 -0
- package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +19 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +53 -0
- package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +52 -0
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +45 -0
- package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +44 -0
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +70 -0
- package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +69 -0
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +59 -0
- package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +58 -0
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +65 -0
- package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +64 -0
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +53 -0
- package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +52 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +18 -0
- package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +17 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +54 -0
- package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +53 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +18 -0
- package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +17 -0
- package/dist/CXIntegration/types.cjs +19 -0
- package/dist/CXIntegration/types.js +18 -0
- package/dist/CXIntegration/utils/functions.cjs +30 -0
- package/dist/CXIntegration/utils/functions.js +30 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/hocs/withBaseWidget/index.cjs +3 -0
- package/dist/hocs/withBaseWidget/index.d.cts +3 -0
- package/dist/hocs/withBaseWidget/index.d.ts +3 -0
- package/dist/hocs/withBaseWidget/index.js +3 -0
- package/dist/hocs/withBaseWidget/types.d.cts +37 -0
- package/dist/hocs/withBaseWidget/types.d.ts +39 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.cjs +101 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +10 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +10 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.js +100 -0
- package/dist/hooks/dist/application/models/api/orgConfigResults.d.ts +1 -0
- package/dist/hooks/dist/application/models/frontendConfig.d.ts +1 -0
- package/dist/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +2 -0
- package/dist/hooks/dist/contexts/amplitudeContext/index.d.ts +2 -0
- package/dist/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +2 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +8 -0
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +11 -0
- package/dist/hooks/dist/contexts/hardcopyContext/index.d.ts +1 -0
- package/dist/hooks/dist/contexts/types.d.cts +44 -0
- package/dist/hooks/dist/contexts/types.d.ts +47 -0
- package/dist/hooks/dist/contexts/typesV3.d.cts +201 -0
- package/dist/hooks/dist/contexts/typesV3.d.ts +201 -0
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.cts +36 -0
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.ts +37 -0
- package/dist/hooks/dist/types/customerService.d.cts +18 -0
- package/dist/hooks/dist/types/customerService.d.ts +18 -0
- package/dist/stories/SalesAgentTest/index.cjs +0 -0
- package/dist/stories/SalesAgentTest/index.d.cts +1 -0
- package/dist/stories/SalesAgentTest/index.d.ts +1 -0
- package/dist/stories/SalesAgentTest/index.js +0 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +98 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +19 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +19 -0
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +96 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewComparisonWidget/index.js +3 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +44 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +16 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +16 -0
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +42 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewLoadingWidget/index.js +3 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +86 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +19 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +19 -0
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +84 -0
- package/dist/widgets/ChatPreviewWidget/index.cjs +4 -0
- package/dist/widgets/ChatPreviewWidget/index.d.cts +2 -0
- package/dist/widgets/ChatPreviewWidget/index.d.ts +2 -0
- package/dist/widgets/ChatPreviewWidget/index.js +3 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +66 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +64 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +70 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +10 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +10 -0
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +69 -0
- package/dist/widgets/FloatingChatWidget/constants.cjs +6 -0
- package/dist/widgets/FloatingChatWidget/constants.d.cts +4 -0
- package/dist/widgets/FloatingChatWidget/constants.d.ts +4 -0
- package/dist/widgets/FloatingChatWidget/constants.js +5 -0
- package/dist/widgets/FloatingChatWidget/index.cjs +5 -0
- package/dist/widgets/FloatingChatWidget/index.d.cts +3 -0
- package/dist/widgets/FloatingChatWidget/index.d.ts +3 -0
- package/dist/widgets/FloatingChatWidget/index.js +4 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +60 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +19 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +19 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +58 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.cjs +4 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.cts +2 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.d.ts +2 -0
- package/dist/widgets/PromptButtonCarouselWithImageWidget/index.js +3 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +64 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +14 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +14 -0
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +63 -0
- package/dist/widgets/PromptCarouselWidget/index.cjs +3 -0
- package/dist/widgets/PromptCarouselWidget/index.d.cts +2 -0
- package/dist/widgets/PromptCarouselWidget/index.d.ts +2 -0
- package/dist/widgets/PromptCarouselWidget/index.js +3 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +35 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +14 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +14 -0
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +34 -0
- package/dist/widgets/SocialProofFlowWidget/index.cjs +3 -0
- package/dist/widgets/SocialProofFlowWidget/index.d.cts +2 -0
- package/dist/widgets/SocialProofFlowWidget/index.d.ts +2 -0
- package/dist/widgets/SocialProofFlowWidget/index.js +3 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +118 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +19 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +19 -0
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +116 -0
- package/dist/widgets/SocialProofWidget/index.cjs +4 -0
- package/dist/widgets/SocialProofWidget/index.d.cts +2 -0
- package/dist/widgets/SocialProofWidget/index.d.ts +2 -0
- package/dist/widgets/SocialProofWidget/index.js +3 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +67 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +14 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +14 -0
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +66 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.cjs +3 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.d.cts +2 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.d.ts +2 -0
- package/dist/widgets/TitledPromptCarouselWidget/index.js +3 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +35 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +14 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +14 -0
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +34 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.cjs +3 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.d.cts +2 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.d.ts +2 -0
- package/dist/widgets/TypingAnimationFlowWidget/index.js +3 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +90 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +19 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +19 -0
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +88 -0
- package/dist/widgets/TypingAnimationWidget/index.cjs +4 -0
- package/dist/widgets/TypingAnimationWidget/index.d.cts +2 -0
- package/dist/widgets/TypingAnimationWidget/index.d.ts +2 -0
- package/dist/widgets/TypingAnimationWidget/index.js +3 -0
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +15 -0
- package/dist/widgets/dist/SearchResults/SearchResults.d.ts +15 -0
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +9 -0
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.ts +9 -0
- package/dist/widgets/dist/SearchResults/index.d.ts +2 -0
- package/dist/widgets/dist/SearchResults/types.d.cts +20 -0
- package/dist/widgets/dist/SearchResults/types.d.ts +20 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.cts +10 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroState.d.ts +10 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +18 -0
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +18 -0
- package/dist/widgets/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/widgets/dist/SearchZeroState/types.d.cts +13 -0
- package/dist/widgets/dist/SearchZeroState/types.d.ts +13 -0
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +36 -0
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.ts +36 -0
- package/dist/widgets/dist/SuggestionBar/index.d.ts +2 -0
- package/dist/widgets/dist/SuggestionBar/types.d.cts +9 -0
- package/dist/widgets/dist/SuggestionBar/types.d.ts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +9 -0
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +20 -0
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.ts +20 -0
- package/dist/widgets/dist/config/BaseWidgetConfig.d.cts +13 -0
- package/dist/widgets/dist/config/BaseWidgetConfig.d.ts +13 -0
- package/dist/widgets/dist/config/WidgetType.d.cts +23 -0
- package/dist/widgets/dist/config/WidgetType.d.ts +23 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.ts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.cts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.ts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.cts +73 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +73 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.cts +25 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +25 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts +35 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +35 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +32 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +14 -0
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +15 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.ts +61 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +60 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +11 -0
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +11 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +28 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +10 -0
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.ts +10 -0
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +27 -0
- package/dist/widgets/hooks/useGetWidgetStatus.js +26 -0
- package/dist/widgets/utils/functions.cjs +55 -0
- package/dist/widgets/utils/functions.js +48 -0
- package/dist/widgets-v2/SearchResults/index.cjs +5 -0
- package/dist/widgets-v2/SearchResults/index.d.cts +3 -0
- package/dist/widgets-v2/SearchResults/index.d.ts +4 -0
- package/dist/widgets-v2/SearchResults/index.js +3 -0
- package/dist/widgets-v2/SearchZeroState/index.cjs +8 -0
- package/dist/widgets-v2/SearchZeroState/index.d.cts +5 -0
- package/dist/widgets-v2/SearchZeroState/index.d.ts +6 -0
- package/dist/widgets-v2/SearchZeroState/index.js +3 -0
- package/dist/widgets-v2/SuggestionBar/index.cjs +5 -0
- package/dist/widgets-v2/SuggestionBar/index.d.cts +3 -0
- package/dist/widgets-v2/SuggestionBar/index.d.ts +4 -0
- package/dist/widgets-v2/SuggestionBar/index.js +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.cjs +5 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.cts +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +3 -0
- package/dist/widgets-v2/SuggestionButtonContainer/index.js +3 -0
- package/package.json +158 -0
- package/src/CXIntegration/hooks/useUnifiedCXButton.ts +38 -0
- package/src/CXIntegration/implementations/useDefaultUnifiedCXButton.ts +8 -0
- package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +28 -0
- package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +67 -0
- package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +83 -0
- package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +120 -0
- package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +80 -0
- package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +83 -0
- package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +78 -0
- package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +34 -0
- package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +69 -0
- package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +34 -0
- package/src/CXIntegration/types.ts +24 -0
- package/src/CXIntegration/utils/functions.ts +50 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +689 -0
- package/src/hocs/withBaseWidget/index.ts +2 -0
- package/src/hocs/withBaseWidget/types.ts +39 -0
- package/src/hocs/withBaseWidget/withBaseWidget.tsx +126 -0
- package/src/stories/FloatingChatWidget.stories.tsx +56 -0
- package/src/stories/PromptButtonCarouselWithImageWidget.stories.tsx +54 -0
- package/src/stories/PromptCarouselWidget.stories.tsx +54 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.stories.tsx +18 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +111 -0
- package/src/stories/SalesAgentTest/index.ts +0 -0
- package/src/stories/SearchResults.stories.tsx +29 -0
- package/src/stories/SearchZeroState.stories.tsx +52 -0
- package/src/stories/SocialProofFlowWidget.stories.tsx +77 -0
- package/src/stories/SuggestionBar.stories.tsx +45 -0
- package/src/stories/TitledPromptCarouselWidget.stories.tsx +71 -0
- package/src/stories/TypingAnimationFlowWidget.stories.tsx +67 -0
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +152 -0
- package/src/widgets/ChatPreviewComparisonWidget/index.ts +7 -0
- package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +82 -0
- package/src/widgets/ChatPreviewLoadingWidget/index.ts +7 -0
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +119 -0
- package/src/widgets/ChatPreviewWidget/index.ts +4 -0
- package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +115 -0
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -0
- package/src/widgets/FloatingChatWidget/constants.ts +1 -0
- package/src/widgets/FloatingChatWidget/index.ts +5 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +87 -0
- package/src/widgets/PromptButtonCarouselWithImageWidget/index.ts +6 -0
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +83 -0
- package/src/widgets/PromptCarouselWidget/index.ts +2 -0
- package/src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.tsx +61 -0
- package/src/widgets/SocialProofFlowWidget/index.ts +4 -0
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +160 -0
- package/src/widgets/SocialProofWidget/index.ts +2 -0
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +93 -0
- package/src/widgets/TitledPromptCarouselWidget/index.ts +2 -0
- package/src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.tsx +61 -0
- package/src/widgets/TypingAnimationFlowWidget/index.ts +4 -0
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +115 -0
- package/src/widgets/TypingAnimationWidget/index.ts +2 -0
- package/src/widgets/hooks/useGetWidgetStatus.tsx +29 -0
- package/src/widgets/utils/functions.ts +104 -0
- package/src/widgets-v2/SearchResults/index.ts +3 -0
- package/src/widgets-v2/SearchZeroState/index.ts +15 -0
- package/src/widgets-v2/SuggestionBar/index.ts +6 -0
- package/src/widgets-v2/SuggestionButtonContainer/index.ts +6 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { SpiffyMetricsEventName } from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
3
|
+
import { HardcopyResponse } from '@envive-ai/react-hooks/contexts/hardcopyContext';
|
|
4
|
+
import {
|
|
5
|
+
OrgUIConfigV3,
|
|
6
|
+
WidgetConfigV3,
|
|
7
|
+
WidgetTypeV3,
|
|
8
|
+
} from '@envive-ai/react-hooks/contexts/typesV3';
|
|
9
|
+
|
|
10
|
+
export interface BaseWidgetProps {
|
|
11
|
+
widgetConfigId?: string;
|
|
12
|
+
widgetType: WidgetTypeV3;
|
|
13
|
+
observedWidget?: RefObject<BaseWidgetProps>;
|
|
14
|
+
hardcopyContent?: HardcopyResponse;
|
|
15
|
+
widgetConfig?: WidgetConfigV3;
|
|
16
|
+
uiConfig?: OrgUIConfigV3;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
isHardcopyLoading?: boolean;
|
|
19
|
+
isPageLoading?: boolean;
|
|
20
|
+
isWidgetConfigLoading?: boolean;
|
|
21
|
+
isUiConfigLoading?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface WithBaseWidgetOptions {
|
|
25
|
+
/**
|
|
26
|
+
* The Amplitude event name to track when the widget becomes visible.
|
|
27
|
+
* Defaults to a generic component visible event if not provided.
|
|
28
|
+
*/
|
|
29
|
+
visibilityEventName?: SpiffyMetricsEventName;
|
|
30
|
+
/**
|
|
31
|
+
* Additional properties to include with the visibility event.
|
|
32
|
+
*/
|
|
33
|
+
visibilityEventProps?: Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Root margin for the IntersectionObserver (e.g., '0px', '100px').
|
|
36
|
+
* Defaults to '0px'.
|
|
37
|
+
*/
|
|
38
|
+
rootMargin?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SpiffyMetricsEventName,
|
|
5
|
+
useAmplitude,
|
|
6
|
+
} from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
7
|
+
import { HardcopyResponse, useHardcopy } from '@envive-ai/react-hooks/contexts/hardcopyContext';
|
|
8
|
+
import { usePage } from '@envive-ai/react-hooks/contexts/pageContext';
|
|
9
|
+
import { useWidgetConfig } from '@envive-ai/react-hooks/contexts/widgetConfigContext';
|
|
10
|
+
import { OrgUIConfigV3, WidgetConfigV3 } from '@envive-ai/react-hooks/contexts/typesV3';
|
|
11
|
+
import { useUiConfig } from '@envive-ai/react-hooks/contexts/uiConfigContext';
|
|
12
|
+
|
|
13
|
+
import { BaseWidgetProps, WithBaseWidgetOptions } from './types';
|
|
14
|
+
|
|
15
|
+
export function withBaseWidget<P extends BaseWidgetProps>(
|
|
16
|
+
Widget: React.ComponentType<P>,
|
|
17
|
+
options?: WithBaseWidgetOptions,
|
|
18
|
+
) {
|
|
19
|
+
const WrappedWidget = (props: P) => {
|
|
20
|
+
const { widgetConfigId, widgetType } = props;
|
|
21
|
+
const widgetRef = useRef<HTMLDivElement>(null);
|
|
22
|
+
const hasTrackedEvent = useRef(false);
|
|
23
|
+
const { trackEvent, isReady } = useAmplitude();
|
|
24
|
+
|
|
25
|
+
const [hardcopyContent, setHardcopyContent] = useState<HardcopyResponse | undefined>(undefined);
|
|
26
|
+
const { getHardcopy, isLoading: isHardcopyLoading } = useHardcopy();
|
|
27
|
+
|
|
28
|
+
const { userEvent, isLoading: isPageLoading } = usePage();
|
|
29
|
+
|
|
30
|
+
const [widgetConfig, setWidgetConfig] = useState<WidgetConfigV3 | undefined>(undefined);
|
|
31
|
+
const { getWidgetConfig, isLoading: isWidgetConfigLoading } = useWidgetConfig();
|
|
32
|
+
|
|
33
|
+
const [uiConfig, setUiConfig] = useState<OrgUIConfigV3 | undefined>(undefined);
|
|
34
|
+
const { getUiConfig, isLoading: isUiConfigLoading } = useUiConfig();
|
|
35
|
+
|
|
36
|
+
const isLoading =
|
|
37
|
+
isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading;
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!isReady || hasTrackedEvent.current || !widgetRef.current) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const observer = new IntersectionObserver(
|
|
45
|
+
([entry]) => {
|
|
46
|
+
if (entry.isIntersecting && !hasTrackedEvent.current) {
|
|
47
|
+
const eventName =
|
|
48
|
+
options?.visibilityEventName || SpiffyMetricsEventName.ChatComponentVisible;
|
|
49
|
+
|
|
50
|
+
trackEvent({
|
|
51
|
+
eventName,
|
|
52
|
+
eventProps: {
|
|
53
|
+
widget_config_id: widgetConfigId,
|
|
54
|
+
widget_type: widgetType,
|
|
55
|
+
...options?.visibilityEventProps,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
hasTrackedEvent.current = true;
|
|
60
|
+
observer.disconnect();
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
rootMargin: options?.rootMargin || '0px',
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
observer.observe(widgetRef.current);
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
observer.disconnect();
|
|
72
|
+
};
|
|
73
|
+
}, [isReady, widgetConfigId, widgetType, trackEvent]);
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!widgetType || !userEvent) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
getHardcopy({ widgetType, userEvent })
|
|
80
|
+
.then(setHardcopyContent)
|
|
81
|
+
.catch(() => {
|
|
82
|
+
// Silently handle errors - widget will render without hardcopy content
|
|
83
|
+
});
|
|
84
|
+
}, [widgetConfigId, widgetType, getHardcopy, userEvent]);
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
getUiConfig()
|
|
88
|
+
.then(setUiConfig)
|
|
89
|
+
.catch(() => {
|
|
90
|
+
// Silently handle errors - widget will render without ui config
|
|
91
|
+
});
|
|
92
|
+
}, [getUiConfig, widgetConfigId, widgetType]);
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (!widgetConfigId || !widgetType) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
getWidgetConfig({ widgetConfigId, widgetType })
|
|
100
|
+
.then(setWidgetConfig)
|
|
101
|
+
.catch(e => {
|
|
102
|
+
console.error('Error getting widget config', widgetConfigId, widgetType, e);
|
|
103
|
+
// Silently handle errors - widget will render without widget config
|
|
104
|
+
});
|
|
105
|
+
}, [widgetConfigId, widgetType, getWidgetConfig]);
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<Widget
|
|
109
|
+
{...props}
|
|
110
|
+
isLoading={isLoading}
|
|
111
|
+
isHardcopyLoading={isHardcopyLoading}
|
|
112
|
+
isPageLoading={isPageLoading}
|
|
113
|
+
isWidgetConfigLoading={isWidgetConfigLoading}
|
|
114
|
+
isUiConfigLoading={isUiConfigLoading}
|
|
115
|
+
uiConfig={uiConfig}
|
|
116
|
+
widgetConfig={widgetConfig}
|
|
117
|
+
hardcopyContent={hardcopyContent}
|
|
118
|
+
observedWidget={widgetRef}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
WrappedWidget.displayName = `withBaseWidget(${Widget.displayName || Widget.name || 'Component'})`;
|
|
124
|
+
|
|
125
|
+
return WrappedWidget;
|
|
126
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import {
|
|
3
|
+
PageVisitCategory,
|
|
4
|
+
useSalesAgent,
|
|
5
|
+
} from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { v4 as uuid } from 'uuid';
|
|
8
|
+
import { UserEventCategory } from '@spiffy-ai/commerce-api-client';
|
|
9
|
+
import { FloatingChatWidget } from '../widgets/FloatingChatWidget';
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Widgets V3/FloatingChatWidget',
|
|
13
|
+
component: FloatingChatWidget,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
args: {},
|
|
16
|
+
argTypes: {},
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component:
|
|
21
|
+
'FloatingChatWidget is a widget wrapper around FloatingChat that includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget renders a floating chat interface that allows users to interact with the sales agent.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
decorators: [
|
|
26
|
+
Story => {
|
|
27
|
+
const { logPageVisit, logUserEvent } = useSalesAgent();
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
logUserEvent({
|
|
31
|
+
eventId: uuid(),
|
|
32
|
+
category: UserEventCategory.AppLoaded,
|
|
33
|
+
createdAt: new Date().toISOString(),
|
|
34
|
+
});
|
|
35
|
+
logPageVisit({ pageVisitCategory: PageVisitCategory.Homepage });
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
return <Story />;
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
} satisfies Meta<typeof FloatingChatWidget>;
|
|
42
|
+
|
|
43
|
+
export default meta;
|
|
44
|
+
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
46
|
+
|
|
47
|
+
export const Playground: Story = {
|
|
48
|
+
parameters: {
|
|
49
|
+
docs: {
|
|
50
|
+
description: {
|
|
51
|
+
story:
|
|
52
|
+
'Experiment with different widgetConfigId values. The widget will fetch configuration from the widget config based on the widgetConfigId.',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { PromptButtonCarouselWithImageWidget } from '../widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Widgets V3/PromptButtonCarouselWithImageWidget',
|
|
6
|
+
component: PromptButtonCarouselWithImageWidget,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
widgetConfigId: 'prompt-button-carousel-with-image-test-widget',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
widgetConfigId: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description:
|
|
15
|
+
'Unique identifier for the widget configuration. The widget will fetch the widget config and hardcopy content based on this ID.',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
'PromptButtonCarouselWithImageWidget is a widget wrapper around PromptButtonCarouselWithImage that includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget automatically fetches title label, prompt button texts, text field placeholder, and image configuration from hardcopy and widget config based on the widgetConfigId. The image is displayed on mobile devices only.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
decorators: [
|
|
27
|
+
Story => (
|
|
28
|
+
<div
|
|
29
|
+
style={{
|
|
30
|
+
padding: '1rem',
|
|
31
|
+
maxWidth: '100%',
|
|
32
|
+
overflow: 'hidden',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Story />
|
|
36
|
+
</div>
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
} satisfies Meta<typeof PromptButtonCarouselWithImageWidget>;
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const Playground: Story = {
|
|
46
|
+
parameters: {
|
|
47
|
+
docs: {
|
|
48
|
+
description: {
|
|
49
|
+
story:
|
|
50
|
+
'Interactive playground to experiment with different widgetConfigId values. The widget will fetch title, prompt button texts, text field placeholder, and image configuration from hardcopy content and widget config based on the widgetConfigId.',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { PromptCarouselWidget } from '../widgets/PromptCarouselWidget/PromptCarouselWidget';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Widgets V3/PromptCarouselWidget',
|
|
6
|
+
component: PromptCarouselWidget,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
widgetConfigId: 'prompt-carousel-test-light-widget',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
widgetConfigId: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description:
|
|
15
|
+
'Unique identifier for the widget configuration. The widget will fetch the widget config based on this ID.',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
'PromptCarouselWidget is a widget wrapper around PromptCarousel that includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget automatically fetches prompt button texts from hardcopy and widget config based on the widgetConfigId.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
decorators: [
|
|
27
|
+
Story => (
|
|
28
|
+
<div
|
|
29
|
+
style={{
|
|
30
|
+
padding: '1rem',
|
|
31
|
+
maxWidth: '100%',
|
|
32
|
+
overflow: 'hidden',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Story />
|
|
36
|
+
</div>
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
} satisfies Meta<typeof PromptCarouselWidget>;
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const Playground: Story = {
|
|
46
|
+
parameters: {
|
|
47
|
+
docs: {
|
|
48
|
+
description: {
|
|
49
|
+
story:
|
|
50
|
+
'Experiment with different widgetConfigId values. The widget will fetch prompt button texts from hardcopy content and widget config based on the widgetConfigId.',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { SalesAgentTest } from './SalesAgentTest';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Widgets/Test/SalesAgentTest',
|
|
7
|
+
component: SalesAgentTest,
|
|
8
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof SalesAgentTest>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PageVisitCategory,
|
|
3
|
+
SuggestionCategory,
|
|
4
|
+
useSalesAgent,
|
|
5
|
+
} from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
|
|
8
|
+
export const SalesAgentTest = () => {
|
|
9
|
+
const {
|
|
10
|
+
suggestions,
|
|
11
|
+
messages,
|
|
12
|
+
pendingMessages,
|
|
13
|
+
isResponseStreaming,
|
|
14
|
+
isPendingResponse,
|
|
15
|
+
logPageVisit,
|
|
16
|
+
onSuggestionClicked,
|
|
17
|
+
onTypedMessageSubmitted,
|
|
18
|
+
onFormResponseSubmitted,
|
|
19
|
+
} = useSalesAgent();
|
|
20
|
+
|
|
21
|
+
const [query, setQuery] = useState('');
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<div>Messages: {messages.length}</div>
|
|
26
|
+
<div>Pending Messages: {pendingMessages.length}</div>
|
|
27
|
+
<div>Is Response Streaming: {isResponseStreaming.toString()}</div>
|
|
28
|
+
<div>Is Pending Response: {isPendingResponse.toString()}</div>
|
|
29
|
+
<div>
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
onClick={() => logPageVisit({ pageVisitCategory: PageVisitCategory.Homepage })}
|
|
33
|
+
>
|
|
34
|
+
Log Page Visit
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
onClick={() =>
|
|
41
|
+
onSuggestionClicked({
|
|
42
|
+
id: '1',
|
|
43
|
+
category: SuggestionCategory.ProductBased,
|
|
44
|
+
content: 'test',
|
|
45
|
+
createdAt: new Date().toISOString(),
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
>
|
|
49
|
+
On Suggestion Clicked
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
53
|
+
<input
|
|
54
|
+
type="text"
|
|
55
|
+
value={query}
|
|
56
|
+
onChange={e => setQuery(e.target.value)}
|
|
57
|
+
onKeyDown={e => {
|
|
58
|
+
if (e.key === 'Enter') {
|
|
59
|
+
onTypedMessageSubmitted({ query, userTyped: true });
|
|
60
|
+
setQuery('');
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
placeholder="Enter your query"
|
|
64
|
+
/>
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
onClick={() => {
|
|
68
|
+
onTypedMessageSubmitted({ query, userTyped: true });
|
|
69
|
+
setQuery('');
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
On Typed Message Submitted
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
<div>
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
onClick={onFormResponseSubmitted}
|
|
79
|
+
>
|
|
80
|
+
On Form Response Submitted
|
|
81
|
+
</button>
|
|
82
|
+
</div>
|
|
83
|
+
<hr />
|
|
84
|
+
<div>Messages:</div>
|
|
85
|
+
<div style={{ maxHeight: '400px', overflowY: 'auto' }}>
|
|
86
|
+
{messages.map(message => (
|
|
87
|
+
<div key={message[0].id}>{JSON.stringify(message)}</div>
|
|
88
|
+
))}
|
|
89
|
+
</div>
|
|
90
|
+
<hr />
|
|
91
|
+
<div>Suggestions:</div>
|
|
92
|
+
<div>
|
|
93
|
+
{suggestions.map(suggestion => (
|
|
94
|
+
<button
|
|
95
|
+
style={{
|
|
96
|
+
padding: '4px 8px',
|
|
97
|
+
borderRadius: '4px',
|
|
98
|
+
border: '1px solid #ccc',
|
|
99
|
+
margin: '4px 0',
|
|
100
|
+
}}
|
|
101
|
+
type="button"
|
|
102
|
+
key={suggestion.id}
|
|
103
|
+
onClick={() => onSuggestionClicked(suggestion)}
|
|
104
|
+
>
|
|
105
|
+
{suggestion.content}
|
|
106
|
+
</button>
|
|
107
|
+
))}
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { WidgetType } from '@envive-ai/react-hooks/contexts/types';
|
|
4
|
+
import { SearchResults } from '@envive-ai/react-widgets/SearchResults';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof SearchResults> = {
|
|
7
|
+
title: 'Widgets V2/SearchResults',
|
|
8
|
+
component: SearchResults,
|
|
9
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'fullscreen',
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
widgetConfig: {
|
|
16
|
+
searchInputVariant: 'standard',
|
|
17
|
+
searchFilterSidebarVariant: 'darkButton',
|
|
18
|
+
productGridVariant: 'standard',
|
|
19
|
+
searchBoxPlaceholder: '',
|
|
20
|
+
widgetConfigId: '',
|
|
21
|
+
type: WidgetType.SearchResultsEntryPoint,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { SearchEntryPointWidgetConfig, WidgetType } from '@envive-ai/react-hooks/contexts/types';
|
|
4
|
+
import { SearchZeroState } from '@envive-ai/react-widgets/SearchZeroState';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Widgets V2/SearchZeroState',
|
|
8
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
searchInputVariant: 'standard',
|
|
15
|
+
searchBoxPlaceholder: '',
|
|
16
|
+
widgetConfigId: '',
|
|
17
|
+
type: WidgetType.SearchZeroStateEntryPoint,
|
|
18
|
+
searchZeroStateVariant: 'backgroundTertiary',
|
|
19
|
+
suggestionButtonConfig: {
|
|
20
|
+
variant: 'primary',
|
|
21
|
+
hoverVariant: 'primary',
|
|
22
|
+
borderRadius: 'sm',
|
|
23
|
+
},
|
|
24
|
+
layout: 'input',
|
|
25
|
+
initialIsOpen: false,
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
initialIsOpen: {
|
|
29
|
+
control: 'boolean',
|
|
30
|
+
},
|
|
31
|
+
searchZeroStateVariant: {
|
|
32
|
+
control: 'select',
|
|
33
|
+
options: [
|
|
34
|
+
'backgroundTertiary',
|
|
35
|
+
'backgroundPrimary',
|
|
36
|
+
'backgroundSecondary',
|
|
37
|
+
'backgroundQuaternary',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
render: (args: SearchEntryPointWidgetConfig & { initialIsOpen: boolean }) => (
|
|
42
|
+
<SearchZeroState
|
|
43
|
+
widgetConfig={{ ...args }}
|
|
44
|
+
initialIsOpen={args.initialIsOpen}
|
|
45
|
+
/>
|
|
46
|
+
),
|
|
47
|
+
} satisfies Meta;
|
|
48
|
+
|
|
49
|
+
export default meta;
|
|
50
|
+
type Story = StoryObj<typeof meta>;
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SocialProofFlowWidget } from '../widgets/SocialProofFlowWidget/SocialProofFlowWidget';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Widgets V3/SocialProofFlowWidget',
|
|
6
|
+
component: SocialProofFlowWidget,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
widgetConfigId: 'social-proof-test-widget-four-grid',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
widgetConfigId: {
|
|
13
|
+
control: 'select',
|
|
14
|
+
options: [
|
|
15
|
+
'social-proof-test-widget-four-grid',
|
|
16
|
+
'social-proof-test-widget-single',
|
|
17
|
+
'social-proof-test-widget-four-horizontal',
|
|
18
|
+
],
|
|
19
|
+
description:
|
|
20
|
+
'Unique identifier for the widget configuration. The widget will fetch the widget config based on this ID.',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
description: {
|
|
26
|
+
component:
|
|
27
|
+
'SocialProofFlowWidget is a widget wrapper around SocialProof, ChatPreviewLoading and ChatPreviewComparison that includes base widget functionality such as visibility tracking, widget config fetching and hardcopy content fetching. The widget automatically fetches social proof content (customer count, queries, images, prompt buttons) from hardcopy and widget config based on the widgetConfigId.',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
decorators: [
|
|
32
|
+
Story => (
|
|
33
|
+
<div
|
|
34
|
+
style={{
|
|
35
|
+
padding: '1rem',
|
|
36
|
+
maxWidth: '100%',
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<Story />
|
|
41
|
+
</div>
|
|
42
|
+
),
|
|
43
|
+
],
|
|
44
|
+
} satisfies Meta<typeof SocialProofFlowWidget>;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof meta>;
|
|
49
|
+
|
|
50
|
+
export const Playground: Story = {
|
|
51
|
+
parameters: {
|
|
52
|
+
docs: {
|
|
53
|
+
description: {
|
|
54
|
+
story:
|
|
55
|
+
'Experiment with different widgetConfigId values. The widget will fetch social proof content (customer count, queries, images, prompt buttons) from hardcopy content and widget config based on the widgetConfigId.',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const FourGrid: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
widgetConfigId: 'social-proof-test-widget-four-grid',
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Single: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
widgetConfigId: 'social-proof-test-widget-single',
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const FourHorizontal: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
widgetConfigId: 'social-proof-test-widget-four-horizontal',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SuggestionBar, SuggestionBarLocationForMetrics } from 'src/widgets-v2/SuggestionBar';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof SuggestionBar> = {
|
|
5
|
+
title: 'Widgets V2/SuggestionBar',
|
|
6
|
+
component: SuggestionBar,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
animationSpeed: {
|
|
13
|
+
control: 'select',
|
|
14
|
+
options: ['none', 'standard', 'slow'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
render: args => (
|
|
18
|
+
<div style={{ width: '300px', height: '100px' }}>
|
|
19
|
+
<SuggestionBar {...args} />
|
|
20
|
+
</div>
|
|
21
|
+
),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof SuggestionBar>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
id: 'suggestion-bar',
|
|
30
|
+
locationForMetrics: SuggestionBarLocationForMetrics.SUGGESTION_BAR_TOP,
|
|
31
|
+
buttonTexts: ['Button 1', 'Button 2', 'Button 3'],
|
|
32
|
+
buttonVariation: 'primary',
|
|
33
|
+
hoverButtonVariation: 'primary',
|
|
34
|
+
animationSpeed: 'none',
|
|
35
|
+
handleReply: () => {},
|
|
36
|
+
boldFirstButton: false,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Animated: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
...Default.args,
|
|
43
|
+
animationSpeed: 'standard',
|
|
44
|
+
},
|
|
45
|
+
};
|