@envive-ai/react-toolkit-v3 0.3.16 → 0.3.18
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/AnimatedText/AnimatedText.d.cts +3 -3
- package/dist/AnimatedText/AnimatedText.d.ts +3 -3
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/Carousel/Carousel.cjs +7 -6
- package/dist/Carousel/Carousel.d.cts +3 -2
- package/dist/Carousel/Carousel.d.ts +3 -2
- package/dist/Carousel/Carousel.js +7 -6
- package/dist/Carousel/components/Container.cjs +2 -2
- package/dist/Carousel/components/Container.js +2 -2
- package/dist/Carousel/types/types.d.cts +5 -0
- package/dist/Carousel/types/types.d.ts +5 -0
- package/dist/ChatFooter/ChatFooter.cjs +1 -1
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/ChatFooter.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.js +1 -1
- package/dist/ChatFooter/components/Layout.cjs +2 -2
- package/dist/ChatFooter/components/Layout.js +2 -2
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/components/Handle.cjs +2 -2
- package/dist/ChatHeader/components/Handle.js +2 -2
- package/dist/ChatHeader/components/Toggle.cjs +3 -3
- package/dist/ChatHeader/components/Toggle.js +3 -3
- package/dist/ChatPreview/ChatPreview.cjs +1 -1
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +1 -1
- package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +1 -1
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +1 -1
- package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Headline.js +2 -2
- package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
- package/dist/ChatPreviewComparison/components/Layout.js +4 -4
- package/dist/ChatPreviewComparison/components/Message.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Message.js +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +174 -174
- package/dist/Container/Container.d.ts +174 -174
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/Disclaimer/components/Container.cjs +2 -2
- package/dist/Disclaimer/components/Container.js +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
- package/dist/FloatingButton/FloatingButton.d.cts +2 -2
- package/dist/FloatingButton/FloatingButton.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.cjs +10 -1
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.js +11 -2
- package/dist/FloatingChat/components/AgentMessage.cjs +7 -2
- package/dist/FloatingChat/components/AgentMessage.js +7 -2
- package/dist/FloatingChat/components/ChatMessages.cjs +4 -3
- package/dist/FloatingChat/components/ChatMessages.js +4 -3
- package/dist/FloatingChat/components/Layout.cjs +3 -3
- package/dist/FloatingChat/components/Layout.js +3 -3
- package/dist/FloatingChat/components/SalesAgentBadgeContent.cjs +59 -0
- package/dist/FloatingChat/components/SalesAgentBadgeContent.js +56 -0
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +14 -5
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +14 -5
- package/dist/FloatingChat/utils/functions.cjs +13 -1
- package/dist/FloatingChat/utils/functions.js +11 -1
- package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +11 -6
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +11 -6
- package/dist/FullPageSalesAgent/components/Layout.cjs +1 -2
- package/dist/FullPageSalesAgent/components/Layout.js +1 -2
- package/dist/FullPageSalesAgent/hooks/useContainerResizerObserver.cjs +4 -1
- package/dist/FullPageSalesAgent/hooks/useContainerResizerObserver.js +4 -1
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.ts +2 -2
- package/dist/ImageGallery/components/Layout.cjs +1 -1
- package/dist/ImageGallery/components/Layout.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/Message/components/LinkButton.cjs +1 -1
- package/dist/Message/components/LinkButton.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +2 -2
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +2 -2
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +16 -22
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +16 -22
- package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +3 -3
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/Container.cjs +2 -2
- package/dist/ReviewCard/components/Container.js +2 -2
- package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
- package/dist/ReviewCard/components/index.d.cts +6 -6
- package/dist/ReviewCard/components/index.d.ts +6 -6
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
- package/dist/SalesAgentProductCard/components/Container.cjs +2 -2
- package/dist/SalesAgentProductCard/components/Container.js +2 -2
- package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SocialProof/SocialProof.cjs +1 -1
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +1 -1
- package/dist/SocialProof/components/Headline.cjs +3 -3
- package/dist/SocialProof/components/Headline.js +3 -3
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/Subheadline.cjs +1 -1
- package/dist/SocialProof/components/Subheadline.js +1 -1
- package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
- package/dist/Tokens/index.cjs +1 -1
- package/dist/Tokens/index.js +1 -1
- package/dist/TypingAnimation/TypingAnimation.cjs +1 -1
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.js +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +2 -2
- package/dist/WelcomeMessage/components/Container.js +2 -2
- package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetTextField/WidgetTextField.js +1 -1
- package/dist/WidgetTextField/components/Container.cjs +2 -2
- package/dist/WidgetTextField/components/Container.js +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +1 -1
- package/dist/WidgetTextField/components/Icon.js +1 -1
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/Carousel/Carousel.tsx +11 -8
- package/src/components/Carousel/types/types.ts +5 -0
- package/src/components/FloatingChat/FloatingChat.tsx +18 -1
- package/src/components/FloatingChat/components/AgentMessage.tsx +8 -0
- package/src/components/FloatingChat/components/ChatMessages.tsx +3 -0
- package/src/components/FloatingChat/components/ModalSheet.tsx +1 -1
- package/src/components/FloatingChat/components/SalesAgentBadgeContent.tsx +86 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +18 -7
- package/src/components/FloatingChat/components/index.ts +0 -1
- package/src/components/FloatingChat/hooks/useFilteredChatMessages.ts +1 -1
- package/src/components/FloatingChat/utils/functions.ts +19 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +10 -6
- package/src/components/FullPageSalesAgent/components/Layout.tsx +1 -2
- package/src/components/FullPageSalesAgent/hooks/useContainerResizerObserver.ts +1 -0
- package/src/components/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.tsx +12 -9
- package/src/mocks/productCardMocks.ts +955 -0
|
@@ -14,6 +14,7 @@ import "../ChatHeader/index.js";
|
|
|
14
14
|
import { Disclaimer } from "../Disclaimer/Disclaimer.js";
|
|
15
15
|
import "../Disclaimer/index.js";
|
|
16
16
|
import { WelcomeMessage } from "../WelcomeMessage/WelcomeMessage.js";
|
|
17
|
+
import { getCleanProducts } from "./utils/functions.js";
|
|
17
18
|
import { Unit } from "./hooks/useSnapCalculator.js";
|
|
18
19
|
import { ModalSheet } from "./components/ModalSheet.js";
|
|
19
20
|
import { FloatingChatComponents } from "./components/index.js";
|
|
@@ -27,7 +28,7 @@ import { EnviveMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitud
|
|
|
27
28
|
import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
|
|
28
29
|
import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
|
|
29
30
|
import { motion } from "framer-motion";
|
|
30
|
-
import { ChatElementDisplayLocationV3 } from "@envive-ai/react-hooks/application/models";
|
|
31
|
+
import { ChatElementDisplayLocationV3, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
31
32
|
|
|
32
33
|
//#region src/components/FloatingChat/FloatingChat.tsx
|
|
33
34
|
const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTOM, salesAgentData, floatingChatConfig, hardcopyContent, lookAndFeelConfig, isCXButtonSwitchEnabled, isFloatingChatOpen, debugBar, onClose, onSwipeClose, onToggleCXButton }) => {
|
|
@@ -183,6 +184,13 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
183
184
|
text: welcomeMessageText,
|
|
184
185
|
theme: finalTheme
|
|
185
186
|
});
|
|
187
|
+
const handleExploreAllResults = (firstProductMessageId) => {
|
|
188
|
+
const products = getCleanProducts(messages.find((block) => block.some((msg) => msg.type === MessageType.Product && msg.id === firstProductMessageId))?.filter((msg) => msg.type === MessageType.Product) ?? []);
|
|
189
|
+
console.log("[INFO] [spiffy-ai] Explore All Results clicked", {
|
|
190
|
+
firstProductMessageId,
|
|
191
|
+
products
|
|
192
|
+
});
|
|
193
|
+
};
|
|
186
194
|
const chatMessages = /* @__PURE__ */ jsx(FloatingChatComponents.ChatMessages, {
|
|
187
195
|
theme: finalTheme,
|
|
188
196
|
ref: chatMessagesRef,
|
|
@@ -196,7 +204,8 @@ const FloatingChat = ({ id, className, style, testId, theme = Theme.GLOBAL_CUSTO
|
|
|
196
204
|
neverShowSingleProductCards,
|
|
197
205
|
showVerifiedBuyer,
|
|
198
206
|
onFormResponseSubmitted,
|
|
199
|
-
parentWidget: WidgetInteractionComponent.FLOATING_CHAT
|
|
207
|
+
parentWidget: WidgetInteractionComponent.FLOATING_CHAT,
|
|
208
|
+
onExploreAllResults: handleExploreAllResults
|
|
200
209
|
});
|
|
201
210
|
const answerSuggestionsComponent = /* @__PURE__ */ jsx(PromptCarousel, {
|
|
202
211
|
className: "envive-tw-flex envive-tw-justify-end envive-tw-p-4 [&>div>div]:envive-tw-items-end",
|
|
@@ -20,7 +20,7 @@ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks
|
|
|
20
20
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
21
21
|
|
|
22
22
|
//#region src/components/FloatingChat/components/AgentMessage.tsx
|
|
23
|
-
const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, onFormResponseSubmitted, parentWidget }) => {
|
|
23
|
+
const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, onFormResponseSubmitted, parentWidget, onExploreAllResults }) => {
|
|
24
24
|
const handleFormSubmittedAtomFallback = require_react.useSetAtom(__envive_ai_react_hooks_atoms_chat.handleFormSubmittedAtom);
|
|
25
25
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
26
26
|
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
@@ -92,12 +92,17 @@ const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, ty
|
|
|
92
92
|
if (type === __envive_ai_react_hooks_application_models.MessageType.Product) {
|
|
93
93
|
const products = require_functions.getCleanProducts(messages);
|
|
94
94
|
if (products.length === 1 && neverShowSingleProductCards) return null;
|
|
95
|
+
const handleExploreAllResults = () => {
|
|
96
|
+
const firstProductMessageId = messages[0]?.id ?? "";
|
|
97
|
+
onExploreAllResults?.(firstProductMessageId);
|
|
98
|
+
};
|
|
95
99
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SalesAgentProductCardsCarousel.SalesAgentProductCardsCarousel, {
|
|
96
100
|
hideNavigation: products.length === 1,
|
|
97
101
|
products,
|
|
98
102
|
numberOfProducts: products.length,
|
|
99
103
|
theme: finalTheme,
|
|
100
|
-
onProductCardClick: handleProductCardClick
|
|
104
|
+
onProductCardClick: handleProductCardClick,
|
|
105
|
+
onExploreAllResults: handleExploreAllResults
|
|
101
106
|
});
|
|
102
107
|
}
|
|
103
108
|
if (type === __envive_ai_react_hooks_application_models.MessageType.Page) {
|
|
@@ -19,7 +19,7 @@ import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
|
19
19
|
import { handleFormSubmittedAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
20
20
|
|
|
21
21
|
//#region src/components/FloatingChat/components/AgentMessage.tsx
|
|
22
|
-
const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, onFormResponseSubmitted, parentWidget }) => {
|
|
22
|
+
const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages, hideAgentName = false, isResponseStreaming = false, isPendingResponse = false, neverShowSingleProductCards = false, showVerifiedBuyer = false, onFormResponseSubmitted, parentWidget, onExploreAllResults }) => {
|
|
23
23
|
const handleFormSubmittedAtomFallback = useSetAtom(handleFormSubmittedAtom);
|
|
24
24
|
const finalTheme = resolveTheme(theme);
|
|
25
25
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
@@ -91,12 +91,17 @@ const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages,
|
|
|
91
91
|
if (type === MessageType.Product) {
|
|
92
92
|
const products = getCleanProducts(messages);
|
|
93
93
|
if (products.length === 1 && neverShowSingleProductCards) return null;
|
|
94
|
+
const handleExploreAllResults = () => {
|
|
95
|
+
const firstProductMessageId = messages[0]?.id ?? "";
|
|
96
|
+
onExploreAllResults?.(firstProductMessageId);
|
|
97
|
+
};
|
|
94
98
|
return /* @__PURE__ */ jsx(SalesAgentProductCardsCarousel, {
|
|
95
99
|
hideNavigation: products.length === 1,
|
|
96
100
|
products,
|
|
97
101
|
numberOfProducts: products.length,
|
|
98
102
|
theme: finalTheme,
|
|
99
|
-
onProductCardClick: handleProductCardClick
|
|
103
|
+
onProductCardClick: handleProductCardClick,
|
|
104
|
+
onExploreAllResults: handleExploreAllResults
|
|
100
105
|
});
|
|
101
106
|
}
|
|
102
107
|
if (type === MessageType.Page) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
|
|
3
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
4
3
|
const require_Stack = require('../../Stack/Stack.cjs');
|
|
5
4
|
require('../../Stack/index.cjs');
|
|
6
5
|
const require_index = require('../../Typography/types/index.cjs');
|
|
7
6
|
const require_Typography = require('../../Typography/Typography.cjs');
|
|
8
7
|
require('../../Typography/index.cjs');
|
|
8
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
9
9
|
const require_index$1 = require('../../Message/types/index.cjs');
|
|
10
10
|
const require_Message = require('../../Message/Message.cjs');
|
|
11
11
|
require('../../Message/index.cjs');
|
|
@@ -20,7 +20,7 @@ classnames = require_rolldown_runtime.__toESM(classnames);
|
|
|
20
20
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
21
21
|
|
|
22
22
|
//#region src/components/FloatingChat/components/ChatMessages.tsx
|
|
23
|
-
const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, onFormResponseSubmitted, parentWidget }, ref) => {
|
|
23
|
+
const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, onFormResponseSubmitted, parentWidget, onExploreAllResults }, ref) => {
|
|
24
24
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
25
25
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
26
26
|
ref,
|
|
@@ -70,7 +70,8 @@ const ChatMessages = (0, react.forwardRef)(({ theme = require_theme.Theme.GLOBAL
|
|
|
70
70
|
neverShowSingleProductCards,
|
|
71
71
|
showVerifiedBuyer,
|
|
72
72
|
onFormResponseSubmitted,
|
|
73
|
-
parentWidget
|
|
73
|
+
parentWidget,
|
|
74
|
+
onExploreAllResults
|
|
74
75
|
}, assistantMessageId);
|
|
75
76
|
}
|
|
76
77
|
return null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
3
2
|
import { Stack } from "../../Stack/Stack.js";
|
|
4
3
|
import "../../Stack/index.js";
|
|
5
4
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
6
5
|
import { Typography } from "../../Typography/Typography.js";
|
|
7
6
|
import "../../Typography/index.js";
|
|
7
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
8
8
|
import { MessageVariant } from "../../Message/types/index.js";
|
|
9
9
|
import { Message } from "../../Message/Message.js";
|
|
10
10
|
import "../../Message/index.js";
|
|
@@ -18,7 +18,7 @@ import classNames from "classnames";
|
|
|
18
18
|
import { MessageRole, MessageType } from "@envive-ai/react-hooks/application/models";
|
|
19
19
|
|
|
20
20
|
//#region src/components/FloatingChat/components/ChatMessages.tsx
|
|
21
|
-
const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, onFormResponseSubmitted, parentWidget }, ref) => {
|
|
21
|
+
const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agentName, messages, hasFilteredMessages, handlePreviousDiscussions, isLoading, isResponseStreaming, ignoreFirstModelResponse, neverShowSingleProductCards, showVerifiedBuyer, onFormResponseSubmitted, parentWidget, onExploreAllResults }, ref) => {
|
|
22
22
|
const finalTheme = resolveTheme(theme);
|
|
23
23
|
return /* @__PURE__ */ jsxs(Stack, {
|
|
24
24
|
ref,
|
|
@@ -68,7 +68,8 @@ const ChatMessages = forwardRef(({ theme = Theme.GLOBAL_CUSTOM, className, agent
|
|
|
68
68
|
neverShowSingleProductCards,
|
|
69
69
|
showVerifiedBuyer,
|
|
70
70
|
onFormResponseSubmitted,
|
|
71
|
-
parentWidget
|
|
71
|
+
parentWidget,
|
|
72
|
+
onExploreAllResults
|
|
72
73
|
}, assistantMessageId);
|
|
73
74
|
}
|
|
74
75
|
return null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
|
|
3
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
4
|
-
const require_Container = require('../../Container/Container.cjs');
|
|
5
|
-
require('../../Container/index.cjs');
|
|
6
3
|
const require_Stack = require('../../Stack/Stack.cjs');
|
|
7
4
|
require('../../Stack/index.cjs');
|
|
5
|
+
const require_Container = require('../../Container/Container.cjs');
|
|
6
|
+
require('../../Container/index.cjs');
|
|
7
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let classnames = require("classnames");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
3
|
-
import { Container } from "../../Container/Container.js";
|
|
4
|
-
import "../../Container/index.js";
|
|
5
2
|
import { Stack } from "../../Stack/Stack.js";
|
|
6
3
|
import "../../Stack/index.js";
|
|
4
|
+
import { Container } from "../../Container/Container.js";
|
|
5
|
+
import "../../Container/index.js";
|
|
6
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
7
7
|
import { isValidElement } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import classNames from "classnames";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Stack = require('../../Stack/Stack.cjs');
|
|
3
|
+
const require_ArrowIcon = require('../../Carousel/components/ArrowIcon.cjs');
|
|
4
|
+
const require_index = require('../../Typography/types/index.cjs');
|
|
5
|
+
const require_Typography = require('../../Typography/Typography.cjs');
|
|
6
|
+
require('../../Typography/index.cjs');
|
|
7
|
+
const require_functions = require('../utils/functions.cjs');
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let classnames = require("classnames");
|
|
12
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
13
|
+
|
|
14
|
+
//#region src/components/FloatingChat/components/SalesAgentBadgeContent.tsx
|
|
15
|
+
const SalesAgentBadgeContent = ({ totalProducts, displayLimit = require_functions.MOST_RELEVANT_DISPLAY_LIMIT, onExploreAllResults }) => {
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
17
|
+
direction: "row",
|
|
18
|
+
justify: "between",
|
|
19
|
+
align: "center",
|
|
20
|
+
gap: "1",
|
|
21
|
+
className: "envive-tw-w-full envive-tw-rounded-global-custom envive-tw-p-2",
|
|
22
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Typography.Typography, {
|
|
23
|
+
variant: require_index.TypographyVariant.B3_MD,
|
|
24
|
+
color: require_index.TypographyColor.TEXT_PRIMARY,
|
|
25
|
+
children: [
|
|
26
|
+
"Most Relevant (",
|
|
27
|
+
displayLimit,
|
|
28
|
+
")"
|
|
29
|
+
]
|
|
30
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
onClick: onExploreAllResults,
|
|
33
|
+
className: (0, classnames.default)("envive-tw-flex envive-tw-items-center envive-tw-gap-1", "envive-tw-bg-background-secondary envive-tw-p-2", "envive-tw-rounded-global-custom envive-tw-border envive-tw-border-border-medium", "hover:envive-tw-border-border-dark"),
|
|
34
|
+
"aria-label": `Explore all ${totalProducts} results`,
|
|
35
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Typography.Typography, {
|
|
36
|
+
variant: require_index.TypographyVariant.B3_MD,
|
|
37
|
+
color: require_index.TypographyColor.TEXT_LINK,
|
|
38
|
+
children: [
|
|
39
|
+
"Explore All Results (",
|
|
40
|
+
totalProducts,
|
|
41
|
+
")"
|
|
42
|
+
]
|
|
43
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ArrowIcon.ArrowIcon, { direction: "right" })]
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const getBadgeContentAndLabel = ({ totalProducts, areProductsMoreThanDisplayLimit, onExploreAllResults, displayLimit = require_functions.MOST_RELEVANT_DISPLAY_LIMIT }) => {
|
|
48
|
+
return {
|
|
49
|
+
badgeContent: areProductsMoreThanDisplayLimit ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SalesAgentBadgeContent, {
|
|
50
|
+
totalProducts,
|
|
51
|
+
displayLimit,
|
|
52
|
+
onExploreAllResults
|
|
53
|
+
}) : null,
|
|
54
|
+
badgeLabel: !areProductsMoreThanDisplayLimit && totalProducts > 1 ? `${totalProducts} Products` : null
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.getBadgeContentAndLabel = getBadgeContentAndLabel;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Stack } from "../../Stack/Stack.js";
|
|
2
|
+
import { ArrowIcon } from "../../Carousel/components/ArrowIcon.js";
|
|
3
|
+
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
4
|
+
import { Typography } from "../../Typography/Typography.js";
|
|
5
|
+
import "../../Typography/index.js";
|
|
6
|
+
import { MOST_RELEVANT_DISPLAY_LIMIT } from "../utils/functions.js";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import classNames from "classnames";
|
|
10
|
+
|
|
11
|
+
//#region src/components/FloatingChat/components/SalesAgentBadgeContent.tsx
|
|
12
|
+
const SalesAgentBadgeContent = ({ totalProducts, displayLimit = MOST_RELEVANT_DISPLAY_LIMIT, onExploreAllResults }) => {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
14
|
+
direction: "row",
|
|
15
|
+
justify: "between",
|
|
16
|
+
align: "center",
|
|
17
|
+
gap: "1",
|
|
18
|
+
className: "envive-tw-w-full envive-tw-rounded-global-custom envive-tw-p-2",
|
|
19
|
+
children: [/* @__PURE__ */ jsxs(Typography, {
|
|
20
|
+
variant: TypographyVariant.B3_MD,
|
|
21
|
+
color: TypographyColor.TEXT_PRIMARY,
|
|
22
|
+
children: [
|
|
23
|
+
"Most Relevant (",
|
|
24
|
+
displayLimit,
|
|
25
|
+
")"
|
|
26
|
+
]
|
|
27
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: onExploreAllResults,
|
|
30
|
+
className: classNames("envive-tw-flex envive-tw-items-center envive-tw-gap-1", "envive-tw-bg-background-secondary envive-tw-p-2", "envive-tw-rounded-global-custom envive-tw-border envive-tw-border-border-medium", "hover:envive-tw-border-border-dark"),
|
|
31
|
+
"aria-label": `Explore all ${totalProducts} results`,
|
|
32
|
+
children: [/* @__PURE__ */ jsxs(Typography, {
|
|
33
|
+
variant: TypographyVariant.B3_MD,
|
|
34
|
+
color: TypographyColor.TEXT_LINK,
|
|
35
|
+
children: [
|
|
36
|
+
"Explore All Results (",
|
|
37
|
+
totalProducts,
|
|
38
|
+
")"
|
|
39
|
+
]
|
|
40
|
+
}), /* @__PURE__ */ jsx(ArrowIcon, { direction: "right" })]
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const getBadgeContentAndLabel = ({ totalProducts, areProductsMoreThanDisplayLimit, onExploreAllResults, displayLimit = MOST_RELEVANT_DISPLAY_LIMIT }) => {
|
|
45
|
+
return {
|
|
46
|
+
badgeContent: areProductsMoreThanDisplayLimit ? /* @__PURE__ */ jsx(SalesAgentBadgeContent, {
|
|
47
|
+
totalProducts,
|
|
48
|
+
displayLimit,
|
|
49
|
+
onExploreAllResults
|
|
50
|
+
}) : null,
|
|
51
|
+
badgeLabel: !areProductsMoreThanDisplayLimit && totalProducts > 1 ? `${totalProducts} Products` : null
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { getBadgeContentAndLabel };
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
3
3
|
const require_Carousel = require('../../Carousel/Carousel.cjs');
|
|
4
|
+
const require_functions = require('../utils/functions.cjs');
|
|
4
5
|
const require_types = require('../../SalesAgentProductCard/types/types.cjs');
|
|
5
6
|
const require_SalesAgentProductCard = require('../../SalesAgentProductCard/SalesAgentProductCard.cjs');
|
|
7
|
+
const require_SalesAgentBadgeContent = require('./SalesAgentBadgeContent.cjs');
|
|
6
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
9
|
|
|
8
10
|
//#region src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx
|
|
9
|
-
const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = require_types.SalesAgentProductCardVariant.LARGE, onProductCardClick }) => {
|
|
11
|
+
const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = require_types.SalesAgentProductCardVariant.LARGE, onProductCardClick, onExploreAllResults }) => {
|
|
10
12
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
11
|
-
const
|
|
13
|
+
const { totalProducts, areProductsMoreThanDisplayLimit, displayedProducts } = require_functions.getProductCarouselDisplayInfo(products, numberOfProducts);
|
|
14
|
+
const forceShowCurrentPriceSpace = displayedProducts.some((product) => product.currentPrice && product.previousPrice !== product.currentPrice);
|
|
15
|
+
const { badgeContent, badgeLabel } = require_SalesAgentBadgeContent.getBadgeContentAndLabel({
|
|
16
|
+
totalProducts,
|
|
17
|
+
areProductsMoreThanDisplayLimit,
|
|
18
|
+
onExploreAllResults
|
|
19
|
+
});
|
|
12
20
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Carousel.Carousel, {
|
|
13
21
|
hideNavigation,
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
badgeContent,
|
|
23
|
+
badgeLabel,
|
|
24
|
+
elements: displayedProducts.map((product, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SalesAgentProductCard.SalesAgentProductCard, {
|
|
16
25
|
variant,
|
|
17
26
|
productName: product.productName,
|
|
18
27
|
currentPrice: product.currentPrice,
|
|
@@ -26,7 +35,7 @@ const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = fals
|
|
|
26
35
|
target: "_blank",
|
|
27
36
|
theme: finalTheme,
|
|
28
37
|
onClick: () => onProductCardClick(product)
|
|
29
|
-
}, product.id)),
|
|
38
|
+
}, product.id ?? `product-${index}`)),
|
|
30
39
|
theme: finalTheme
|
|
31
40
|
});
|
|
32
41
|
};
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
2
2
|
import { Carousel } from "../../Carousel/Carousel.js";
|
|
3
|
+
import { getProductCarouselDisplayInfo } from "../utils/functions.js";
|
|
3
4
|
import { SalesAgentProductCardVariant } from "../../SalesAgentProductCard/types/types.js";
|
|
4
5
|
import { SalesAgentProductCard } from "../../SalesAgentProductCard/SalesAgentProductCard.js";
|
|
6
|
+
import { getBadgeContentAndLabel } from "./SalesAgentBadgeContent.js";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
|
|
7
9
|
//#region src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx
|
|
8
|
-
const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = SalesAgentProductCardVariant.LARGE, onProductCardClick }) => {
|
|
10
|
+
const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = false, numberOfProducts, variant = SalesAgentProductCardVariant.LARGE, onProductCardClick, onExploreAllResults }) => {
|
|
9
11
|
const finalTheme = resolveTheme(theme);
|
|
10
|
-
const
|
|
12
|
+
const { totalProducts, areProductsMoreThanDisplayLimit, displayedProducts } = getProductCarouselDisplayInfo(products, numberOfProducts);
|
|
13
|
+
const forceShowCurrentPriceSpace = displayedProducts.some((product) => product.currentPrice && product.previousPrice !== product.currentPrice);
|
|
14
|
+
const { badgeContent, badgeLabel } = getBadgeContentAndLabel({
|
|
15
|
+
totalProducts,
|
|
16
|
+
areProductsMoreThanDisplayLimit,
|
|
17
|
+
onExploreAllResults
|
|
18
|
+
});
|
|
11
19
|
return /* @__PURE__ */ jsx(Carousel, {
|
|
12
20
|
hideNavigation,
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
badgeContent,
|
|
22
|
+
badgeLabel,
|
|
23
|
+
elements: displayedProducts.map((product, index) => /* @__PURE__ */ jsx(SalesAgentProductCard, {
|
|
15
24
|
variant,
|
|
16
25
|
productName: product.productName,
|
|
17
26
|
currentPrice: product.currentPrice,
|
|
@@ -25,7 +34,7 @@ const SalesAgentProductCardsCarousel = ({ products, theme, hideNavigation = fals
|
|
|
25
34
|
target: "_blank",
|
|
26
35
|
theme: finalTheme,
|
|
27
36
|
onClick: () => onProductCardClick(product)
|
|
28
|
-
}, product.id)),
|
|
37
|
+
}, product.id ?? `product-${index}`)),
|
|
29
38
|
theme: finalTheme
|
|
30
39
|
});
|
|
31
40
|
};
|
|
@@ -76,11 +76,23 @@ const getCleanOrders = (messages) => {
|
|
|
76
76
|
return null;
|
|
77
77
|
}).filter((o) => o !== null);
|
|
78
78
|
};
|
|
79
|
+
const MOST_RELEVANT_DISPLAY_LIMIT = 8;
|
|
80
|
+
const getProductCarouselDisplayInfo = (products, numberOfProducts, displayLimit = MOST_RELEVANT_DISPLAY_LIMIT) => {
|
|
81
|
+
const totalProducts = numberOfProducts ?? products.length;
|
|
82
|
+
const areProductsMoreThanDisplayLimit = totalProducts > displayLimit;
|
|
83
|
+
return {
|
|
84
|
+
totalProducts,
|
|
85
|
+
areProductsMoreThanDisplayLimit,
|
|
86
|
+
displayedProducts: areProductsMoreThanDisplayLimit ? products.slice(0, displayLimit) : products
|
|
87
|
+
};
|
|
88
|
+
};
|
|
79
89
|
|
|
80
90
|
//#endregion
|
|
91
|
+
exports.MOST_RELEVANT_DISPLAY_LIMIT = MOST_RELEVANT_DISPLAY_LIMIT;
|
|
81
92
|
exports.checkIfHideAgentName = checkIfHideAgentName;
|
|
82
93
|
exports.getCleanDocuments = getCleanDocuments;
|
|
83
94
|
exports.getCleanOrders = getCleanOrders;
|
|
84
95
|
exports.getCleanProducts = getCleanProducts;
|
|
85
96
|
exports.getCleanReviews = getCleanReviews;
|
|
86
|
-
exports.getGroupableMessages = getGroupableMessages;
|
|
97
|
+
exports.getGroupableMessages = getGroupableMessages;
|
|
98
|
+
exports.getProductCarouselDisplayInfo = getProductCarouselDisplayInfo;
|
|
@@ -75,6 +75,16 @@ const getCleanOrders = (messages) => {
|
|
|
75
75
|
return null;
|
|
76
76
|
}).filter((o) => o !== null);
|
|
77
77
|
};
|
|
78
|
+
const MOST_RELEVANT_DISPLAY_LIMIT = 8;
|
|
79
|
+
const getProductCarouselDisplayInfo = (products, numberOfProducts, displayLimit = MOST_RELEVANT_DISPLAY_LIMIT) => {
|
|
80
|
+
const totalProducts = numberOfProducts ?? products.length;
|
|
81
|
+
const areProductsMoreThanDisplayLimit = totalProducts > displayLimit;
|
|
82
|
+
return {
|
|
83
|
+
totalProducts,
|
|
84
|
+
areProductsMoreThanDisplayLimit,
|
|
85
|
+
displayedProducts: areProductsMoreThanDisplayLimit ? products.slice(0, displayLimit) : products
|
|
86
|
+
};
|
|
87
|
+
};
|
|
78
88
|
|
|
79
89
|
//#endregion
|
|
80
|
-
export { checkIfHideAgentName, getCleanDocuments, getCleanOrders, getCleanProducts, getCleanReviews, getGroupableMessages };
|
|
90
|
+
export { MOST_RELEVANT_DISPLAY_LIMIT, checkIfHideAgentName, getCleanDocuments, getCleanOrders, getCleanProducts, getCleanReviews, getGroupableMessages, getProductCarouselDisplayInfo };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_theme = require('../packages/components-v3/tokens/theme/theme.cjs');
|
|
3
|
-
require('../Tokens/index.cjs');
|
|
4
3
|
const require_resolveTheme = require('../utils/resolveTheme.cjs');
|
|
4
|
+
require('../Tokens/index.cjs');
|
|
5
5
|
const require_usePromptCarouselAnalytics = require('../PromptCarousel/hooks/usePromptCarouselAnalytics.cjs');
|
|
6
6
|
const require_PromptButton_types_index = require('../PromptButton/types/index.cjs');
|
|
7
7
|
require('../PromptButton/index.cjs');
|
|
@@ -19,6 +19,7 @@ const require_useScrollToBottom = require('../FloatingChat/hooks/useScrollToBott
|
|
|
19
19
|
require('../WelcomeMessage/index.cjs');
|
|
20
20
|
const require_useIsMobile = require('./hooks/useIsMobile.cjs');
|
|
21
21
|
const require_useGetFooterStyles = require('./hooks/useGetFooterStyles.cjs');
|
|
22
|
+
const require_useGetScrollContentStyles = require('./hooks/useGetScrollContentStyles.cjs');
|
|
22
23
|
const require_index$1 = require('./components/index.cjs');
|
|
23
24
|
const require_useGetMessagesStyles = require('./hooks/useGetMessagesStyles.cjs');
|
|
24
25
|
let react = require("react");
|
|
@@ -37,6 +38,7 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
|
|
|
37
38
|
const chatMessagesRef = (0, react.useRef)(null);
|
|
38
39
|
const { footerStyles, footerClasses } = require_useGetFooterStyles.useGetFooterStyles();
|
|
39
40
|
const { messageClasses } = require_useGetMessagesStyles.useGetMessagesStyles();
|
|
41
|
+
const { messageContainerClasses } = require_useGetScrollContentStyles.useGetScrollContentStyles();
|
|
40
42
|
const { isMobile } = require_useIsMobile.useIsMobile();
|
|
41
43
|
const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
|
|
42
44
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = require_usePromptCarouselAnalytics.usePromptCarouselAnalytics(__envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, (text) => text);
|
|
@@ -80,11 +82,14 @@ const FullPageSalesAgent = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, floatin
|
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
84
|
};
|
|
83
|
-
const welcomeMessage = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
const welcomeMessage = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
86
|
+
className: messageContainerClasses,
|
|
87
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WelcomeMessage.WelcomeMessage, {
|
|
88
|
+
sparkleIconColor: welcomeMessageIconColor,
|
|
89
|
+
title: welcomeMessageTitle,
|
|
90
|
+
text: welcomeMessageText,
|
|
91
|
+
theme: resolvedTheme
|
|
92
|
+
})
|
|
88
93
|
});
|
|
89
94
|
const footer = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ChatFooter.ChatFooter, {
|
|
90
95
|
className: footerClasses,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Theme } from "../tokens/theme/theme.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
import { FloatingChatConfig, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
4
4
|
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
5
5
|
|
|
@@ -19,6 +19,6 @@ declare const FullPageSalesAgent: ({
|
|
|
19
19
|
hardcopyContent,
|
|
20
20
|
headerContainer,
|
|
21
21
|
autoHeight
|
|
22
|
-
}: FullPageSalesAgentProps) =>
|
|
22
|
+
}: FullPageSalesAgentProps) => react_jsx_runtime15.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FullPageSalesAgent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
3
3
|
import { FloatingChatConfig, LookAndFeelConfig } from "@envive-ai/react-hooks/contexts/typesV3";
|
|
4
4
|
import { HardcopyResponse } from "@envive-ai/react-hooks/contexts/hardcopyContext";
|
|
5
5
|
|
|
@@ -19,6 +19,6 @@ declare const FullPageSalesAgent: ({
|
|
|
19
19
|
hardcopyContent,
|
|
20
20
|
headerContainer,
|
|
21
21
|
autoHeight
|
|
22
|
-
}: FullPageSalesAgentProps) =>
|
|
22
|
+
}: FullPageSalesAgentProps) => react_jsx_runtime21.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FullPageSalesAgent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import "../Tokens/index.js";
|
|
3
2
|
import { resolveTheme } from "../utils/resolveTheme.js";
|
|
3
|
+
import "../Tokens/index.js";
|
|
4
4
|
import { usePromptCarouselAnalytics } from "../PromptCarousel/hooks/usePromptCarouselAnalytics.js";
|
|
5
5
|
import { PromptButtonVariant } from "../PromptButton/types/index.js";
|
|
6
6
|
import "../PromptButton/index.js";
|
|
@@ -18,6 +18,7 @@ import { useScrollToBottom } from "../FloatingChat/hooks/useScrollToBottom.js";
|
|
|
18
18
|
import "../WelcomeMessage/index.js";
|
|
19
19
|
import { useIsMobile } from "./hooks/useIsMobile.js";
|
|
20
20
|
import { useGetFooterStyles } from "./hooks/useGetFooterStyles.js";
|
|
21
|
+
import { useGetScrollContentStyles } from "./hooks/useGetScrollContentStyles.js";
|
|
21
22
|
import { FullPageSAComponents } from "./components/index.js";
|
|
22
23
|
import { useGetMessagesStyles } from "./hooks/useGetMessagesStyles.js";
|
|
23
24
|
import { useRef, useState } from "react";
|
|
@@ -36,6 +37,7 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
36
37
|
const chatMessagesRef = useRef(null);
|
|
37
38
|
const { footerStyles, footerClasses } = useGetFooterStyles();
|
|
38
39
|
const { messageClasses } = useGetMessagesStyles();
|
|
40
|
+
const { messageContainerClasses } = useGetScrollContentStyles();
|
|
39
41
|
const { isMobile } = useIsMobile();
|
|
40
42
|
const { trackWidgetInteraction } = useWidgetInteraction();
|
|
41
43
|
const { onDrag, onHover, onMouseDown, onMouseUp, onTouchStart, onTouchEnd } = usePromptCarouselAnalytics(WidgetInteractionComponent.FULL_PAGE_SALES_AGENT, (text) => text);
|
|
@@ -79,11 +81,14 @@ const FullPageSalesAgent = ({ theme = Theme.GLOBAL_CUSTOM, floatingChatConfig, l
|
|
|
79
81
|
}
|
|
80
82
|
});
|
|
81
83
|
};
|
|
82
|
-
const welcomeMessage = /* @__PURE__ */ jsx(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
const welcomeMessage = /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: messageContainerClasses,
|
|
86
|
+
children: /* @__PURE__ */ jsx(WelcomeMessage, {
|
|
87
|
+
sparkleIconColor: welcomeMessageIconColor,
|
|
88
|
+
title: welcomeMessageTitle,
|
|
89
|
+
text: welcomeMessageText,
|
|
90
|
+
theme: resolvedTheme
|
|
91
|
+
})
|
|
87
92
|
});
|
|
88
93
|
const footer = /* @__PURE__ */ jsx(ChatFooter, {
|
|
89
94
|
className: footerClasses,
|
|
@@ -16,7 +16,7 @@ const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions
|
|
|
16
16
|
const hasWelcomeMessage = (0, react.isValidElement)(welcomeMessage);
|
|
17
17
|
const hasAnswerSuggestions = (0, react.isValidElement)(answerSuggestions);
|
|
18
18
|
const { isMobile } = require_useIsMobile.useIsMobile();
|
|
19
|
-
const { contentClasses
|
|
19
|
+
const { contentClasses } = require_useGetScrollContentStyles.useGetScrollContentStyles();
|
|
20
20
|
const { footerContainerClasses } = require_useGetFooterStyles.useGetFooterStyles();
|
|
21
21
|
const { containerClasses, containerStyles } = require_useGetContainerStyles.useGetContainerStyles({
|
|
22
22
|
headerContainer,
|
|
@@ -28,7 +28,6 @@ const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions
|
|
|
28
28
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
29
29
|
className: contentClasses,
|
|
30
30
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
|
|
31
|
-
className: messageContainerClasses,
|
|
32
31
|
direction: "column",
|
|
33
32
|
justify: "between",
|
|
34
33
|
children: [welcomeMessage, disclaimer]
|
|
@@ -14,7 +14,7 @@ const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions
|
|
|
14
14
|
const hasWelcomeMessage = isValidElement(welcomeMessage);
|
|
15
15
|
const hasAnswerSuggestions = isValidElement(answerSuggestions);
|
|
16
16
|
const { isMobile } = useIsMobile();
|
|
17
|
-
const { contentClasses
|
|
17
|
+
const { contentClasses } = useGetScrollContentStyles();
|
|
18
18
|
const { footerContainerClasses } = useGetFooterStyles();
|
|
19
19
|
const { containerClasses, containerStyles } = useGetContainerStyles({
|
|
20
20
|
headerContainer,
|
|
@@ -26,7 +26,6 @@ const Layout = ({ theme, welcomeMessage, footer, chatMessages, answerSuggestions
|
|
|
26
26
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
27
27
|
className: contentClasses,
|
|
28
28
|
children: [/* @__PURE__ */ jsxs(Stack, {
|
|
29
|
-
className: messageContainerClasses,
|
|
30
29
|
direction: "column",
|
|
31
30
|
justify: "between",
|
|
32
31
|
children: [welcomeMessage, disclaimer]
|
|
@@ -5,7 +5,10 @@ let react = require("react");
|
|
|
5
5
|
const useContainerResizerObserver = ({ headerContainer, autoHeight }) => {
|
|
6
6
|
const [containerHeight, setContainerHeight] = (0, react.useState)("100%");
|
|
7
7
|
(0, react.useEffect)(() => {
|
|
8
|
-
if (!autoHeight)
|
|
8
|
+
if (!autoHeight) {
|
|
9
|
+
setContainerHeight("100%");
|
|
10
|
+
return () => {};
|
|
11
|
+
}
|
|
9
12
|
const watchResizing = () => {
|
|
10
13
|
const { height = 0, top = 0 } = document.querySelector(headerContainer)?.getBoundingClientRect() || {};
|
|
11
14
|
setContainerHeight(window.innerHeight - (height + top));
|
|
@@ -4,7 +4,10 @@ import { useEffect, useState } from "react";
|
|
|
4
4
|
const useContainerResizerObserver = ({ headerContainer, autoHeight }) => {
|
|
5
5
|
const [containerHeight, setContainerHeight] = useState("100%");
|
|
6
6
|
useEffect(() => {
|
|
7
|
-
if (!autoHeight)
|
|
7
|
+
if (!autoHeight) {
|
|
8
|
+
setContainerHeight("100%");
|
|
9
|
+
return () => {};
|
|
10
|
+
}
|
|
8
11
|
const watchResizing = () => {
|
|
9
12
|
const { height = 0, top = 0 } = document.querySelector(headerContainer)?.getBoundingClientRect() || {};
|
|
10
13
|
setContainerHeight(window.innerHeight - (height + top));
|
package/dist/Image/Image.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Image/Image.d.ts
|
|
5
5
|
|
|
@@ -25,6 +25,6 @@ declare const Image: ({
|
|
|
25
25
|
role,
|
|
26
26
|
"aria-hidden": ariaHidden,
|
|
27
27
|
...rest
|
|
28
|
-
}: ImageProps) =>
|
|
28
|
+
}: ImageProps) => react_jsx_runtime25.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Image };
|