@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
package/dist/debug/chatEmbed.cjs
CHANGED
|
@@ -3,8 +3,8 @@ const require_MessageContent = require('./MessageContent.cjs');
|
|
|
3
3
|
let react = require("react");
|
|
4
4
|
react = require_rolldown_runtime.__toESM(react);
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let jotai = require("jotai");
|
|
7
6
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
7
|
+
let jotai = require("jotai");
|
|
8
8
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
9
9
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
10
10
|
let classnames = require("classnames");
|
package/dist/debug/chatEmbed.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MessageContent } from "./MessageContent.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useAtomValue } from "jotai";
|
|
5
4
|
import { chatAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
5
|
+
import { useAtomValue } from "jotai";
|
|
6
6
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
7
7
|
import { PromptCarousel, PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
8
8
|
import classNames from "classnames";
|
|
@@ -5,8 +5,8 @@ const require_GenericSelect = require('./GenericSelect.cjs');
|
|
|
5
5
|
const require_chatEmbed = require('./chatEmbed.cjs');
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let jotai = require("jotai");
|
|
9
8
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
|
+
let jotai = require("jotai");
|
|
10
10
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
11
11
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
12
12
|
let classnames = require("classnames");
|
|
@@ -3,8 +3,8 @@ import { GenericSelect } from "./GenericSelect.js";
|
|
|
3
3
|
import chatEmbed_default from "./chatEmbed.js";
|
|
4
4
|
import { useCallback, useEffect, useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { useAtomValue } from "jotai";
|
|
7
6
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
7
|
+
import { useAtomValue } from "jotai";
|
|
8
8
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
9
9
|
import { userIdAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
10
10
|
import { ReportSessionRequestReportPriorityEnum, ReportSessionRequestReportTypeEnum } from "@spiffy-ai/commerce-api-client";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SpiffyMetricsEventName } from "../../hooks/dist/services/amplitudeService/eventNames.cjs";
|
|
2
|
-
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "../../hooks/dist/contexts/typesV3.cjs";
|
|
3
|
-
import { HardcopyResponse } from "../../hooks/dist/contexts/hardcopyContext/hardcopyContext.cjs";
|
|
4
1
|
import { RefObject } from "react";
|
|
2
|
+
import { SpiffyMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
3
|
+
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
4
|
+
import { 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,7 @@
|
|
|
1
|
-
import { SpiffyMetricsEventName } from "../../packages/hooks/dist/services/amplitudeService/eventNames.js";
|
|
2
|
-
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "../../packages/hooks/dist/contexts/typesV3.js";
|
|
3
|
-
import { HardcopyResponse } from "../../packages/hooks/dist/contexts/hardcopyContext/hardcopyContext.js";
|
|
4
|
-
import "../../packages/hooks/dist/contexts/amplitudeContext/index.js";
|
|
5
|
-
import "../../packages/hooks/dist/contexts/hardcopyContext/index.js";
|
|
6
1
|
import { RefObject } from "react";
|
|
2
|
+
import { SpiffyMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
3
|
+
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
4
|
+
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
5
|
|
|
8
6
|
//#region src/hocs/withBaseWidget/types.d.ts
|
|
9
7
|
interface BaseWidgetProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 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_runtime10.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime19 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_runtime19.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { SearchResultsHocProps } from "../packages/hooks/dist/hooks/Search/useSearch.js";
|
|
2
1
|
import { SearchResultsEntryPointWidgetConfig } from "./types.js";
|
|
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,3 @@
|
|
|
1
|
-
import { SearchEntryPointWidgetConfig, SearchInputVariant } from "
|
|
2
|
-
import { SearchZeroStateProps } from "./types.js";
|
|
1
|
+
import { SearchEntryPointWidgetConfig, SearchInputVariant, SearchZeroStateProps } from "./types.js";
|
|
3
2
|
import { SearchZeroState } from "./SearchZeroState.js";
|
|
4
3
|
import { SearchZeroStateWidget } from "./SearchZeroStateWidget.js";
|
|
@@ -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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SuggestionButtonVariant } from "../packages/hooks/dist/contexts/types.js";
|
|
2
1
|
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
3
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
|
+
import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
4
4
|
import { Message } from "postcss";
|
|
5
5
|
|
|
6
6
|
//#region ../widgets/dist/SuggestionBar/SuggestionBar.d.ts
|
|
@@ -30,7 +30,7 @@ declare function SuggestionBar({
|
|
|
30
30
|
buttonBorderRadius,
|
|
31
31
|
handleReply,
|
|
32
32
|
dataTestId
|
|
33
|
-
}: Readonly<SuggestionBarProps>):
|
|
33
|
+
}: Readonly<SuggestionBarProps>): react_jsx_runtime2.JSX.Element;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#endregion
|
|
36
36
|
export { SuggestionBar };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../packages/hooks/dist/types/index.js";
|
|
1
|
+
import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
2
|
+
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
4
3
|
|
|
5
4
|
//#region ../widgets/dist/SuggestionButtonContainer/types.d.ts
|
|
6
5
|
//#region src/SuggestionButtonContainer/types.d.ts
|
|
@@ -3,21 +3,27 @@ const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget
|
|
|
3
3
|
const require_functions = require('../utils/functions.cjs');
|
|
4
4
|
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
5
5
|
let react = require("react");
|
|
6
|
+
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
let
|
|
8
|
-
let jotai = require("jotai");
|
|
8
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
9
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
10
11
|
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");
|
|
12
|
+
let jotai = require("jotai");
|
|
13
13
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
|
-
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
15
14
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
15
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
16
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
17
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
18
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
19
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
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_runtime7 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_runtime7.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_runtime7.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_runtime14 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_runtime14.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_runtime14.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -2,21 +2,27 @@ 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
4
|
import { useCallback, useMemo } from "react";
|
|
5
|
+
import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
7
|
-
import { useAtomValue } from "jotai";
|
|
7
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
8
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
9
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
9
10
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
|
-
import {
|
|
11
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
11
|
+
import { useAtomValue } from "jotai";
|
|
12
12
|
import { ChatElementDisplayLocationV3, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
13
|
-
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
14
13
|
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
14
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
15
|
+
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
16
|
+
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
17
|
+
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
18
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 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_runtime1.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_runtime1.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -5,13 +5,16 @@ const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/Ch
|
|
|
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
|
|
9
|
-
let jotai = require("jotai");
|
|
8
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
10
9
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
11
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
|
-
let
|
|
13
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
12
|
+
let jotai = require("jotai");
|
|
14
13
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
15
|
+
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
16
|
+
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
17
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
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_runtime11 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_runtime11.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_runtime11.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_runtime16 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_runtime16.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_runtime16.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -2,15 +2,18 @@ import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
|
2
2
|
import { getMessageText } from "../utils/functions.js";
|
|
3
3
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
4
|
import { useCallback, useEffect, useMemo } from "react";
|
|
5
|
-
import { SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
5
|
+
import { EnviveMetricsEventName, SpiffyMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
8
|
-
import { useAtomValue } from "jotai";
|
|
7
|
+
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
9
8
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
9
|
+
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
10
10
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
|
-
import {
|
|
12
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
11
|
+
import { useAtomValue } from "jotai";
|
|
13
12
|
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
13
|
+
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
14
|
+
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
15
|
+
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
16
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
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
|
});
|
|
@@ -2,7 +2,6 @@ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
3
|
let classnames = require("classnames");
|
|
4
4
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
5
|
-
let react_dom = require("react-dom");
|
|
6
5
|
let framer_motion = require("framer-motion");
|
|
7
6
|
|
|
8
7
|
//#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
|
|
@@ -60,7 +59,6 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
|
|
|
60
59
|
})]
|
|
61
60
|
}, "floating-chat-overlay") });
|
|
62
61
|
if (previewMode) return chatWrapper;
|
|
63
|
-
if (typeof document !== "undefined") return (0, react_dom.createPortal)(chatWrapper, document.body);
|
|
64
62
|
return chatWrapper;
|
|
65
63
|
};
|
|
66
64
|
FloatingChatOverlay.displayName = "FloatingChatOverlay";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
4
3
|
import { AnimatePresence, motion } from "framer-motion";
|
|
5
4
|
|
|
6
5
|
//#region src/widgets/FloatingChatWidget/FloatingChatOverlay.tsx
|
|
@@ -58,7 +57,6 @@ const FloatingChatOverlay = ({ children, isOpened, onClose, className, dataTestI
|
|
|
58
57
|
})]
|
|
59
58
|
}, "floating-chat-overlay") });
|
|
60
59
|
if (previewMode) return chatWrapper;
|
|
61
|
-
if (typeof document !== "undefined") return createPortal(chatWrapper, document.body);
|
|
62
60
|
return chatWrapper;
|
|
63
61
|
};
|
|
64
62
|
FloatingChatOverlay.displayName = "FloatingChatOverlay";
|