@envive-ai/react-widgets-v3 0.3.15 → 0.3.17
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 +1 -1
- package/dist/CXIntegration/hooks/useUnifiedCXButton.js +1 -1
- package/dist/debug/chatEmbed.cjs +2 -2
- package/dist/debug/chatEmbed.js +2 -2
- package/dist/debug/reportIssue.cjs +2 -2
- package/dist/debug/reportIssue.js +2 -2
- package/dist/hocs/withBaseWidget/types.d.ts +1 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/packages/icons/dist/IconCloseVariant.cjs +5 -6
- package/dist/packages/icons/dist/IconCloseVariant.js +4 -6
- package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- 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.cjs +1 -1
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +1 -1
- 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/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/FloatingChatWidget/hooks/useAutoPopup.cjs +1 -1
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +1 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +1 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +1 -1
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +1 -1
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +1 -1
- 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 +6 -6
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +6 -6
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +3 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +3 -3
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +7 -7
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +7 -7
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +25 -4
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +26 -5
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
- package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
- package/dist/widgets/utils/functions.cjs +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/package.json +3 -3
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +59 -8
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +55 -7
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +37 -4
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +45 -10
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +0 -27
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +0 -25
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +0 -696
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -696
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +0 -43
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -43
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +0 -1528
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +0 -1528
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +0 -329
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +0 -329
- package/dist/packages/icons/dist/node_modules/react/index.cjs +0 -13
- package/dist/packages/icons/dist/node_modules/react/index.js +0 -13
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +0 -13
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +0 -13
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PromptButtonVariant } from '@envive-ai/react-toolkit-v3/PromptButton/types';
|
|
3
|
-
import { useCallback, useEffect } from 'react';
|
|
1
|
+
import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application/models';
|
|
4
2
|
import {
|
|
5
3
|
EnviveMetricsEventName,
|
|
6
4
|
SpiffyMetricsEventName,
|
|
7
5
|
useAmplitude,
|
|
8
6
|
} from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
9
|
-
import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application/models';
|
|
10
7
|
import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
8
|
+
import { ProductCardWidgetV3Config, WidgetTypeV3 } from '@envive-ai/react-hooks/contexts/typesV3';
|
|
11
9
|
import { useChatToggle } from '@envive-ai/react-hooks/hooks/ChatToggle';
|
|
10
|
+
import { useWidgetInteraction } from '@envive-ai/react-hooks/hooks/WidgetInteraction';
|
|
11
|
+
import {
|
|
12
|
+
WidgetInteractionComponent,
|
|
13
|
+
WidgetInteractionType,
|
|
14
|
+
} from '@envive-ai/react-hooks/hooks/WidgetInteraction/types';
|
|
12
15
|
import { ProductCard } from '@envive-ai/react-toolkit-v3/ProductCard';
|
|
16
|
+
import { PromptButtonVariant } from '@envive-ai/react-toolkit-v3/PromptButton/types';
|
|
17
|
+
import { usePromptCarouselAnalytics } from '@envive-ai/react-toolkit-v3/PromptCarousel';
|
|
13
18
|
import { Theme } from '@envive-ai/react-toolkit-v3/Tokens';
|
|
19
|
+
import { useCallback, useEffect } from 'react';
|
|
14
20
|
import { BaseWidgetProps, withBaseWidget } from '../../hocs/withBaseWidget';
|
|
15
21
|
import { RawValues, getStringIdForText } from '../utils/functions';
|
|
16
22
|
|
|
@@ -52,6 +58,19 @@ const ProductCardWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
52
58
|
const imageSrc = productCardWidgetConfig?.imageSrc || '';
|
|
53
59
|
|
|
54
60
|
const { trackEvent } = useAmplitude();
|
|
61
|
+
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
62
|
+
const {
|
|
63
|
+
onClick: onSuggestionClick,
|
|
64
|
+
onDrag,
|
|
65
|
+
onHover,
|
|
66
|
+
onMouseDown,
|
|
67
|
+
onMouseUp,
|
|
68
|
+
onTouchStart,
|
|
69
|
+
onTouchEnd,
|
|
70
|
+
} = usePromptCarouselAnalytics(WidgetInteractionComponent.IMAGE_PROMPT_CARD, text => {
|
|
71
|
+
const rawValues = (hardcopyContent as { rawValues?: RawValues } | undefined)?.rawValues;
|
|
72
|
+
return getStringIdForText(rawValues, text);
|
|
73
|
+
});
|
|
55
74
|
|
|
56
75
|
const { widgetConfigId } = props;
|
|
57
76
|
useEffect(() => {
|
|
@@ -82,12 +101,20 @@ const ProductCardWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
82
101
|
displayLocation: ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON,
|
|
83
102
|
});
|
|
84
103
|
openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_PROMPT_BUTTON);
|
|
104
|
+
onSuggestionClick(text);
|
|
85
105
|
},
|
|
86
106
|
[hardcopyContent, onTypedMessageSubmitted, openChat, trackEvent],
|
|
87
107
|
);
|
|
88
108
|
|
|
89
109
|
const handleInputClick = useCallback(() => {
|
|
90
110
|
openChat(ChatElementDisplayLocationV3.PRODUCT_CARD_TEXT_FIELD);
|
|
111
|
+
trackWidgetInteraction({
|
|
112
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
113
|
+
trigger: {
|
|
114
|
+
widget: WidgetInteractionComponent.IMAGE_PROMPT_CARD,
|
|
115
|
+
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
91
118
|
}, [openChat]);
|
|
92
119
|
|
|
93
120
|
return (
|
|
@@ -105,6 +132,12 @@ const ProductCardWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
105
132
|
textTypingDuration={800}
|
|
106
133
|
textTransition={2000}
|
|
107
134
|
onSelect={handleSelect}
|
|
135
|
+
onDrag={onDrag}
|
|
136
|
+
onHover={onHover}
|
|
137
|
+
onMouseDown={onMouseDown}
|
|
138
|
+
onMouseUp={onMouseUp}
|
|
139
|
+
onTouchStart={onTouchStart}
|
|
140
|
+
onTouchEnd={onTouchEnd}
|
|
108
141
|
onInputClick={handleInputClick}
|
|
109
142
|
/>
|
|
110
143
|
);
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TypingAnimationWidgetV3Config,
|
|
3
|
-
WidgetTypeV3,
|
|
4
|
-
} from '@envive-ai/react-hooks/contexts/typesV3';
|
|
5
|
-
import { PromptButtonVariant } from '@envive-ai/react-toolkit-v3/PromptButton/types';
|
|
6
|
-
import { WidgetWrapperVariant } from '@envive-ai/react-toolkit-v3/WidgetWrapper';
|
|
7
|
-
import { useCallback, useEffect } from 'react';
|
|
8
1
|
import { ChatElementDisplayLocationV3 } from '@envive-ai/react-hooks/application/models';
|
|
2
|
+
import { chatOnToggleAtom } from '@envive-ai/react-hooks/atoms/chat/chatState';
|
|
9
3
|
import {
|
|
10
4
|
EnviveMetricsEventName,
|
|
11
5
|
SpiffyMetricsEventName,
|
|
12
6
|
useAmplitude,
|
|
13
7
|
} from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
14
|
-
import { useSetAtom } from 'jotai';
|
|
15
8
|
import { useSalesAgent } from '@envive-ai/react-hooks/contexts/salesAgentContext';
|
|
16
|
-
import {
|
|
17
|
-
|
|
9
|
+
import {
|
|
10
|
+
TypingAnimationWidgetV3Config,
|
|
11
|
+
WidgetTypeV3,
|
|
12
|
+
} from '@envive-ai/react-hooks/contexts/typesV3';
|
|
13
|
+
import { useWidgetInteraction } from '@envive-ai/react-hooks/hooks/WidgetInteraction';
|
|
14
|
+
import {
|
|
15
|
+
WidgetInteractionComponent,
|
|
16
|
+
WidgetInteractionType,
|
|
17
|
+
} from '@envive-ai/react-hooks/hooks/WidgetInteraction/types';
|
|
18
|
+
import { PromptButtonVariant } from '@envive-ai/react-toolkit-v3/PromptButton/types';
|
|
19
|
+
import {
|
|
20
|
+
PromptCarouselRows,
|
|
21
|
+
usePromptCarouselAnalytics,
|
|
22
|
+
} from '@envive-ai/react-toolkit-v3/PromptCarousel';
|
|
18
23
|
import { TypingAnimation } from '@envive-ai/react-toolkit-v3/TypingAnimation';
|
|
24
|
+
import { WidgetWrapperVariant } from '@envive-ai/react-toolkit-v3/WidgetWrapper';
|
|
25
|
+
import { useSetAtom } from 'jotai';
|
|
26
|
+
import { useCallback, useEffect } from 'react';
|
|
19
27
|
import { BaseWidgetProps, withBaseWidget } from '../../hocs/withBaseWidget';
|
|
20
28
|
import { RawValues, getStringIdForText } from '../utils/functions';
|
|
21
29
|
|
|
@@ -64,6 +72,19 @@ const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
64
72
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
65
73
|
|
|
66
74
|
const { trackEvent } = useAmplitude();
|
|
75
|
+
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
76
|
+
const {
|
|
77
|
+
onClick: onPromptClicked,
|
|
78
|
+
onDrag,
|
|
79
|
+
onHover,
|
|
80
|
+
onMouseDown,
|
|
81
|
+
onMouseUp,
|
|
82
|
+
onTouchStart,
|
|
83
|
+
onTouchEnd,
|
|
84
|
+
} = usePromptCarouselAnalytics(WidgetInteractionComponent.EMBEDDED_WIDGET, text => {
|
|
85
|
+
const rawValues = (hardcopyContent as { rawValues?: RawValues } | undefined)?.rawValues;
|
|
86
|
+
return getStringIdForText(rawValues, text);
|
|
87
|
+
});
|
|
67
88
|
|
|
68
89
|
useEffect(() => {
|
|
69
90
|
trackEvent({
|
|
@@ -93,12 +114,20 @@ const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
93
114
|
displayLocation: ChatElementDisplayLocationV3.TYPING_ANIMATION,
|
|
94
115
|
});
|
|
95
116
|
onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
117
|
+
onPromptClicked(text);
|
|
96
118
|
},
|
|
97
119
|
[hardcopyContent, trackEvent, onTypedMessageSubmitted, onToggle],
|
|
98
120
|
);
|
|
99
121
|
|
|
100
122
|
const handleTextFieldClick = useCallback(() => {
|
|
101
123
|
onToggle(ChatElementDisplayLocationV3.TYPING_ANIMATION);
|
|
124
|
+
trackWidgetInteraction({
|
|
125
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
126
|
+
trigger: {
|
|
127
|
+
widget: WidgetInteractionComponent.EMBEDDED_WIDGET,
|
|
128
|
+
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
102
131
|
}, [onToggle]);
|
|
103
132
|
|
|
104
133
|
return (
|
|
@@ -126,6 +155,12 @@ const TypingAnimationWidgetHandler = (props: BaseWidgetProps) => {
|
|
|
126
155
|
}}
|
|
127
156
|
widgetEventProps={{
|
|
128
157
|
handleButtonClick,
|
|
158
|
+
handleButtonDrag: onDrag,
|
|
159
|
+
handleButtonHover: onHover,
|
|
160
|
+
handleButtonMouseDown: onMouseDown,
|
|
161
|
+
handleButtonMouseUp: onMouseUp,
|
|
162
|
+
handleButtonTouchStart: onTouchStart,
|
|
163
|
+
handleButtonTouchEnd: onTouchEnd,
|
|
129
164
|
handleTextFieldClick,
|
|
130
165
|
}}
|
|
131
166
|
/>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../icons/dist/_virtual/rolldown_runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
-
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
value: mod,
|
|
22
|
-
enumerable: true
|
|
23
|
-
}) : target, mod));
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
exports.__commonJSMin = __commonJSMin;
|
|
27
|
-
exports.__toESM = __toESM;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region ../icons/dist/_virtual/rolldown_runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { __commonJSMin, __toESM };
|