@envive-ai/react-widgets-v3 0.3.22 → 0.3.24
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/MessageContent.cjs +1 -1
- package/dist/debug/MessageContent.js +1 -1
- package/dist/debug/chatEmbed.cjs +3 -3
- 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.cjs +1 -1
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.js +1 -1
- 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/SuggestionBar/SuggestionBar.d.ts +2 -2
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +31 -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 +32 -6
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs +14 -6
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js +14 -6
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +31 -5
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +32 -6
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +19 -9
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +7 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +7 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +20 -10
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +2 -2
- package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +2 -2
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +2 -3
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +3 -4
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +8 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +8 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +31 -5
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +32 -6
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +31 -5
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +32 -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 +1 -1
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +1 -1
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +32 -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 +33 -7
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +3 -3
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +3 -3
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +1 -1
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +1 -1
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +32 -6
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +33 -7
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
- package/dist/widgets/hooks/useGetWidgetStatus.cjs +1 -1
- package/dist/widgets/hooks/useGetWidgetStatus.js +1 -1
- package/package.json +1 -1
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +33 -0
- package/src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx +9 -1
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +33 -0
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +31 -4
- package/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.ts +2 -2
- package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +8 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +36 -2
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +34 -1
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +33 -0
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +36 -2
|
@@ -1,9 +1,9 @@
|
|
|
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");
|
|
6
5
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
6
|
+
let __envive_ai_react_hooks_contexts_pageContext = require("@envive-ai/react-hooks/contexts/pageContext");
|
|
7
7
|
|
|
8
8
|
//#region src/CXIntegration/hooks/useUnifiedCXButton.ts
|
|
9
9
|
const useUnifiedCXButton = ({ enabled = false, provider = require_types.CustomerServiceType.unsupported, suppressMerchantButton = false, onSwitchToAgent, onCXClose }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
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";
|
|
5
4
|
import { hasParsedVariantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
5
|
+
import { usePage } from "@envive-ai/react-hooks/contexts/pageContext";
|
|
6
6
|
|
|
7
7
|
//#region src/CXIntegration/hooks/useUnifiedCXButton.ts
|
|
8
8
|
const useUnifiedCXButton = ({ enabled = false, provider = CustomerServiceType.unsupported, suppressMerchantButton = false, onSwitchToAgent, onCXClose }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_index = require('../node_modules/react-icons/fa/index.cjs');
|
|
3
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
3
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
5
|
let classnames = require("classnames");
|
|
6
6
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
7
|
let __envive_ai_react_toolkit_v3_ReviewCard = require("@envive-ai/react-toolkit-v3/ReviewCard");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FaFile, FaLink, FaPaperclip, FaSearch, FaTag } from "../node_modules/react-icons/fa/index.js";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { ReviewCard } from "@envive-ai/react-toolkit-v3/ReviewCard";
|
|
6
6
|
import { Message } from "@envive-ai/react-toolkit-v3/Message";
|
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 react = require("react");
|
|
4
|
-
react = require_rolldown_runtime.__toESM(react);
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
3
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
7
4
|
let jotai = require("jotai");
|
|
8
5
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
9
6
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
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 React from "react";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
2
|
import { chatAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
5
3
|
import { useAtomValue } from "jotai";
|
|
6
4
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
7
5
|
import { PromptCarousel, PromptCarouselRows } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import classNames from "classnames";
|
|
9
9
|
|
|
10
10
|
//#region src/debug/chatEmbed.tsx
|
|
@@ -3,12 +3,12 @@ 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 react = require("react");
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
6
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
7
|
let jotai = require("jotai");
|
|
10
8
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
11
9
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
10
|
+
let react = require("react");
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
let classnames = require("classnames");
|
|
13
13
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
14
14
|
let __envive_ai_react_hooks_application_commerce_api = require("@envive-ai/react-hooks/application/commerce-api");
|
|
@@ -1,12 +1,12 @@
|
|
|
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 { useCallback, useEffect, useState } from "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
4
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
7
5
|
import { useAtomValue } from "jotai";
|
|
8
6
|
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
9
7
|
import { userIdAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
8
|
+
import { useCallback, useEffect, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { ReportSessionRequestReportPriorityEnum, ReportSessionRequestReportTypeEnum } from "@spiffy-ai/commerce-api-client";
|
|
11
11
|
import classNames from "classnames";
|
|
12
12
|
import CommerceApiClient from "@envive-ai/react-hooks/application/commerce-api";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
1
2
|
import { RefObject } from "react";
|
|
2
3
|
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
3
|
-
import { OrgUIConfigV3, WidgetConfigV3, WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
4
4
|
|
|
5
5
|
//#region src/hocs/withBaseWidget/types.d.ts
|
|
6
6
|
interface BaseWidgetProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let react = require("react");
|
|
3
2
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
3
|
+
let react = require("react");
|
|
4
4
|
let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
|
|
5
5
|
let __envive_ai_react_hooks_contexts_hardcopyContext = require("@envive-ai/react-hooks/contexts/hardcopyContext");
|
|
6
6
|
let __envive_ai_react_hooks_contexts_pageContext = require("@envive-ai/react-hooks/contexts/pageContext");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 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_runtime5.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_runtime5 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_runtime5.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
1
|
import { useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
|
|
4
4
|
import { useHardcopy } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
5
5
|
import { usePage } from "@envive-ai/react-hooks/contexts/pageContext";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 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_runtime2.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,5 +1,5 @@
|
|
|
1
1
|
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
4
4
|
import { Message } from "postcss";
|
|
5
5
|
|
|
@@ -30,7 +30,7 @@ declare function SuggestionBar({
|
|
|
30
30
|
buttonBorderRadius,
|
|
31
31
|
handleReply,
|
|
32
32
|
dataTestId
|
|
33
|
-
}: Readonly<SuggestionBarProps>):
|
|
33
|
+
}: Readonly<SuggestionBarProps>): react_jsx_runtime0.JSX.Element;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#endregion
|
|
36
36
|
export { SuggestionBar };
|
|
@@ -2,21 +2,22 @@ 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 __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
5
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
6
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
8
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
9
|
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
13
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
14
12
|
let __envive_ai_react_hooks_atoms_app = require("@envive-ai/react-hooks/atoms/app");
|
|
13
|
+
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
15
14
|
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
16
15
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
17
16
|
let __envive_ai_react_toolkit_v3_ChatPreviewComparison = require("@envive-ai/react-toolkit-v3/ChatPreviewComparison");
|
|
18
17
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
19
18
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
19
|
+
let react = require("react");
|
|
20
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
20
21
|
|
|
21
22
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
22
23
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
@@ -45,6 +46,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
45
46
|
};
|
|
46
47
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
47
48
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
49
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
50
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
51
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
48
52
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
49
53
|
onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
50
54
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
@@ -60,6 +64,25 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
60
64
|
}
|
|
61
65
|
});
|
|
62
66
|
}, [openChat]);
|
|
67
|
+
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
68
|
+
trackWidgetInteraction({
|
|
69
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
70
|
+
trigger: {
|
|
71
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
72
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}, []);
|
|
76
|
+
const handleTranscriptionCompleted = (0, react.useCallback)((transcript) => {
|
|
77
|
+
trackWidgetInteraction({
|
|
78
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
79
|
+
trigger: {
|
|
80
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
81
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
82
|
+
widget_interaction_data: { transcription: transcript }
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}, []);
|
|
63
86
|
const handleLinkClick = (url) => {
|
|
64
87
|
trackWidgetInteraction({
|
|
65
88
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -89,7 +112,8 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
89
112
|
promptButtons: suggestions,
|
|
90
113
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
91
114
|
images: images ?? [],
|
|
92
|
-
logoSrc: logoSrc ?? void 0
|
|
115
|
+
logoSrc: logoSrc ?? void 0,
|
|
116
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
93
117
|
};
|
|
94
118
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewComparison.ChatPreviewComparison, {
|
|
95
119
|
baseProps: { id },
|
|
@@ -104,7 +128,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
104
128
|
handlePromptButtonTouchStart: onTouchStart,
|
|
105
129
|
handlePromptButtonTouchEnd: onTouchEnd,
|
|
106
130
|
handleLinkClick,
|
|
107
|
-
handleTextFieldClick
|
|
131
|
+
handleTextFieldClick,
|
|
132
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
133
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
108
134
|
}
|
|
109
135
|
});
|
|
110
136
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 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_runtime10.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_runtime10.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_runtime8 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_runtime8.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_runtime8.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
@@ -1,21 +1,22 @@
|
|
|
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 { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
4
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
8
5
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
9
6
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
10
7
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
11
8
|
import { useAtomValue } from "jotai";
|
|
12
|
-
import {
|
|
9
|
+
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
10
|
+
import { ChatElementDisplayLocationV3, FeatureGates, VariantTypeEnum } from "@envive-ai/react-hooks/application/models";
|
|
13
11
|
import { variantInfoAtom } from "@envive-ai/react-hooks/atoms/app";
|
|
12
|
+
import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
14
13
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
15
14
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
16
15
|
import { ChatPreviewComparison } from "@envive-ai/react-toolkit-v3/ChatPreviewComparison";
|
|
17
16
|
import { usePromptCarouselAnalytics } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
18
17
|
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
18
|
+
import { useCallback, useMemo } from "react";
|
|
19
|
+
import { jsx } from "react/jsx-runtime";
|
|
19
20
|
|
|
20
21
|
//#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx
|
|
21
22
|
const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
@@ -44,6 +45,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
44
45
|
};
|
|
45
46
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
46
47
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
48
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
49
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
50
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
47
51
|
const handlePromptButtonClick = useCallback((suggestion) => {
|
|
48
52
|
onSuggestionClicked(suggestion, ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
49
53
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_COMPARISON_PROMPT_BUTTON);
|
|
@@ -59,6 +63,25 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
59
63
|
}
|
|
60
64
|
});
|
|
61
65
|
}, [openChat]);
|
|
66
|
+
const handleTranscriptionStarted = useCallback(() => {
|
|
67
|
+
trackWidgetInteraction({
|
|
68
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
69
|
+
trigger: {
|
|
70
|
+
widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
71
|
+
widget_interaction: WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
75
|
+
const handleTranscriptionCompleted = useCallback((transcript) => {
|
|
76
|
+
trackWidgetInteraction({
|
|
77
|
+
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
78
|
+
trigger: {
|
|
79
|
+
widget: WidgetInteractionComponent.POST_INTERACTION_COMPARISON,
|
|
80
|
+
widget_interaction: WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
81
|
+
widget_interaction_data: { transcription: transcript }
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}, []);
|
|
62
85
|
const handleLinkClick = (url) => {
|
|
63
86
|
trackWidgetInteraction({
|
|
64
87
|
eventName: EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -88,7 +111,8 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
88
111
|
promptButtons: suggestions,
|
|
89
112
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
90
113
|
images: images ?? [],
|
|
91
|
-
logoSrc: logoSrc ?? void 0
|
|
114
|
+
logoSrc: logoSrc ?? void 0,
|
|
115
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
92
116
|
};
|
|
93
117
|
return /* @__PURE__ */ jsx(ChatPreviewComparison, {
|
|
94
118
|
baseProps: { id },
|
|
@@ -103,7 +127,9 @@ const ChatPreviewComparisonWidgetHandler = (props) => {
|
|
|
103
127
|
handlePromptButtonTouchStart: onTouchStart,
|
|
104
128
|
handlePromptButtonTouchEnd: onTouchEnd,
|
|
105
129
|
handleLinkClick,
|
|
106
|
-
handleTextFieldClick
|
|
130
|
+
handleTextFieldClick,
|
|
131
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
132
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
107
133
|
}
|
|
108
134
|
});
|
|
109
135
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
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
|
-
let
|
|
6
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
7
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
9
|
let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
|
|
10
|
+
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
9
11
|
|
|
10
12
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
11
13
|
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
@@ -13,21 +15,27 @@ const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
|
13
15
|
const chatPreviewLoadingWidgetConfig = widgetConfig;
|
|
14
16
|
const id = widgetConfig?.contentId;
|
|
15
17
|
const chatPreviewLoadingData = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_widget.chatPreviewLoadingDataAtom)[widgetConfigId] ?? void 0;
|
|
18
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
16
19
|
const isCacheEmpty = !chatPreviewLoadingData || Object.values(chatPreviewLoadingData).every((value) => value === void 0) || Object.keys(chatPreviewLoadingData).length === 0;
|
|
17
20
|
if (isLoading && isCacheEmpty) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
|
|
18
21
|
const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
|
|
19
22
|
const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ?? chatPreviewLoadingData?.textFieldPlaceholder;
|
|
20
23
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
|
|
21
24
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
|
|
25
|
+
const variant = chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant;
|
|
26
|
+
const hexCardColor = chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor;
|
|
27
|
+
const hideTextField = chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField;
|
|
28
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
22
29
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, {
|
|
23
30
|
id,
|
|
24
|
-
variant
|
|
25
|
-
hexCardColor
|
|
26
|
-
hideTextField
|
|
31
|
+
variant,
|
|
32
|
+
hexCardColor,
|
|
33
|
+
hideTextField,
|
|
27
34
|
textFieldPlaceholder,
|
|
28
35
|
hideLogo,
|
|
29
36
|
logoSrc,
|
|
30
|
-
titleLabel
|
|
37
|
+
titleLabel,
|
|
38
|
+
voiceInputEnabled: featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled
|
|
31
39
|
});
|
|
32
40
|
};
|
|
33
41
|
const ChatPreviewLoadingWidgetWithBaseWidget = require_withBaseWidget.withBaseWidget(ChatPreviewLoadingWidgetHandler);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 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_runtime2.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_runtime2.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 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_runtime3.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_runtime3.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
|
|
@@ -1,10 +1,12 @@
|
|
|
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
|
-
import {
|
|
5
|
+
import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
|
|
6
|
+
import { FeatureGates } from "@envive-ai/react-hooks/application/models";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { chatPreviewLoadingDataAtom } from "@envive-ai/react-hooks/atoms/widget";
|
|
9
|
+
import { ChatPreviewLoading } from "@envive-ai/react-toolkit-v3/ChatPreviewLoading";
|
|
8
10
|
|
|
9
11
|
//#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.tsx
|
|
10
12
|
const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
@@ -12,21 +14,27 @@ const ChatPreviewLoadingWidgetHandler = (props) => {
|
|
|
12
14
|
const chatPreviewLoadingWidgetConfig = widgetConfig;
|
|
13
15
|
const id = widgetConfig?.contentId;
|
|
14
16
|
const chatPreviewLoadingData = useAtomValue(chatPreviewLoadingDataAtom)[widgetConfigId] ?? void 0;
|
|
17
|
+
const { featureFlagService } = useFeatureFlagService();
|
|
15
18
|
const isCacheEmpty = !chatPreviewLoadingData || Object.values(chatPreviewLoadingData).every((value) => value === void 0) || Object.keys(chatPreviewLoadingData).length === 0;
|
|
16
19
|
if (isLoading && isCacheEmpty) return /* @__PURE__ */ jsx(ChatPreviewLoading, { fullIsLoading: true });
|
|
17
20
|
const titleLabel = hardcopyContent?.values?.titleLabel ?? chatPreviewLoadingData?.titleLabel;
|
|
18
21
|
const textFieldPlaceholder = hardcopyContent?.values?.textFieldPlaceholderText ?? chatPreviewLoadingData?.textFieldPlaceholder;
|
|
19
22
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo ?? chatPreviewLoadingData?.hideLogo;
|
|
20
23
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc ?? chatPreviewLoadingData?.logoSrc;
|
|
24
|
+
const variant = chatPreviewLoadingWidgetConfig?.variant ?? chatPreviewLoadingData?.variant;
|
|
25
|
+
const hexCardColor = chatPreviewLoadingWidgetConfig?.hexCardColor ?? chatPreviewLoadingData?.hexCardColor;
|
|
26
|
+
const hideTextField = chatPreviewLoadingWidgetConfig?.hideTextField ?? chatPreviewLoadingData?.hideTextField;
|
|
27
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
21
28
|
return /* @__PURE__ */ jsx(ChatPreviewLoading, {
|
|
22
29
|
id,
|
|
23
|
-
variant
|
|
24
|
-
hexCardColor
|
|
25
|
-
hideTextField
|
|
30
|
+
variant,
|
|
31
|
+
hexCardColor,
|
|
32
|
+
hideTextField,
|
|
26
33
|
textFieldPlaceholder,
|
|
27
34
|
hideLogo,
|
|
28
35
|
logoSrc,
|
|
29
|
-
titleLabel
|
|
36
|
+
titleLabel,
|
|
37
|
+
voiceInputEnabled: featureFlagService?.isFeatureGateEnabled(FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled
|
|
30
38
|
});
|
|
31
39
|
};
|
|
32
40
|
const ChatPreviewLoadingWidgetWithBaseWidget = withBaseWidget(ChatPreviewLoadingWidgetHandler);
|
|
@@ -2,19 +2,20 @@ 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 __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
5
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
9
6
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
10
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
11
8
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
9
|
let jotai = require("jotai");
|
|
10
|
+
let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
|
|
13
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
|
+
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
14
13
|
let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
|
|
15
14
|
let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
|
|
16
15
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
17
16
|
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
17
|
+
let react = require("react");
|
|
18
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
18
19
|
let __envive_ai_react_toolkit_v3_ChatPreview = require("@envive-ai/react-toolkit-v3/ChatPreview");
|
|
19
20
|
|
|
20
21
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
@@ -38,6 +39,9 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
38
39
|
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);
|
|
39
40
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
40
41
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
42
|
+
const voiceInputEnabled = uiConfig?.lookAndFeel?.voiceInputEnabled;
|
|
43
|
+
const { featureFlagService } = (0, __envive_ai_react_hooks_contexts_featureFlagServiceContext.useFeatureFlagService)();
|
|
44
|
+
const isVoiceInputEnabled = featureFlagService?.isFeatureGateEnabled(__envive_ai_react_hooks_application_models.FeatureGates.IsVoiceInputEnabled) || voiceInputEnabled;
|
|
41
45
|
const handlePromptButtonClick = (0, react.useCallback)((suggestion) => {
|
|
42
46
|
onSuggestionClicked(suggestion, __envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
43
47
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
@@ -53,6 +57,25 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
53
57
|
}
|
|
54
58
|
});
|
|
55
59
|
}, [openChat]);
|
|
60
|
+
const handleTranscriptionStarted = (0, react.useCallback)(() => {
|
|
61
|
+
trackWidgetInteraction({
|
|
62
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
63
|
+
trigger: {
|
|
64
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW,
|
|
65
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_STARTED
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
const handleTranscriptionCompleted = (0, react.useCallback)((transcript) => {
|
|
70
|
+
trackWidgetInteraction({
|
|
71
|
+
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
72
|
+
trigger: {
|
|
73
|
+
widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.CHAT_PREVIEW,
|
|
74
|
+
widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.VOICE_TRANSCRIPTION_COMPLETED,
|
|
75
|
+
widget_interaction_data: { transcription: transcript }
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}, []);
|
|
56
79
|
const handleLinkClick = (url) => {
|
|
57
80
|
trackWidgetInteraction({
|
|
58
81
|
eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
|
|
@@ -79,7 +102,8 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
79
102
|
messageText: hardCopyContent?.messageText,
|
|
80
103
|
promptButtons: hardCopyContent?.promptButtons,
|
|
81
104
|
textFieldPlaceholderText: hardCopyContent?.textFieldPlaceholderText,
|
|
82
|
-
logoSrc: logoSrc ?? void 0
|
|
105
|
+
logoSrc: logoSrc ?? void 0,
|
|
106
|
+
voiceInputEnabled: isVoiceInputEnabled
|
|
83
107
|
};
|
|
84
108
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreview.ChatPreview, {
|
|
85
109
|
baseProps: { id },
|
|
@@ -94,7 +118,9 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
94
118
|
handlePromptButtonTouchStart: onTouchStart,
|
|
95
119
|
handlePromptButtonTouchEnd: onTouchEnd,
|
|
96
120
|
handleLinkClick,
|
|
97
|
-
handleTextFieldClick
|
|
121
|
+
handleTextFieldClick,
|
|
122
|
+
onTranscriptionStarted: handleTranscriptionStarted,
|
|
123
|
+
onTranscriptionCompleted: handleTranscriptionCompleted
|
|
98
124
|
}
|
|
99
125
|
});
|
|
100
126
|
};
|