@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,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_types = require('../types.cjs');
|
|
3
3
|
const require_functions = require('../utils/functions.cjs');
|
|
4
|
-
let __envive_ai_react_hooks_contexts_pageContext = require("@envive-ai/react-hooks/contexts/pageContext");
|
|
5
4
|
let jotai = require("jotai");
|
|
5
|
+
let __envive_ai_react_hooks_contexts_pageContext = require("@envive-ai/react-hooks/contexts/pageContext");
|
|
6
6
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
7
7
|
|
|
8
8
|
//#region src/CXIntegration/hooks/useUnifiedCXButton.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CustomerServiceType } from "../types.js";
|
|
2
2
|
import { findCustomerServiceImpl } from "../utils/functions.js";
|
|
3
|
-
import { usePage } from "@envive-ai/react-hooks/contexts/pageContext";
|
|
4
3
|
import { useAtomValue } from "jotai";
|
|
4
|
+
import { usePage } from "@envive-ai/react-hooks/contexts/pageContext";
|
|
5
5
|
import { hasParsedVariantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
6
6
|
|
|
7
7
|
//#region src/CXIntegration/hooks/useUnifiedCXButton.ts
|
package/dist/debug/chatEmbed.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_MessageContent = require('./MessageContent.cjs');
|
|
3
|
+
let jotai = require("jotai");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
react = require_rolldown_runtime.__toESM(react);
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let jotai = require("jotai");
|
|
7
|
-
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
8
7
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
9
8
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
9
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
10
10
|
let classnames = require("classnames");
|
|
11
11
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
12
12
|
|
package/dist/debug/chatEmbed.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MessageContent } from "./MessageContent.js";
|
|
2
|
+
import { useAtomValue } from "jotai";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useAtomValue } from "jotai";
|
|
5
|
-
import { chatAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
6
5
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
7
6
|
import { PromptCarousel, PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
7
|
+
import { chatAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
|
|
10
10
|
//#region src/debug/chatEmbed.tsx
|
|
@@ -3,11 +3,11 @@ const require_index = require('../node_modules/@spiffy-ai/commerce-api-client/di
|
|
|
3
3
|
const require_IconCloseVariant = require('../packages/icons/dist/IconCloseVariant.cjs');
|
|
4
4
|
const require_GenericSelect = require('./GenericSelect.cjs');
|
|
5
5
|
const require_chatEmbed = require('./chatEmbed.cjs');
|
|
6
|
+
let jotai = require("jotai");
|
|
6
7
|
let react = require("react");
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let jotai = require("jotai");
|
|
9
|
-
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
10
9
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
11
11
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
12
12
|
let classnames = require("classnames");
|
|
13
13
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IconCloseVariant_default } from "../packages/icons/dist/IconCloseVariant.js";
|
|
2
2
|
import { GenericSelect } from "./GenericSelect.js";
|
|
3
3
|
import chatEmbed_default from "./chatEmbed.js";
|
|
4
|
+
import { useAtomValue } from "jotai";
|
|
4
5
|
import { useCallback, useEffect, useState } from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { useAtomValue } from "jotai";
|
|
7
|
-
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
7
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
8
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
9
9
|
import { userIdAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
10
10
|
import { ReportSessionRequestReportPriorityEnum, ReportSessionRequestReportTypeEnum } from "@spiffy-ai/commerce-api-client";
|
|
11
11
|
import classNames from "classnames";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
1
2
|
import { RefObject } from "react";
|
|
2
3
|
import { SpiffyMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
3
4
|
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
4
|
-
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
5
5
|
|
|
6
6
|
//#region src/hocs/withBaseWidget/types.d.ts
|
|
7
7
|
interface BaseWidgetProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/hocs/withBaseWidget/withBaseWidget.d.ts
|
|
5
5
|
declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
|
|
6
|
-
(props: P):
|
|
6
|
+
(props: P): react_jsx_runtime11.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('
|
|
2
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
3
|
|
|
4
4
|
//#region ../icons/dist/IconCloseVariant.js
|
|
5
|
-
|
|
6
|
-
const SvgIconCloseVariant = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
5
|
+
const SvgIconCloseVariant = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
7
6
|
viewBox: "0 0 24 24",
|
|
8
7
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9
8
|
...props,
|
|
10
|
-
children: /* @__PURE__ */ (0,
|
|
9
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", {
|
|
11
10
|
className: "layer",
|
|
12
|
-
children: [/* @__PURE__ */ (0,
|
|
11
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: "Layer 1" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
13
12
|
d: "m18.98,2.56l-6.76,6.76l-6.76,-6.76l-2.65,2.65l6.76,6.76l-6.76,6.76l2.65,2.65l6.76,-6.76l6.76,6.76l2.65,-2.65l-6.76,-6.76l6.76,-6.76l-2.65,-2.65z",
|
|
14
13
|
fill: "currentColor",
|
|
15
14
|
id: "svg_2"
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { require_jsx_runtime } from "./node_modules/react/jsx-runtime.js";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
|
|
4
3
|
//#region ../icons/dist/IconCloseVariant.js
|
|
5
|
-
|
|
6
|
-
const SvgIconCloseVariant = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
4
|
+
const SvgIconCloseVariant = (props) => /* @__PURE__ */ jsx("svg", {
|
|
7
5
|
viewBox: "0 0 24 24",
|
|
8
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9
7
|
...props,
|
|
10
|
-
children: /* @__PURE__ */
|
|
8
|
+
children: /* @__PURE__ */ jsxs("g", {
|
|
11
9
|
className: "layer",
|
|
12
|
-
children: [/* @__PURE__ */
|
|
10
|
+
children: [/* @__PURE__ */ jsx("title", { children: "Layer 1" }), /* @__PURE__ */ jsx("path", {
|
|
13
11
|
d: "m18.98,2.56l-6.76,6.76l-6.76,-6.76l-2.65,2.65l6.76,6.76l-6.76,6.76l2.65,2.65l6.76,-6.76l6.76,6.76l2.65,-2.65l-6.76,-6.76l6.76,-6.76l-2.65,-2.65z",
|
|
14
12
|
fill: "currentColor",
|
|
15
13
|
id: "svg_2"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 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_runtime0.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -2,22 +2,28 @@ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
const require_functions = require('../utils/functions.cjs');
|
|
4
4
|
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
5
|
-
let react = require("react");
|
|
6
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
5
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
8
6
|
let jotai = require("jotai");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
9
11
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
12
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
11
|
-
let
|
|
13
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
14
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
12
15
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
13
|
-
let
|
|
14
|
-
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
16
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
15
17
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
18
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
19
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
16
20
|
|
|
17
21
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
18
22
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
19
23
|
const { onSuggestionClicked } = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
|
|
20
24
|
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
25
|
+
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
26
|
+
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.POST_INTERACTION_COMPARISON, (text) => text);
|
|
21
27
|
const lastAssistantMessage = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.lastAssistantMessageAtom);
|
|
22
28
|
const variantInfo = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_app.variantInfoAtom);
|
|
23
29
|
const productId = variantInfo.variant === __envive_ai_react_hooks_application_models.VariantTypeEnum.Pdp ? variantInfo.productId : void 0;
|
|
@@ -42,10 +48,28 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
42
48
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
43
49
|
onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
44
50
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
51
|
+
onPromptClicked(suggestion.id);
|
|
45
52
|
}, [onSuggestionClicked, openChat]);
|
|
46
53
|
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
47
54
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_TEXT_FIELD);
|
|
55
|
+
trackWidgetInteraction({
|
|
56
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
57
|
+
trigger: {
|
|
58
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
59
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
60
|
+
}
|
|
61
|
+
});
|
|
48
62
|
}, [openChat]);
|
|
63
|
+
const handleLinkClick = (url) => {
|
|
64
|
+
trackWidgetInteraction({
|
|
65
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
66
|
+
trigger: {
|
|
67
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
68
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.LINK_CLICKED,
|
|
69
|
+
widget_interaction_data: { link_clicked: { url } }
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
49
73
|
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
50
74
|
widgetConfigId,
|
|
51
75
|
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
|
|
@@ -73,6 +97,13 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
73
97
|
widgetContentProps,
|
|
74
98
|
widgetEventProps: {
|
|
75
99
|
handlePromptButtonClick,
|
|
100
|
+
handlePromptButtonDrag: onDrag,
|
|
101
|
+
handlePromptButtonHover: onHover,
|
|
102
|
+
handlePromptButtonMouseDown: onMouseDown,
|
|
103
|
+
handlePromptButtonMouseUp: onMouseUp,
|
|
104
|
+
handlePromptButtonTouchStart: onTouchStart,
|
|
105
|
+
handlePromptButtonTouchEnd: onTouchEnd,
|
|
106
|
+
handleLinkClick,
|
|
76
107
|
handleTextFieldClick
|
|
77
108
|
}
|
|
78
109
|
});
|
|
@@ -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/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewComparisonWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewComparisonWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewComparisonWidgetProps):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): 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_runtime9 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
|
|
5
5
|
declare const ChatPreviewComparisonWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewComparisonWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewComparisonWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewComparisonWidgetProps):
|
|
15
|
+
}: ChatPreviewComparisonWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import { getMessageText, getRecentProductImageUrls } from "../utils/functions.js";
|
|
3
3
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
|
-
import { useCallback, useMemo } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
4
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
5
|
import { useAtomValue } from "jotai";
|
|
6
|
+
import { useCallback, useMemo } from "react";
|
|
7
|
+
import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
8
10
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
9
11
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
|
-
import {
|
|
12
|
+
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
13
|
+
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
11
14
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
12
|
-
import {
|
|
13
|
-
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
15
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
14
16
|
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
17
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
18
|
+
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
15
19
|
|
|
16
20
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
17
21
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
18
22
|
const { onSuggestionClicked } = useSalesAgent();
|
|
19
23
|
const { openChat } = useChatToggle();
|
|
24
|
+
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
25
|
+
const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.POST_INTERACTION_COMPARISON, (text) => text);
|
|
20
26
|
const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
|
|
21
27
|
const variantInfo = useAtomValue(variantInfoAtom);
|
|
22
28
|
const productId = variantInfo.variant === VariantTypeEnum.Pdp ? variantInfo.productId : void 0;
|
|
@@ -41,10 +47,28 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
41
47
|
const handlePromptButtonClick = useCallback((suggestion) => {
|
|
42
48
|
onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
43
49
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
50
|
+
onPromptClicked(suggestion.id);
|
|
44
51
|
}, [onSuggestionClicked, openChat]);
|
|
45
52
|
const handleTextFieldClick = useCallback(() => {
|
|
46
53
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_TEXT_FIELD);
|
|
54
|
+
trackWidgetInteraction({
|
|
55
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
56
|
+
trigger: {
|
|
57
|
+
widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
58
|
+
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
59
|
+
}
|
|
60
|
+
});
|
|
47
61
|
}, [openChat]);
|
|
62
|
+
const handleLinkClick = (url) => {
|
|
63
|
+
trackWidgetInteraction({
|
|
64
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
65
|
+
trigger: {
|
|
66
|
+
widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
67
|
+
widget_interaction: WidgetInteractionType.LINK_CLICKED,
|
|
68
|
+
widget_interaction_data: { link_clicked: { url } }
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
48
72
|
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
49
73
|
widgetConfigId,
|
|
50
74
|
widgetType: WidgetTypeV3.ChatPreviewLoadingV3
|
|
@@ -72,6 +96,13 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
72
96
|
widgetContentProps,
|
|
73
97
|
widgetEventProps: {
|
|
74
98
|
handlePromptButtonClick,
|
|
99
|
+
handlePromptButtonDrag: onDrag,
|
|
100
|
+
handlePromptButtonHover: onHover,
|
|
101
|
+
handlePromptButtonMouseDown: onMouseDown,
|
|
102
|
+
handlePromptButtonMouseUp: onMouseUp,
|
|
103
|
+
handlePromptButtonTouchStart: onTouchStart,
|
|
104
|
+
handlePromptButtonTouchEnd: onTouchEnd,
|
|
105
|
+
handleLinkClick,
|
|
75
106
|
handleTextFieldClick
|
|
76
107
|
}
|
|
77
108
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
const require_PromptCarouselWidget = require('../PromptCarouselWidget/PromptCarouselWidget.cjs');
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
4
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
6
5
|
let jotai = require("jotai");
|
|
7
6
|
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
8
7
|
let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
|
|
10
10
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
11
11
|
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
|
|
5
5
|
declare const ChatPreviewLoadingWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime15.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewLoadingWidgetProps {
|
|
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const ChatPreviewLoadingWidget: ({
|
|
13
13
|
widgetConfigId
|
|
14
|
-
}: ChatPreviewLoadingWidgetProps) =>
|
|
14
|
+
}: ChatPreviewLoadingWidgetProps) => react_jsx_runtime15.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import { PromptCarouselWidget } from "../PromptCarouselWidget/PromptCarouselWidget.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
5
4
|
import { useAtomValue } from "jotai";
|
|
6
5
|
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
7
6
|
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
10
10
|
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
@@ -2,16 +2,19 @@ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
const require_functions = require('../utils/functions.cjs');
|
|
4
4
|
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
5
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
6
|
+
let jotai = require("jotai");
|
|
5
7
|
let react = require("react");
|
|
6
8
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let
|
|
9
|
-
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
11
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
11
12
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
|
-
let
|
|
13
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
14
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
13
15
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
14
|
-
let
|
|
16
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
17
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
15
18
|
let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
|
|
16
19
|
|
|
17
20
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
@@ -31,6 +34,8 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
31
34
|
messageText
|
|
32
35
|
};
|
|
33
36
|
const { trackEvent } = (0, __envive_ai_react_hooks_contexts_amplitudeContext.useAmplitude)();
|
|
37
|
+
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
38
|
+
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.CHAT_PREVIEW, (text) => text);
|
|
34
39
|
(0, react.useEffect)(() => {
|
|
35
40
|
trackEvent({
|
|
36
41
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ChatComponentVisible,
|
|
@@ -45,10 +50,28 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
45
50
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
46
51
|
onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
47
52
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
53
|
+
onPromptClicked(suggestion.id);
|
|
48
54
|
}, [onSuggestionClicked, openChat]);
|
|
49
55
|
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
50
56
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
|
|
57
|
+
trackWidgetInteraction({
|
|
58
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
59
|
+
trigger: {
|
|
60
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW,
|
|
61
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
62
|
+
}
|
|
63
|
+
});
|
|
51
64
|
}, [openChat]);
|
|
65
|
+
const handleLinkClick = (url) => {
|
|
66
|
+
trackWidgetInteraction({
|
|
67
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
68
|
+
trigger: {
|
|
69
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW,
|
|
70
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.LINK_CLICKED,
|
|
71
|
+
widget_interaction_data: { link_clicked: { url } }
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
52
75
|
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatPreviewLoadingWidget.ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
53
76
|
widgetConfigId,
|
|
54
77
|
widgetType: __envive_ai_react_hooks_contexts_typesV3.WidgetTypeV3.ChatPreviewLoadingV3
|
|
@@ -73,6 +96,13 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
73
96
|
widgetContentProps,
|
|
74
97
|
widgetEventProps: {
|
|
75
98
|
handlePromptButtonClick,
|
|
99
|
+
handlePromptButtonDrag: onDrag,
|
|
100
|
+
handlePromptButtonHover: onHover,
|
|
101
|
+
handlePromptButtonMouseDown: onMouseDown,
|
|
102
|
+
handlePromptButtonMouseUp: onMouseUp,
|
|
103
|
+
handlePromptButtonTouchStart: onTouchStart,
|
|
104
|
+
handlePromptButtonTouchEnd: onTouchEnd,
|
|
105
|
+
handleLinkClick,
|
|
76
106
|
handleTextFieldClick
|
|
77
107
|
}
|
|
78
108
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewWidgetProps):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime4.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_runtime13 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
|
|
5
5
|
declare const ChatPreviewWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime13.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface ChatPreviewWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
|
|
|
12
12
|
declare const ChatPreviewWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: ChatPreviewWidgetProps):
|
|
15
|
+
}: ChatPreviewWidgetProps): react_jsx_runtime13.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import { getMessageText } from "../utils/functions.js";
|
|
3
3
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
|
-
import { useCallback, useEffect, useMemo } from "react";
|
|
5
|
-
import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
4
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
8
5
|
import { useAtomValue } from "jotai";
|
|
6
|
+
import { useCallback, useEffect, useMemo } from "react";
|
|
7
|
+
import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
9
10
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
10
11
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
|
-
import {
|
|
12
|
+
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
13
|
+
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
12
14
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
13
|
-
import {
|
|
15
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
16
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
14
17
|
import { ChatPreview } from "@envive-ai/react-toolkit-v3/ChatPreview";
|
|
15
18
|
|
|
16
19
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
@@ -30,6 +33,8 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
30
33
|
messageText
|
|
31
34
|
};
|
|
32
35
|
const { trackEvent } = useAmplitude();
|
|
36
|
+
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
37
|
+
const { onClick: onPromptClicked, onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.CHAT_PREVIEW, (text) => text);
|
|
33
38
|
useEffect(() => {
|
|
34
39
|
trackEvent({
|
|
35
40
|
eventName: SpiffyMetricsEventName.ChatComponentVisible,
|
|
@@ -44,10 +49,28 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
44
49
|
const handlePromptButtonClick = useCallback((suggestion) => {
|
|
45
50
|
onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
46
51
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
52
|
+
onPromptClicked(suggestion.id);
|
|
47
53
|
}, [onSuggestionClicked, openChat]);
|
|
48
54
|
const handleTextFieldClick = useCallback(() => {
|
|
49
55
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
|
|
56
|
+
trackWidgetInteraction({
|
|
57
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
58
|
+
trigger: {
|
|
59
|
+
widget: WidgetInteractionComponent.CHAT_PREVIEW,
|
|
60
|
+
widget_interaction: WidgetInteractionType.QUERY_INPUT_CLICKED
|
|
61
|
+
}
|
|
62
|
+
});
|
|
50
63
|
}, [openChat]);
|
|
64
|
+
const handleLinkClick = (url) => {
|
|
65
|
+
trackWidgetInteraction({
|
|
66
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
67
|
+
trigger: {
|
|
68
|
+
widget: WidgetInteractionComponent.CHAT_PREVIEW,
|
|
69
|
+
widget_interaction: WidgetInteractionType.LINK_CLICKED,
|
|
70
|
+
widget_interaction_data: { link_clicked: { url } }
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
51
74
|
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
52
75
|
widgetConfigId,
|
|
53
76
|
widgetType: WidgetTypeV3.ChatPreviewLoadingV3
|
|
@@ -72,6 +95,13 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
72
95
|
widgetContentProps,
|
|
73
96
|
widgetEventProps: {
|
|
74
97
|
handlePromptButtonClick,
|
|
98
|
+
handlePromptButtonDrag: onDrag,
|
|
99
|
+
handlePromptButtonHover: onHover,
|
|
100
|
+
handlePromptButtonMouseDown: onMouseDown,
|
|
101
|
+
handlePromptButtonMouseUp: onMouseUp,
|
|
102
|
+
handlePromptButtonTouchStart: onTouchStart,
|
|
103
|
+
handlePromptButtonTouchEnd: onTouchEnd,
|
|
104
|
+
handleLinkClick,
|
|
75
105
|
handleTextFieldClick
|
|
76
106
|
}
|
|
77
107
|
});
|
|
@@ -9,15 +9,15 @@ const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
|
9
9
|
const require_FloatingChatOverlay = require('./FloatingChatOverlay.cjs');
|
|
10
10
|
const require_useFloatingButtonVisibility = require('./hooks/useFloatingButtonVisibility.cjs');
|
|
11
11
|
const require_useAutoPopup = require('./hooks/useAutoPopup.cjs');
|
|
12
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
12
13
|
let react = require("react");
|
|
13
14
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
14
15
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
|
-
let
|
|
16
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
16
17
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
17
18
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
18
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
19
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
20
19
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
20
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
21
21
|
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
22
22
|
let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
|
|
23
23
|
|