@envive-ai/react-widgets-v3 0.3.2 → 0.3.6
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/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/node_modules/uuid/dist/native.js +6 -0
- package/dist/node_modules/uuid/dist/rng.js +13 -0
- package/dist/node_modules/uuid/dist/stringify.js +9 -0
- package/dist/node_modules/uuid/dist/v4.js +27 -0
- package/dist/node_modules/uuid/dist-node/native.cjs +8 -0
- package/dist/node_modules/uuid/dist-node/rng.cjs +16 -0
- package/dist/node_modules/uuid/dist-node/stringify.cjs +10 -0
- package/dist/node_modules/uuid/dist-node/v4.cjs +27 -0
- package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResults.d.ts +3 -4
- package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/packages/widgets/dist/SearchZeroState/index.d.ts +3 -0
- package/dist/{widgets → packages/widgets}/dist/SearchZeroState/types.d.ts +2 -2
- package/dist/{widgets → packages/widgets}/dist/SuggestionBar/SuggestionBar.d.ts +1 -1
- package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/types.d.ts +2 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +28 -11
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +28 -11
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +27 -10
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +27 -10
- 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/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +26 -8
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +27 -9
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +14 -6
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +15 -7
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +36 -13
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +36 -13
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +13 -5
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +14 -6
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +14 -7
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +14 -7
- package/dist/widgets/dist/SearchResults/SearchResults.d.cts +3 -4
- 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 +1 -1
- 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 +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/dist/widgets-v2/SearchResults/index.d.ts +3 -3
- package/dist/widgets-v2/SearchZeroState/index.d.cts +1 -2
- package/dist/widgets-v2/SearchZeroState/index.d.ts +4 -5
- package/dist/widgets-v2/SuggestionBar/index.d.ts +3 -3
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +2 -2
- package/src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.tsx +30 -8
- package/src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx +33 -9
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +33 -8
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +19 -5
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +41 -10
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +19 -5
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +18 -5
- package/dist/hooks/dist/application/models/api/orgConfigResults.d.ts +0 -1
- package/dist/hooks/dist/application/models/frontendConfig.d.ts +0 -1
- package/dist/hooks/dist/contexts/amplitudeContext/amplitudeContext.d.ts +0 -2
- package/dist/hooks/dist/contexts/amplitudeContext/index.d.ts +0 -2
- package/dist/hooks/dist/contexts/featureFlagServiceContext/featureFlagServiceContext.d.ts +0 -2
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.cts +0 -8
- package/dist/hooks/dist/contexts/hardcopyContext/hardcopyContext.d.ts +0 -11
- package/dist/hooks/dist/contexts/hardcopyContext/index.d.ts +0 -1
- package/dist/hooks/dist/contexts/types.d.cts +0 -44
- package/dist/hooks/dist/contexts/types.d.ts +0 -47
- package/dist/hooks/dist/contexts/typesV3.d.cts +0 -201
- package/dist/hooks/dist/contexts/typesV3.d.ts +0 -201
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.cts +0 -36
- package/dist/hooks/dist/services/amplitudeService/amplitudeService.d.ts +0 -37
- package/dist/hooks/dist/types/customerService.d.cts +0 -18
- package/dist/hooks/dist/types/customerService.d.ts +0 -18
- package/dist/widgets/dist/SearchZeroState/index.d.ts +0 -4
- 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/response.d.ts +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/api/search.d.ts +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/camelCase.d.ts +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/camelCasedPropertiesDeep.d.ts +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/internal.d.ts +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/splitWords.d.ts +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/trim.d.ts +0 -32
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +0 -32
- package/dist/widgets/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +0 -32
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.cts +0 -14
- package/dist/widgets/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +0 -15
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.cts +0 -61
- package/dist/widgets/dist/packages/hooks/dist/contexts/types.d.ts +0 -61
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.cts +0 -60
- package/dist/widgets/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +0 -60
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.cts +0 -11
- package/dist/widgets/dist/packages/hooks/dist/hooks/utils.d.ts +0 -11
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.cts +0 -28
- package/dist/widgets/dist/packages/hooks/dist/types/search-filter-types.d.ts +0 -28
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.cts +0 -10
- package/dist/widgets/dist/packages/hooks/dist/types/test-types.d.ts +0 -10
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroState.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/BaseWidgetConfig.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/WidgetType.d.ts +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import v4_default from "../../node_modules/uuid/dist/v4.js";
|
|
2
3
|
import { getMessageText } from "../utils/functions.js";
|
|
3
4
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
4
5
|
import { useCallback, useMemo } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { useAtomValue, useSetAtom } from "jotai";
|
|
9
|
+
import { handleReplyAtom } from "@envive-ai/react-hooks/atoms/chat/replies";
|
|
9
10
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
10
|
-
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
11
|
-
import { useAtomValue } from "jotai";
|
|
12
11
|
import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
12
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
13
|
+
import { ChatElementDisplayLocationV3, MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
13
14
|
import { ChatPreview } from "@envive-ai/react-toolkit-v3/ChatPreview";
|
|
14
15
|
|
|
15
16
|
//#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.tsx
|
|
16
17
|
const ChatPreviewWidgetHandler = (props) => {
|
|
17
|
-
const
|
|
18
|
+
const handleReply = useSetAtom(handleReplyAtom);
|
|
18
19
|
const { openChat } = useChatToggle();
|
|
19
20
|
const lastAssistantMessage = useAtomValue(lastAssistantMessageAtom);
|
|
20
21
|
const { suggestions } = useAtomValue(chatAtom);
|
|
@@ -34,15 +35,31 @@ const ChatPreviewWidgetHandler = (props) => {
|
|
|
34
35
|
const logoSrc = uiConfig?.lookAndFeel?.widgetLogoSrc;
|
|
35
36
|
const hideLogo = uiConfig?.lookAndFeel?.hideWidgetLogo;
|
|
36
37
|
const handlePromptButtonClick = useCallback((text) => {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
handleReply({
|
|
39
|
+
message: {
|
|
40
|
+
id: v4_default(),
|
|
41
|
+
role: MessageRole.User,
|
|
42
|
+
type: MessageType.QueryTyped,
|
|
43
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
44
|
+
metadata: { content: text }
|
|
45
|
+
},
|
|
39
46
|
userTyped: false
|
|
40
47
|
});
|
|
41
48
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_PROMPT_BUTTON);
|
|
42
|
-
}, [
|
|
43
|
-
const handleTextFieldClick = useCallback(() => {
|
|
49
|
+
}, [handleReply, openChat]);
|
|
50
|
+
const handleTextFieldClick = useCallback((text) => {
|
|
51
|
+
handleReply({
|
|
52
|
+
message: {
|
|
53
|
+
id: v4_default(),
|
|
54
|
+
role: MessageRole.User,
|
|
55
|
+
type: MessageType.QueryTyped,
|
|
56
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
57
|
+
metadata: { content: text }
|
|
58
|
+
},
|
|
59
|
+
userTyped: false
|
|
60
|
+
});
|
|
44
61
|
openChat(ChatElementDisplayLocationV3.CHAT_PREVIEW_TEXT_FIELD);
|
|
45
|
-
}, [openChat]);
|
|
62
|
+
}, [handleReply, openChat]);
|
|
46
63
|
if (isLoading) return /* @__PURE__ */ jsx(ChatPreviewLoadingWidgetWithBaseWidget, {
|
|
47
64
|
widgetConfigId,
|
|
48
65
|
widgetType: WidgetTypeV3.ChatPreviewLoadingV3
|
|
@@ -9,12 +9,12 @@ const require_useUnifiedCXButton = require('../../CXIntegration/hooks/useUnified
|
|
|
9
9
|
let react = require("react");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
12
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
13
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
14
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
15
|
let __envive_ai_react_toolkit_v3_FloatingChat = require("@envive-ai/react-toolkit-v3/FloatingChat");
|
|
13
16
|
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
14
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
15
17
|
let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
|
|
16
|
-
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
17
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
18
18
|
|
|
19
19
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
20
20
|
const FloatingChatWidgetHandler = (props) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
|
|
4
4
|
interface FloatingChatWidgetProps {}
|
|
5
5
|
declare const FloatingChatWidget: {
|
|
6
|
-
():
|
|
6
|
+
(): react_jsx_runtime1.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
|
|
4
4
|
interface FloatingChatWidgetProps {}
|
|
5
5
|
declare const FloatingChatWidget: {
|
|
6
|
-
():
|
|
6
|
+
(): react_jsx_runtime7.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
@@ -8,12 +8,12 @@ import { useUnifiedCXButton } from "../../CXIntegration/hooks/useUnifiedCXButton
|
|
|
8
8
|
import { useMemo } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
11
|
+
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
12
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
13
|
+
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
11
14
|
import { FloatingChat } from "@envive-ai/react-toolkit-v3/FloatingChat";
|
|
12
15
|
import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
|
|
13
|
-
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
14
16
|
import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
|
|
15
|
-
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
16
|
-
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
17
17
|
|
|
18
18
|
//#region src/widgets/FloatingChatWidget/FloatingChatWidget.tsx
|
|
19
19
|
const FloatingChatWidgetHandler = (props) => {
|
package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
|
+
const require_v4 = require('../../node_modules/uuid/dist-node/v4.cjs');
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
6
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
6
|
-
let
|
|
7
|
-
let
|
|
7
|
+
let jotai = require("jotai");
|
|
8
|
+
let __envive_ai_react_hooks_atoms_chat_replies = require("@envive-ai/react-hooks/atoms/chat/replies");
|
|
8
9
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
10
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
9
11
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
12
|
let __envive_ai_react_toolkit_v3_PromptButtonCarouselWithImage = require("@envive-ai/react-toolkit-v3/PromptButtonCarouselWithImage");
|
|
11
13
|
|
|
12
14
|
//#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx
|
|
13
15
|
const PromptButtonCarouselWithImageWidgetHandler = (props) => {
|
|
14
|
-
const
|
|
16
|
+
const handleReply = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat_replies.handleReplyAtom);
|
|
15
17
|
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
16
18
|
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
17
19
|
const promptButtonCarouselWithImageWidgetConfig = widgetConfig;
|
|
@@ -22,15 +24,31 @@ const PromptButtonCarouselWithImageWidgetHandler = (props) => {
|
|
|
22
24
|
textFieldPlaceholder: hardcopyContent?.values?.textFieldPlaceholderText
|
|
23
25
|
};
|
|
24
26
|
const handlePromptButtonClick = (0, react.useCallback)((text) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
handleReply({
|
|
28
|
+
message: {
|
|
29
|
+
id: require_v4.default(),
|
|
30
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
31
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
32
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
33
|
+
metadata: { content: text }
|
|
34
|
+
},
|
|
27
35
|
userTyped: false
|
|
28
36
|
});
|
|
29
37
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PROMPT_BUTTON_CAROUSEL_WITH_IMAGE_PROMPT_BUTTON);
|
|
30
|
-
}, [
|
|
31
|
-
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
38
|
+
}, [handleReply, openChat]);
|
|
39
|
+
const handleTextFieldClick = (0, react.useCallback)((text) => {
|
|
40
|
+
handleReply({
|
|
41
|
+
message: {
|
|
42
|
+
id: require_v4.default(),
|
|
43
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
44
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
45
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
46
|
+
metadata: { content: text }
|
|
47
|
+
},
|
|
48
|
+
userTyped: false
|
|
49
|
+
});
|
|
32
50
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PROMPT_BUTTON_CAROUSEL_WITH_IMAGE_TEXT_FIELD);
|
|
33
|
-
}, [openChat]);
|
|
51
|
+
}, [handleReply, openChat]);
|
|
34
52
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_PromptButtonCarouselWithImage.PromptButtonCarouselWithImage, {
|
|
35
53
|
id,
|
|
36
54
|
theme: __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM,
|
package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts
CHANGED
|
@@ -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/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
|
|
5
5
|
declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime7.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface PromptButtonCarouselWithImageWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
|
|
|
12
12
|
declare const PromptButtonCarouselWithImageWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: PromptButtonCarouselWithImageWidgetProps):
|
|
15
|
+
}: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime7.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
|
|
5
5
|
declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface PromptButtonCarouselWithImageWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
|
|
|
12
12
|
declare const PromptButtonCarouselWithImageWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: PromptButtonCarouselWithImageWidgetProps):
|
|
15
|
+
}: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime9.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
|
+
import v4_default from "../../node_modules/uuid/dist/v4.js";
|
|
2
3
|
import { useCallback } from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { useSetAtom } from "jotai";
|
|
7
|
+
import { handleReplyAtom } from "@envive-ai/react-hooks/atoms/chat/replies";
|
|
7
8
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
8
|
-
import {
|
|
9
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
10
|
+
import { ChatElementDisplayLocationV3, MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
9
11
|
import { PromptButtonCarouselWithImage } from "@envive-ai/react-toolkit-v3/PromptButtonCarouselWithImage";
|
|
10
12
|
|
|
11
13
|
//#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx
|
|
12
14
|
const PromptButtonCarouselWithImageWidgetHandler = (props) => {
|
|
13
|
-
const
|
|
15
|
+
const handleReply = useSetAtom(handleReplyAtom);
|
|
14
16
|
const { openChat } = useChatToggle();
|
|
15
17
|
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
16
18
|
const promptButtonCarouselWithImageWidgetConfig = widgetConfig;
|
|
@@ -21,15 +23,31 @@ const PromptButtonCarouselWithImageWidgetHandler = (props) => {
|
|
|
21
23
|
textFieldPlaceholder: hardcopyContent?.values?.textFieldPlaceholderText
|
|
22
24
|
};
|
|
23
25
|
const handlePromptButtonClick = useCallback((text) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
handleReply({
|
|
27
|
+
message: {
|
|
28
|
+
id: v4_default(),
|
|
29
|
+
role: MessageRole.User,
|
|
30
|
+
type: MessageType.QueryTyped,
|
|
31
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
|
+
metadata: { content: text }
|
|
33
|
+
},
|
|
26
34
|
userTyped: false
|
|
27
35
|
});
|
|
28
36
|
openChat(ChatElementDisplayLocationV3.PROMPT_BUTTON_CAROUSEL_WITH_IMAGE_PROMPT_BUTTON);
|
|
29
|
-
}, [
|
|
30
|
-
const handleTextFieldClick = useCallback(() => {
|
|
37
|
+
}, [handleReply, openChat]);
|
|
38
|
+
const handleTextFieldClick = useCallback((text) => {
|
|
39
|
+
handleReply({
|
|
40
|
+
message: {
|
|
41
|
+
id: v4_default(),
|
|
42
|
+
role: MessageRole.User,
|
|
43
|
+
type: MessageType.QueryTyped,
|
|
44
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
45
|
+
metadata: { content: text }
|
|
46
|
+
},
|
|
47
|
+
userTyped: false
|
|
48
|
+
});
|
|
31
49
|
openChat(ChatElementDisplayLocationV3.PROMPT_BUTTON_CAROUSEL_WITH_IMAGE_TEXT_FIELD);
|
|
32
|
-
}, [openChat]);
|
|
50
|
+
}, [handleReply, openChat]);
|
|
33
51
|
return /* @__PURE__ */ jsx(PromptButtonCarouselWithImage, {
|
|
34
52
|
id,
|
|
35
53
|
theme: Theme.GLOBAL_CUSTOM,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
3
|
require('../../hocs/withBaseWidget/index.cjs');
|
|
4
|
+
const require_v4 = require('../../node_modules/uuid/dist-node/v4.cjs');
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
7
|
-
let
|
|
8
|
-
let
|
|
8
|
+
let jotai = require("jotai");
|
|
9
|
+
let __envive_ai_react_hooks_atoms_chat_replies = require("@envive-ai/react-hooks/atoms/chat/replies");
|
|
9
10
|
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
11
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
10
12
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
11
13
|
let __envive_ai_react_toolkit_v3_PromptCarousel_types_types = require("@envive-ai/react-toolkit-v3/PromptCarousel/types/types");
|
|
12
14
|
let __envive_ai_react_toolkit_v3_PromptCarousel = require("@envive-ai/react-toolkit-v3/PromptCarousel");
|
|
@@ -20,7 +22,7 @@ const mockButtonTexts = [
|
|
|
20
22
|
"Loading button 5"
|
|
21
23
|
];
|
|
22
24
|
const PromptCarouselWidgetHandler = (props) => {
|
|
23
|
-
const
|
|
25
|
+
const handleReply = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat_replies.handleReplyAtom);
|
|
24
26
|
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
25
27
|
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
26
28
|
const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
|
|
@@ -32,12 +34,18 @@ const PromptCarouselWidgetHandler = (props) => {
|
|
|
32
34
|
const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
|
|
33
35
|
const animationSpeed = isLoading ? __envive_ai_react_toolkit_v3_PromptCarousel_types_types.AnimationSpeed.FAST : promptCarouselWidgetConfig?.animationSpeed;
|
|
34
36
|
const handleButtonClick = (0, react.useCallback)((text) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
handleReply({
|
|
38
|
+
message: {
|
|
39
|
+
id: require_v4.default(),
|
|
40
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
41
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
42
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
43
|
+
metadata: { content: text }
|
|
44
|
+
},
|
|
37
45
|
userTyped: false
|
|
38
46
|
});
|
|
39
47
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.PROMPT_CAROUSEL);
|
|
40
|
-
}, [
|
|
48
|
+
}, [handleReply, openChat]);
|
|
41
49
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_PromptCarousel.PromptCarousel, {
|
|
42
50
|
id,
|
|
43
51
|
theme: __envive_ai_react_toolkit_v3_Tokens.Theme.GLOBAL_CUSTOM,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
|
|
4
4
|
interface PromptCarouselWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
|
|
|
7
7
|
declare const PromptCarouselWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: PromptCarouselWidgetProps):
|
|
10
|
+
}: PromptCarouselWidgetProps): react_jsx_runtime12.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
|
|
4
4
|
interface PromptCarouselWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
|
|
|
7
7
|
declare const PromptCarouselWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: PromptCarouselWidgetProps):
|
|
10
|
+
}: PromptCarouselWidgetProps): react_jsx_runtime8.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { withBaseWidget } from "../../hocs/withBaseWidget/withBaseWidget.js";
|
|
2
2
|
import "../../hocs/withBaseWidget/index.js";
|
|
3
|
+
import v4_default from "../../node_modules/uuid/dist/v4.js";
|
|
3
4
|
import { useCallback } from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { useSetAtom } from "jotai";
|
|
8
|
+
import { handleReplyAtom } from "@envive-ai/react-hooks/atoms/chat/replies";
|
|
8
9
|
import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
|
|
9
|
-
import {
|
|
10
|
+
import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
|
|
11
|
+
import { ChatElementDisplayLocationV3, MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
10
12
|
import { AnimationSpeed } from "@envive-ai/react-toolkit-v3/PromptCarousel/types/types";
|
|
11
13
|
import { PromptCarousel } from "@envive-ai/react-toolkit-v3/PromptCarousel";
|
|
12
14
|
|
|
@@ -19,7 +21,7 @@ const mockButtonTexts = [
|
|
|
19
21
|
"Loading button 5"
|
|
20
22
|
];
|
|
21
23
|
const PromptCarouselWidgetHandler = (props) => {
|
|
22
|
-
const
|
|
24
|
+
const handleReply = useSetAtom(handleReplyAtom);
|
|
23
25
|
const { openChat } = useChatToggle();
|
|
24
26
|
const { hardcopyContent, widgetConfig, isLoading } = props;
|
|
25
27
|
const promptButtonTexts = hardcopyContent?.values?.promptButtonTexts || [];
|
|
@@ -31,12 +33,18 @@ const PromptCarouselWidgetHandler = (props) => {
|
|
|
31
33
|
const promptCarouselRows = promptCarouselWidgetConfig?.promptCarouselRows;
|
|
32
34
|
const animationSpeed = isLoading ? AnimationSpeed.FAST : promptCarouselWidgetConfig?.animationSpeed;
|
|
33
35
|
const handleButtonClick = useCallback((text) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
handleReply({
|
|
37
|
+
message: {
|
|
38
|
+
id: v4_default(),
|
|
39
|
+
role: MessageRole.User,
|
|
40
|
+
type: MessageType.QueryTyped,
|
|
41
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
42
|
+
metadata: { content: text }
|
|
43
|
+
},
|
|
36
44
|
userTyped: false
|
|
37
45
|
});
|
|
38
46
|
openChat(ChatElementDisplayLocationV3.PROMPT_CAROUSEL);
|
|
39
|
-
}, [
|
|
47
|
+
}, [handleReply, openChat]);
|
|
40
48
|
return /* @__PURE__ */ jsx(PromptCarousel, {
|
|
41
49
|
id,
|
|
42
50
|
theme: Theme.GLOBAL_CUSTOM,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
3
2
|
const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
|
|
4
|
-
const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
|
|
5
3
|
const require_ChatPreviewComparisonWidget = require('../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs');
|
|
4
|
+
const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
|
|
5
|
+
const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
|
|
6
6
|
const require_SocialProofWidget = require('../SocialProofWidget/SocialProofWidget.cjs');
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
|
|
4
4
|
interface SocialProofFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
|
|
|
7
7
|
declare const SocialProofFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: SocialProofFlowWidgetProps):
|
|
10
|
+
}: SocialProofFlowWidgetProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
|
|
4
4
|
interface SocialProofFlowWidgetProps {
|
|
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
|
|
|
7
7
|
declare const SocialProofFlowWidget: {
|
|
8
8
|
({
|
|
9
9
|
widgetConfigId
|
|
10
|
-
}: SocialProofFlowWidgetProps):
|
|
10
|
+
}: SocialProofFlowWidgetProps): react_jsx_runtime11.JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
|
|
2
1
|
import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
|
|
3
|
-
import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
|
|
4
2
|
import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
|
|
3
|
+
import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
|
|
4
|
+
import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
|
|
5
5
|
import { SocialProofWidgetWithBaseWidget } from "../SocialProofWidget/SocialProofWidget.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_withBaseWidget = require('../../hocs/withBaseWidget/withBaseWidget.cjs');
|
|
3
|
+
const require_v4 = require('../../node_modules/uuid/dist-node/v4.cjs');
|
|
3
4
|
const require_functions = require('../utils/functions.cjs');
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
|
|
7
|
-
let __envive_ai_react_hooks_contexts_salesAgentContext = require("@envive-ai/react-hooks/contexts/salesAgentContext");
|
|
8
|
-
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
9
|
-
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
10
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
11
8
|
let jotai = require("jotai");
|
|
9
|
+
let __envive_ai_react_hooks_atoms_chat_replies = require("@envive-ai/react-hooks/atoms/chat/replies");
|
|
10
|
+
let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
|
|
12
11
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
12
|
+
let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
|
|
13
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
13
14
|
let __envive_ai_react_toolkit_v3_ChatPreviewLoading = require("@envive-ai/react-toolkit-v3/ChatPreviewLoading");
|
|
14
15
|
let __envive_ai_react_hooks_atoms_widget = require("@envive-ai/react-hooks/atoms/widget");
|
|
15
16
|
let __envive_ai_react_toolkit_v3_SocialProof = require("@envive-ai/react-toolkit-v3/SocialProof");
|
|
@@ -17,7 +18,7 @@ let __envive_ai_react_toolkit_v3_SocialProof = require("@envive-ai/react-toolkit
|
|
|
17
18
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.tsx
|
|
18
19
|
const SocialProofWidgetHandler = (props) => {
|
|
19
20
|
const setChatPreviewLoadingData = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_widget.chatPreviewLoadingDataAtom);
|
|
20
|
-
const
|
|
21
|
+
const handleReply = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat_replies.handleReplyAtom);
|
|
21
22
|
const { openChat } = (0, __envive_ai_react_hooks_hooks_ChatToggle.useChatToggle)();
|
|
22
23
|
const lastAssistantMessage = (0, jotai.useAtomValue)(__envive_ai_react_hooks_atoms_chat.lastAssistantMessageAtom);
|
|
23
24
|
const { hardcopyContent, widgetConfig, uiConfig, isLoading, widgetConfigId } = props;
|
|
@@ -40,22 +41,44 @@ const SocialProofWidgetHandler = (props) => {
|
|
|
40
41
|
alt: "Product Image"
|
|
41
42
|
}];
|
|
42
43
|
const handlePrimaryButtonClick = (0, react.useCallback)((text) => {
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
handleReply({
|
|
45
|
+
message: {
|
|
46
|
+
id: require_v4.default(),
|
|
47
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
48
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
49
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
50
|
+
metadata: { content: text }
|
|
51
|
+
},
|
|
45
52
|
userTyped: false
|
|
46
53
|
});
|
|
47
54
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_PRIMARY_BUTTON);
|
|
48
|
-
}, [
|
|
55
|
+
}, [handleReply, openChat]);
|
|
49
56
|
const handleSecondaryButtonClick = (0, react.useCallback)((text) => {
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
handleReply({
|
|
58
|
+
message: {
|
|
59
|
+
id: require_v4.default(),
|
|
60
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
61
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
62
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
63
|
+
metadata: { content: text }
|
|
64
|
+
},
|
|
52
65
|
userTyped: false
|
|
53
66
|
});
|
|
54
67
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_SECONDARY_BUTTON);
|
|
55
|
-
}, [
|
|
56
|
-
const handleTextFieldClick = (0, react.useCallback)(() => {
|
|
68
|
+
}, [handleReply, openChat]);
|
|
69
|
+
const handleTextFieldClick = (0, react.useCallback)((text) => {
|
|
70
|
+
handleReply({
|
|
71
|
+
message: {
|
|
72
|
+
id: require_v4.default(),
|
|
73
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
74
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
75
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
76
|
+
metadata: { content: text }
|
|
77
|
+
},
|
|
78
|
+
userTyped: false
|
|
79
|
+
});
|
|
57
80
|
openChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.SOCIAL_PROOF_TEXT_FIELD);
|
|
58
|
-
}, [openChat]);
|
|
81
|
+
}, [handleReply, openChat]);
|
|
59
82
|
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ChatPreviewLoading.ChatPreviewLoading, { fullIsLoading: true });
|
|
60
83
|
setChatPreviewLoadingData({
|
|
61
84
|
widgetConfigId,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
|
|
5
5
|
declare const SocialProofWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime5.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface SocialProofWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
|
|
|
12
12
|
declare const SocialProofWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: SocialProofWidgetProps):
|
|
15
|
+
}: SocialProofWidgetProps): react_jsx_runtime5.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_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
|
|
5
5
|
declare const SocialProofWidgetWithBaseWidget: {
|
|
6
|
-
(props: BaseWidgetProps):
|
|
6
|
+
(props: BaseWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
interface SocialProofWidgetProps {
|
|
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
|
|
|
12
12
|
declare const SocialProofWidget: {
|
|
13
13
|
({
|
|
14
14
|
widgetConfigId
|
|
15
|
-
}: SocialProofWidgetProps):
|
|
15
|
+
}: SocialProofWidgetProps): react_jsx_runtime1.JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|