@envive-ai/react-widgets-v3 0.3.15-beta.1 → 0.3.16
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/debug/chatEmbed.cjs +1 -1
- package/dist/debug/chatEmbed.js +1 -1
- package/dist/debug/reportIssue.cjs +1 -1
- package/dist/debug/reportIssue.js +1 -1
- package/dist/hocs/withBaseWidget/types.d.cts +3 -3
- package/dist/hocs/withBaseWidget/types.d.ts +3 -5
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchResults/SearchResults.d.ts +2 -3
- package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/index.d.ts +1 -2
- package/dist/packages/widgets/dist/SearchZeroState/types.d.ts +2 -2
- package/dist/packages/widgets/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
- package/dist/packages/widgets/dist/SuggestionButtonContainer/types.d.ts +2 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +36 -5
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +36 -5
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +34 -4
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +35 -5
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +0 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +0 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +3 -3
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +25 -3
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +25 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +23 -4
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +23 -4
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +53 -6
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +54 -7
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +10 -1
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +11 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +23 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +24 -3
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +2 -3
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/types.d.cts +2 -2
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +3 -3
- package/dist/widgets/dist/SuggestionButtonContainer/types.d.cts +2 -3
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
- package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
- package/dist/widgets/utils/functions.cjs +0 -14
- package/dist/widgets/utils/functions.js +1 -14
- package/dist/widgets-v2/SearchZeroState/index.d.cts +1 -2
- package/dist/widgets-v2/SearchZeroState/index.d.ts +1 -2
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +0 -1
- package/package.json +1 -1
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +59 -8
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +55 -7
- package/src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx +0 -6
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +37 -4
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +38 -8
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +3 -2
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +77 -7
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +23 -8
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +45 -10
- package/dist/hooks/dist/application/models/api/widgetText.d.cts +0 -8
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +0 -12
- package/dist/hooks/dist/contexts/types.d.cts +0 -38
- package/dist/hooks/dist/contexts/typesV3.d.cts +0 -239
- package/dist/hooks/dist/services/amplitudeService/eventNames.d.cts +0 -43
- package/dist/hooks/dist/types/customerService.d.cts +0 -21
- package/dist/packages/hooks/dist/application/models/api/orgConfigResults.d.ts +0 -1
- package/dist/packages/hooks/dist/application/models/api/widgetText.d.ts +0 -8
- package/dist/packages/hooks/dist/application/models/frontendConfig.d.ts +0 -1
- package/dist/packages/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/amplitudeContext/index.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +0 -2
- package/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +0 -14
- package/dist/packages/hooks/dist/contexts/hardcopyContext/index.d.ts +0 -1
- package/dist/packages/hooks/dist/contexts/types.d.ts +0 -42
- package/dist/packages/hooks/dist/contexts/typesV3.d.ts +0 -239
- package/dist/packages/hooks/dist/services/amplitudeService/amplitudeService.d.ts +0 -1
- package/dist/packages/hooks/dist/services/amplitudeService/eventNames.d.ts +0 -43
- package/dist/packages/hooks/dist/types/customerService.d.ts +0 -21
- package/dist/packages/widgets/dist/SuggestionButtonContainer/index.d.ts +0 -2
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/api/response.d.ts +0 -14
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/api/search.d.ts +0 -15
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +0 -73
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +0 -61
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +0 -25
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +0 -35
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +0 -32
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +0 -32
- package/dist/packages/widgets/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +0 -1
- package/dist/packages/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +0 -15
- package/dist/packages/widgets/dist/packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +0 -1
- package/dist/packages/widgets/dist/packages/hooks/dist/contexts/types.d.ts +0 -63
- package/dist/packages/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +0 -60
- package/dist/packages/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +0 -13
- package/dist/packages/widgets/dist/packages/hooks/dist/types/OrgInfo.d.ts +0 -1
- package/dist/packages/widgets/dist/packages/hooks/dist/types/index.d.ts +0 -1
- package/dist/packages/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +0 -28
- package/dist/packages/widgets/dist/packages/hooks/dist/types/test-types.d.ts +0 -10
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/response.d.cts +0 -14
- package/dist/widgets/dist/packages/hooks/dist/application/models/api/search.d.cts +0 -15
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.cts +0 -73
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +0 -61
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.cts +0 -25
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.cts +0 -35
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.cts +0 -32
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +0 -32
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +0 -14
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +0 -61
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +0 -60
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +0 -12
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +0 -28
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +0 -10
|
@@ -4,25 +4,29 @@ const require_functions = require('../utils/functions.cjs');
|
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
8
|
-
let jotai = require("jotai");
|
|
9
7
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
10
9
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
11
|
-
let
|
|
12
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
10
|
+
let jotai = require("jotai");
|
|
13
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
12
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
13
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
14
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
15
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
16
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
15
17
|
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
16
18
|
let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
|
|
17
19
|
let __envive_ai_react_toolkit_v3_SocialProof = require("@envive-ai/react-toolkit-v3/SocialProof");
|
|
20
|
+
let __envive_ai_react_hooks_hooks_ProductImageUrl = require("@envive-ai/react-hooks/hooks/ProductImageUrl");
|
|
18
21
|
|
|
19
22
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.tsx
|
|
20
23
|
const SocialProofWidgetHandler = (props) => {
|
|
21
24
|
const setChatPreviewLoadingData = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_widget.chatPreviewLoadingDataAtom);
|
|
22
25
|
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
23
26
|
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
24
|
-
const lastAssistantMessage = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.lastAssistantMessageAtom);
|
|
25
27
|
const variantInfo = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_app.variantInfoAtom);
|
|
28
|
+
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
29
|
+
const { onClick: onSuggestionClick, onHover, onDrag, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = (0, __envive_ai_react_toolkit_v3_PromptCarousel.usePromptCarouselAnalytics)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SOCIAL_PROOF, (text) => text);
|
|
26
30
|
const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
|
|
27
31
|
const socialProofWidgetConfig = widgetConfig;
|
|
28
32
|
const id = widgetConfig?.contentId;
|
|
@@ -50,7 +54,7 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
50
54
|
};
|
|
51
55
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
52
56
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
53
|
-
const dynamicImageUrl =
|
|
57
|
+
const dynamicImageUrl = (0, __envive_ai_react_hooks_hooks_ProductImageUrl.useProductImageUrl)(variantInfo.variant === __envive_ai_react_hooks_application_models.VariantTypeEnum.Pdp ? variantInfo.productId : void 0);
|
|
54
58
|
const images = socialProofWidgetConfig?.kind !== __envive_ai_react_toolkit_v3_SocialProof.WidgetKind.DYNAMIC ? socialProofWidgetConfig?.images : [{
|
|
55
59
|
src: dynamicImageUrl,
|
|
56
60
|
alt: "Product Image"
|
|
@@ -82,17 +86,53 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
82
86
|
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON
|
|
83
87
|
});
|
|
84
88
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON);
|
|
89
|
+
trackWidgetInteraction({
|
|
90
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
91
|
+
trigger: {
|
|
92
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SOCIAL_PROOF,
|
|
93
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.SUGGESTION_CLICKED,
|
|
94
|
+
widget_interaction_data: { suggestion_clicked: { suggestion_id: text } }
|
|
95
|
+
}
|
|
96
|
+
});
|
|
85
97
|
}, [onTypedMessageSubmitted, openChat]);
|
|
98
|
+
const handlePrimaryButtonHover = (0, react.useCallback)((text) => {
|
|
99
|
+
trackWidgetInteraction({
|
|
100
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
101
|
+
trigger: {
|
|
102
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SOCIAL_PROOF,
|
|
103
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.WIDGET_HOVERED,
|
|
104
|
+
widget_interaction_data: { suggestion_hovered: { suggestion_id: text } }
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}, []);
|
|
86
108
|
const handleSecondaryButtonClick = (0, react.useCallback)((text) => {
|
|
109
|
+
const rawValues = hardcopyContent?.rawValues;
|
|
110
|
+
const stringId = require_functions.getStringIdForText(rawValues, text);
|
|
111
|
+
trackEvent({
|
|
112
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetTextClicked,
|
|
113
|
+
eventProps: {
|
|
114
|
+
response_id: hardcopyContent?.responseId,
|
|
115
|
+
string_id: stringId,
|
|
116
|
+
text
|
|
117
|
+
}
|
|
118
|
+
});
|
|
87
119
|
onTypedMessageSubmitted({
|
|
88
120
|
query: text,
|
|
89
121
|
userTyped: false,
|
|
90
122
|
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON
|
|
91
123
|
});
|
|
92
124
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON);
|
|
125
|
+
onSuggestionClick(text);
|
|
93
126
|
}, [onTypedMessageSubmitted, openChat]);
|
|
94
127
|
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
95
128
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_TEXT_FIELD);
|
|
129
|
+
trackWidgetInteraction({
|
|
130
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
131
|
+
trigger: {
|
|
132
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.SOCIAL_PROOF,
|
|
133
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
134
|
+
}
|
|
135
|
+
});
|
|
96
136
|
}, [openChat]);
|
|
97
137
|
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
|
|
98
138
|
setChatPreviewLoadingData({
|
|
@@ -141,7 +181,14 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
141
181
|
widgetContentProps,
|
|
142
182
|
widgetEventProps: {
|
|
143
183
|
handlePrimaryButtonClick,
|
|
184
|
+
handlePrimaryButtonHover,
|
|
144
185
|
handleSecondaryButtonClick,
|
|
186
|
+
handleSecondaryButtonHover: onHover,
|
|
187
|
+
handleSecondaryButtonDrag: onDrag,
|
|
188
|
+
handleSecondaryButtonMouseDown: onMouseDown,
|
|
189
|
+
handleSecondaryButtonMouseUp: onMouseUp,
|
|
190
|
+
handleSecondaryButtonTouchStart: onTouchStart,
|
|
191
|
+
handleSecondaryButtonTouchEnd: onTouchEnd,
|
|
145
192
|
handleTextFieldClick
|
|
146
193
|
}
|
|
147
194
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
|
|
5
5
|
declare const SocialProofWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime17.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface SocialProofWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
|
|
|
12
12
|
declare const SocialProofWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: SocialProofWidgetProps):
|
|
15
|
+
}: SocialProofWidgetProps): react_jsx_runtime17.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
|
|
5
5
|
declare const SocialProofWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime6.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface SocialProofWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
|
|
|
12
12
|
declare const SocialProofWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: SocialProofWidgetProps):
|
|
15
|
+
}: SocialProofWidgetProps): react_jsx_runtime6.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getStringIdForText } from "../utils/functions.js";
|
|
3
3
|
import { useCallback, useEffect, useMemo } from "react";
|
|
4
4
|
import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
|
-
import { useAtomValue, useSetAtom } from "jotai";
|
|
8
6
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
7
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
9
8
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
|
-
import {
|
|
11
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
9
|
+
import { useAtomValue, useSetAtom } from "jotai";
|
|
12
10
|
import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
13
11
|
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
12
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
13
|
+
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
14
|
+
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
15
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
14
16
|
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
15
17
|
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
16
18
|
import { PageVariant, SocialProof, WidgetKind } from "@envive-ai/react-toolkit-v3/SocialProof";
|
|
19
|
+
import { useProductImageUrl } from "@envive-ai/react-hooks/hooks/ProductImageUrl";
|
|
17
20
|
|
|
18
21
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.tsx
|
|
19
22
|
const SocialProofWidgetHandler = (props) => {
|
|
20
23
|
const setChatPreviewLoadingData = useSetAtom(chatPreviewLoadingDataAtom);
|
|
21
24
|
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
22
25
|
const { openChat } = useChatToggle();
|
|
23
|
-
const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
|
|
24
26
|
const variantInfo = useAtomValue(variantInfoAtom);
|
|
27
|
+
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
28
|
+
const { onClick: onSuggestionClick, onHover, onDrag, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.SOCIAL_PROOF, (text) => text);
|
|
25
29
|
const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
|
|
26
30
|
const socialProofWidgetConfig = widgetConfig;
|
|
27
31
|
const id = widgetConfig?.contentId;
|
|
@@ -49,7 +53,7 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
49
53
|
};
|
|
50
54
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
51
55
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
52
|
-
const dynamicImageUrl =
|
|
56
|
+
const dynamicImageUrl = useProductImageUrl(variantInfo.variant === VariantTypeEnum.Pdp ? variantInfo.productId : void 0);
|
|
53
57
|
const images = socialProofWidgetConfig?.kind !== WidgetKind.DYNAMIC ? socialProofWidgetConfig?.images : [{
|
|
54
58
|
src: dynamicImageUrl,
|
|
55
59
|
alt: "Product Image"
|
|
@@ -81,17 +85,53 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
81
85
|
displayLocation: ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON
|
|
82
86
|
});
|
|
83
87
|
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON);
|
|
88
|
+
trackWidgetInteraction({
|
|
89
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
90
|
+
trigger: {
|
|
91
|
+
widget: WidgetInteractionComponent.SOCIAL_PROOF,
|
|
92
|
+
widget_interaction: WidgetInteractionType.SUGGESTION_CLICKED,
|
|
93
|
+
widget_interaction_data: { suggestion_clicked: { suggestion_id: text } }
|
|
94
|
+
}
|
|
95
|
+
});
|
|
84
96
|
}, [onTypedMessageSubmitted, openChat]);
|
|
97
|
+
const handlePrimaryButtonHover = useCallback((text) => {
|
|
98
|
+
trackWidgetInteraction({
|
|
99
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
100
|
+
trigger: {
|
|
101
|
+
widget: WidgetInteractionComponent.SOCIAL_PROOF,
|
|
102
|
+
widget_interaction: WidgetInteractionType.WIDGET_HOVERED,
|
|
103
|
+
widget_interaction_data: { suggestion_hovered: { suggestion_id: text } }
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}, []);
|
|
85
107
|
const handleSecondaryButtonClick = useCallback((text) => {
|
|
108
|
+
const rawValues = hardcopyContent?.rawValues;
|
|
109
|
+
const stringId = getStringIdForText(rawValues, text);
|
|
110
|
+
trackEvent({
|
|
111
|
+
eventName: EnviveMetricsEventName.WidgetTextClicked,
|
|
112
|
+
eventProps: {
|
|
113
|
+
response_id: hardcopyContent?.responseId,
|
|
114
|
+
string_id: stringId,
|
|
115
|
+
text
|
|
116
|
+
}
|
|
117
|
+
});
|
|
86
118
|
onTypedMessageSubmitted({
|
|
87
119
|
query: text,
|
|
88
120
|
userTyped: false,
|
|
89
121
|
displayLocation: ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON
|
|
90
122
|
});
|
|
91
123
|
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON);
|
|
124
|
+
onSuggestionClick(text);
|
|
92
125
|
}, [onTypedMessageSubmitted, openChat]);
|
|
93
126
|
const handleTextFieldClick = useCallback(() => {
|
|
94
127
|
openChat(ChatElementDisplayLocationV3.SOCIAL_PROOF_TEXT_FIELD);
|
|
128
|
+
trackWidgetInteraction({
|
|
129
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
130
|
+
trigger: {
|
|
131
|
+
widget: WidgetInteractionComponent.SOCIAL_PROOF,
|
|
132
|
+
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
133
|
+
}
|
|
134
|
+
});
|
|
95
135
|
}, [openChat]);
|
|
96
136
|
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
97
137
|
setChatPreviewLoadingData({
|
|
@@ -140,7 +180,14 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
140
180
|
widgetContentProps,
|
|
141
181
|
widgetEventProps: {
|
|
142
182
|
handlePrimaryButtonClick,
|
|
183
|
+
handlePrimaryButtonHover,
|
|
143
184
|
handleSecondaryButtonClick,
|
|
185
|
+
handleSecondaryButtonHover: onHover,
|
|
186
|
+
handleSecondaryButtonDrag: onDrag,
|
|
187
|
+
handleSecondaryButtonMouseDown: onMouseDown,
|
|
188
|
+
handleSecondaryButtonMouseUp: onMouseUp,
|
|
189
|
+
handleSecondaryButtonTouchStart: onTouchStart,
|
|
190
|
+
handleSecondaryButtonTouchEnd: onTouchEnd,
|
|
144
191
|
handleTextFieldClick
|
|
145
192
|
}
|
|
146
193
|
});
|
|
@@ -5,10 +5,11 @@ const require_functions = require('../utils/functions.cjs');
|
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
9
8
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
9
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
10
10
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
11
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
12
13
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
13
14
|
let __envive_ai_react_toolkit_v3_TitledPromptCarousel = require("@envive-ai/react-toolkit-v3/TitledPromptCarousel");
|
|
14
15
|
|
|
@@ -25,6 +26,7 @@ const TitledPromptCarouselWidgetHandler = (props) => {
|
|
|
25
26
|
const { onTypedMessageSubmitted } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
26
27
|
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
27
28
|
const { hardcopyContent, widgetConfig, isLoading, widgetConfigId } = props;
|
|
29
|
+
const { onClick, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = (0, __envive_ai_react_toolkit_v3_PromptCarousel.usePromptCarouselAnalytics)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET, (text) => text);
|
|
28
30
|
const hardCopyTitleLabel = hardcopyContent?.values?.titleLabel;
|
|
29
31
|
const titleLabel = isLoading ? mockTitleLabel : hardCopyTitleLabel;
|
|
30
32
|
const titleAriaLabel = hardcopyContent?.values?.titleAriaLabel;
|
|
@@ -73,7 +75,14 @@ const TitledPromptCarouselWidgetHandler = (props) => {
|
|
|
73
75
|
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL
|
|
74
76
|
});
|
|
75
77
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL);
|
|
78
|
+
onClick(text);
|
|
76
79
|
}, [onTypedMessageSubmitted, openChat]),
|
|
80
|
+
handleButtonDrag: onDrag,
|
|
81
|
+
handleButtonHover: onHover,
|
|
82
|
+
handleButtonMouseDown: onMouseDown,
|
|
83
|
+
handleButtonMouseUp: onMouseUp,
|
|
84
|
+
handleButtonTouchStart: onTouchStart,
|
|
85
|
+
handleButtonTouchEnd: onTouchEnd,
|
|
77
86
|
promptButtonTexts: buttonTexts,
|
|
78
87
|
promptCarouselAriaLabel
|
|
79
88
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
|
|
4
4
|
interface TitledPromptCarouselWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
|
|
|
7
7
|
declare const TitledPromptCarouselWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TitledPromptCarouselWidgetProps):
|
|
10
|
+
}: TitledPromptCarouselWidgetProps): react_jsx_runtime19.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
|
|
4
4
|
interface TitledPromptCarouselWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
|
|
|
7
7
|
declare const TitledPromptCarouselWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TitledPromptCarouselWidgetProps):
|
|
10
|
+
}: TitledPromptCarouselWidgetProps): react_jsx_runtime8.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -4,11 +4,12 @@ import { getStringIdForText } from "../utils/functions.js";
|
|
|
4
4
|
import { useCallback, useEffect } from "react";
|
|
5
5
|
import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
7
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
8
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
9
9
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
10
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
11
|
-
import {
|
|
11
|
+
import { WidgetInteractionComponent } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
12
|
+
import { AnimationSpeed, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
12
13
|
import { TitledPromptCarousel } from "@envive-ai/react-toolkit-v3/TitledPromptCarousel";
|
|
13
14
|
|
|
14
15
|
//#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx
|
|
@@ -24,6 +25,7 @@ const TitledPromptCarouselWidgetHandler = (props) => {
|
|
|
24
25
|
const { onTypedMessageSubmitted } = useSalesAgent();
|
|
25
26
|
const { openChat } = useChatToggle();
|
|
26
27
|
const { hardcopyContent, widgetConfig, isLoading, widgetConfigId } = props;
|
|
28
|
+
const { onClick, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.EMBEDDED_WIDGET, (text) => text);
|
|
27
29
|
const hardCopyTitleLabel = hardcopyContent?.values?.titleLabel;
|
|
28
30
|
const titleLabel = isLoading ? mockTitleLabel : hardCopyTitleLabel;
|
|
29
31
|
const titleAriaLabel = hardcopyContent?.values?.titleAriaLabel;
|
|
@@ -72,7 +74,14 @@ const TitledPromptCarouselWidgetHandler = (props) => {
|
|
|
72
74
|
displayLocation: ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL
|
|
73
75
|
});
|
|
74
76
|
openChat(ChatElementDisplayLocationV3.TITLED_PROMPT_CAROUSEL);
|
|
77
|
+
onClick(text);
|
|
75
78
|
}, [onTypedMessageSubmitted, openChat]),
|
|
79
|
+
handleButtonDrag: onDrag,
|
|
80
|
+
handleButtonHover: onHover,
|
|
81
|
+
handleButtonMouseDown: onMouseDown,
|
|
82
|
+
handleButtonMouseUp: onMouseUp,
|
|
83
|
+
handleButtonTouchStart: onTouchStart,
|
|
84
|
+
handleButtonTouchEnd: onTouchEnd,
|
|
76
85
|
promptButtonTexts: buttonTexts,
|
|
77
86
|
promptCarouselAriaLabel
|
|
78
87
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
|
|
4
4
|
interface TypingAnimationFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
|
|
|
7
7
|
declare const TypingAnimationFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TypingAnimationFlowWidgetProps):
|
|
10
|
+
}: TypingAnimationFlowWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
|
|
4
4
|
interface TypingAnimationFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
|
|
|
7
7
|
declare const TypingAnimationFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: TypingAnimationFlowWidgetProps):
|
|
10
|
+
}: TypingAnimationFlowWidgetProps): react_jsx_runtime3.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -5,15 +5,17 @@ const require_functions = require('../utils/functions.cjs');
|
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
9
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
9
10
|
let jotai = require("jotai");
|
|
10
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
11
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
13
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
12
14
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
13
15
|
let __envive_ai_react_hooks_atoms_chat_chatState = require("@envive-ai/react-hooks/atoms/chat/chatState");
|
|
14
16
|
let __envive_ai_react_toolkit_v3_PromptButton_types = require("@envive-ai/react-toolkit-v3/PromptButton/types");
|
|
15
|
-
let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
|
|
16
17
|
let __envive_ai_react_toolkit_v3_TypingAnimation = require("@envive-ai/react-toolkit-v3/TypingAnimation");
|
|
18
|
+
let __envive_ai_react_toolkit_v3_WidgetWrapper = require("@envive-ai/react-toolkit-v3/WidgetWrapper");
|
|
17
19
|
|
|
18
20
|
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx
|
|
19
21
|
const mockButtonTexts = [
|
|
@@ -47,6 +49,11 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
47
49
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
48
50
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
49
51
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
52
|
+
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
53
|
+
const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = (0, __envive_ai_react_toolkit_v3_PromptCarousel.usePromptCarouselAnalytics)(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET, (text) => {
|
|
54
|
+
const rawValues = hardcopyContent?.rawValues;
|
|
55
|
+
return require_functions.getStringIdForText(rawValues, text);
|
|
56
|
+
});
|
|
50
57
|
(0, react.useEffect)(() => {
|
|
51
58
|
trackEvent({
|
|
52
59
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
|
|
@@ -73,6 +80,7 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
73
80
|
displayLocation: __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION
|
|
74
81
|
});
|
|
75
82
|
onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
83
|
+
onPromptClicked(text);
|
|
76
84
|
}, [
|
|
77
85
|
hardcopyContent,
|
|
78
86
|
trackEvent,
|
|
@@ -81,6 +89,13 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
81
89
|
]);
|
|
82
90
|
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
83
91
|
onToggle(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
92
|
+
trackWidgetInteraction({
|
|
93
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
94
|
+
trigger: {
|
|
95
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.EMBEDDED_WIDGET,
|
|
96
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
97
|
+
}
|
|
98
|
+
});
|
|
84
99
|
}, [onToggle]);
|
|
85
100
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_TypingAnimation.TypingAnimation, {
|
|
86
101
|
baseProps: { id },
|
|
@@ -104,6 +119,12 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
104
119
|
},
|
|
105
120
|
widgetEventProps: {
|
|
106
121
|
handleButtonClick,
|
|
122
|
+
handleButtonDrag: onDrag,
|
|
123
|
+
handleButtonHover: onHover,
|
|
124
|
+
handleButtonMouseDown: onMouseDown,
|
|
125
|
+
handleButtonMouseUp: onMouseUp,
|
|
126
|
+
handleButtonTouchStart: onTouchStart,
|
|
127
|
+
handleButtonTouchEnd: onTouchEnd,
|
|
107
128
|
handleTextFieldClick
|
|
108
129
|
}
|
|
109
130
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
|
|
5
5
|
declare const TypingAnimationWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface TypingAnimationWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
|
|
|
12
12
|
declare const TypingAnimationWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: TypingAnimationWidgetProps):
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
|
|
5
5
|
declare const TypingAnimationWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface TypingAnimationWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
|
|
|
12
12
|
declare const TypingAnimationWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: TypingAnimationWidgetProps):
|
|
15
|
+
}: TypingAnimationWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -4,15 +4,17 @@ import { getStringIdForText } from "../utils/functions.js";
|
|
|
4
4
|
import { useCallback, useEffect } from "react";
|
|
5
5
|
import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
7
8
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
9
|
import { useSetAtom } from "jotai";
|
|
9
|
-
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
10
10
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
11
|
-
import {
|
|
11
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
12
|
+
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
13
|
+
import { PromptCarouselRows, usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
12
14
|
import { chatOnToggleAtom } from "@envive-ai/react-hooks/atoms/chat/chatState";
|
|
13
15
|
import { PromptButtonVariant } from "@envive-ai/react-toolkit-v3/PromptButton/types";
|
|
14
|
-
import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
|
|
15
16
|
import { TypingAnimation } from "@envive-ai/react-toolkit-v3/TypingAnimation";
|
|
17
|
+
import { WidgetWrapperVariant } from "@envive-ai/react-toolkit-v3/WidgetWrapper";
|
|
16
18
|
|
|
17
19
|
//#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx
|
|
18
20
|
const mockButtonTexts = [
|
|
@@ -46,6 +48,11 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
46
48
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
47
49
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
48
50
|
const { trackEvent } = useAmplitude();
|
|
51
|
+
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
52
|
+
const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.EMBEDDED_WIDGET, (text) => {
|
|
53
|
+
const rawValues = hardcopyContent?.rawValues;
|
|
54
|
+
return getStringIdForText(rawValues, text);
|
|
55
|
+
});
|
|
49
56
|
useEffect(() => {
|
|
50
57
|
trackEvent({
|
|
51
58
|
eventName: SpiffyMetricsEventName.ChatComponentVisible,
|
|
@@ -72,6 +79,7 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
72
79
|
displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION
|
|
73
80
|
});
|
|
74
81
|
onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
82
|
+
onPromptClicked(text);
|
|
75
83
|
}, [
|
|
76
84
|
hardcopyContent,
|
|
77
85
|
trackEvent,
|
|
@@ -80,6 +88,13 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
80
88
|
]);
|
|
81
89
|
const handleTextFieldClick = useCallback(() => {
|
|
82
90
|
onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
91
|
+
trackWidgetInteraction({
|
|
92
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
93
|
+
trigger: {
|
|
94
|
+
widget: WidgetInteractionComponent.EMBEDDED_WIDGET,
|
|
95
|
+
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
96
|
+
}
|
|
97
|
+
});
|
|
83
98
|
}, [onToggle]);
|
|
84
99
|
return /* @__PURE__ */ jsx(TypingAnimation, {
|
|
85
100
|
baseProps: { id },
|
|
@@ -103,6 +118,12 @@ const TypingAnimationWidgetHandler = (props) => {
|
|
|
103
118
|
},
|
|
104
119
|
widgetEventProps: {
|
|
105
120
|
handleButtonClick,
|
|
121
|
+
handleButtonDrag: onDrag,
|
|
122
|
+
handleButtonHover: onHover,
|
|
123
|
+
handleButtonMouseDown: onMouseDown,
|
|
124
|
+
handleButtonMouseUp: onMouseUp,
|
|
125
|
+
handleButtonTouchStart: onTouchStart,
|
|
126
|
+
handleButtonTouchEnd: onTouchEnd,
|
|
106
127
|
handleTextFieldClick
|
|
107
128
|
}
|
|
108
129
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { SearchResultsHocProps } from "../packages/hooks/dist/hooks/Search/useSearch.cjs";
|
|
2
1
|
import { SearchResultsEntryPointWidgetConfig } from "./types.cjs";
|
|
3
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { SearchResultsHocProps } from "@envive-ai/react-hooks/hooks/Search";
|
|
4
4
|
|
|
5
5
|
//#region ../widgets/dist/SearchResults/SearchResults.d.ts
|
|
6
|
-
|
|
7
6
|
//#region src/SearchResults/SearchResults.d.ts
|
|
8
7
|
interface SearchResultsProps extends SearchResultsHocProps {
|
|
9
8
|
widgetConfig: SearchResultsEntryPointWidgetConfig;
|
|
10
9
|
}
|
|
11
|
-
declare const SearchResults: (props: Omit<SearchResultsProps,
|
|
10
|
+
declare const SearchResults: (props: Omit<SearchResultsProps, string | number | symbol>) => react_jsx_runtime0.JSX.Element;
|
|
12
11
|
//#endregion
|
|
13
12
|
|
|
14
13
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region ../widgets/dist/SearchResults/SearchResultsWidget.d.ts
|
|
4
4
|
//#region src/SearchResults/SearchResultsWidget.d.ts
|
|
5
|
-
declare const SearchResultsWidget: () =>
|
|
5
|
+
declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region ../widgets/dist/SearchZeroState/SearchZeroStateWidget.d.ts
|
|
4
4
|
//#region src/SearchZeroState/SearchZeroStateWidget.d.ts
|
|
@@ -11,7 +11,7 @@ declare const SearchZeroStateWidget: ({
|
|
|
11
11
|
initialIsOpen,
|
|
12
12
|
widgetConfigId,
|
|
13
13
|
entryPointRef
|
|
14
|
-
}: SearchZeroStateWidgetProps) =>
|
|
14
|
+
}: SearchZeroStateWidgetProps) => react_jsx_runtime3.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchEntryPointWidgetConfig } from "
|
|
1
|
+
import { SearchEntryPointWidgetConfig, SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
2
2
|
|
|
3
3
|
//#region ../widgets/dist/SearchZeroState/types.d.ts
|
|
4
4
|
//#region src/SearchZeroState/types.d.ts
|
|
@@ -10,4 +10,4 @@ interface SearchZeroStateProps {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
|
-
export { SearchZeroStateProps };
|
|
13
|
+
export { type SearchEntryPointWidgetConfig, type SearchInputVariant, SearchZeroStateProps };
|