@envive-ai/react-toolkit-v3 0.3.8 → 0.3.10
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.cjs +1 -0
- package/dist/AnimatedText/AnimatedText.d.cts +3 -3
- package/dist/AnimatedText/AnimatedText.js +1 -0
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/Carousel/Carousel.cjs +1 -1
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/Carousel.js +1 -1
- package/dist/Carousel/components/Container.cjs +2 -2
- package/dist/Carousel/components/Container.js +2 -2
- 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/ChatHeader/hooks/useGetCloseButtonProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +1 -1
- package/dist/ChatPreview/ChatPreview.cjs +14 -4
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +14 -4
- package/dist/ChatPreview/types/types.d.cts +5 -4
- package/dist/ChatPreview/types/types.d.ts +5 -4
- package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +14 -4
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +14 -4
- 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/ChatPreviewComparison/types/types.d.cts +4 -4
- package/dist/ChatPreviewComparison/types/types.d.ts +4 -4
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/Container/Container.d.cts +5 -5
- package/dist/Container/Container.d.ts +176 -176
- 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/FloatingChat/FloatingChat.cjs +3 -2
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.js +3 -2
- package/dist/FloatingChat/components/AgentMessage.cjs +9 -5
- package/dist/FloatingChat/components/AgentMessage.js +9 -5
- package/dist/FloatingChat/components/ChatMessages.cjs +1 -1
- package/dist/FloatingChat/components/ChatMessages.js +1 -1
- package/dist/FloatingChat/components/Layout.cjs +13 -13
- package/dist/FloatingChat/components/Layout.js +13 -13
- package/dist/FloatingChat/components/ModalSheet.cjs +5 -6
- package/dist/FloatingChat/components/ModalSheet.js +5 -6
- package/dist/FloatingChat/components/ReviewCardsCarousel.cjs +2 -1
- package/dist/FloatingChat/components/ReviewCardsCarousel.js +2 -1
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +0 -3
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +0 -3
- 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 +10 -6
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +5 -2
- package/dist/ProductCard/components/Header.cjs +2 -2
- package/dist/ProductCard/components/Header.js +2 -2
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.cjs +3 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.js +3 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +7 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.js +8 -3
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +53 -3
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +53 -3
- package/dist/PromptCarousel/PromptCarousel.cjs +71 -33
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +73 -35
- package/dist/PromptCarousel/hooks/index.cjs +2 -4
- package/dist/PromptCarousel/hooks/index.js +2 -4
- package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.cjs +91 -0
- package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.js +90 -0
- package/dist/PromptCarousel/hooks/useScrollSync.cjs +65 -0
- package/dist/PromptCarousel/hooks/useScrollSync.js +64 -0
- 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 +4 -4
- 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 +6 -6
- 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/Stack/Stack.d.cts +2 -2
- package/dist/TextField/utils/getIconColor.cjs +1 -1
- package/dist/TextField/utils/getIconColor.js +1 -1
- package/dist/TextField/utils/getSendIconElement.cjs +1 -1
- package/dist/TextField/utils/getSendIconElement.js +1 -1
- 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 +11 -6
- package/dist/WidgetTextField/WidgetTextField.d.cts +3 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +3 -2
- package/dist/WidgetTextField/WidgetTextField.js +7 -2
- package/dist/WidgetTextField/components/Container.cjs +2 -2
- package/dist/WidgetTextField/components/Container.js +2 -2
- package/dist/WidgetTextField/components/FakeTextInput.cjs +2 -2
- package/dist/WidgetTextField/components/FakeTextInput.js +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +11 -9
- package/dist/WidgetTextField/components/Icon.js +11 -9
- package/dist/WidgetTextField/types/types.d.cts +3 -0
- package/dist/WidgetTextField/types/types.d.ts +3 -0
- 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/dist/utils/CustomIcon.cjs +1 -1
- package/dist/utils/CustomIcon.js +1 -1
- package/dist/utils/useDragToScroll.cjs +68 -0
- package/dist/utils/useDragToScroll.js +67 -0
- package/package.json +1 -1
- package/src/components/AnimatedText/AnimatedText.tsx +2 -0
- package/src/components/ChatHeader/hooks/useGetCloseButtonProperties.ts +1 -1
- package/src/components/ChatPreview/ChatPreview.tsx +20 -3
- package/src/components/ChatPreview/types/types.ts +5 -4
- package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +20 -3
- package/src/components/ChatPreviewComparison/types/types.ts +4 -4
- package/src/components/FloatingChat/FloatingChat.tsx +3 -2
- package/src/components/FloatingChat/components/AgentMessage.tsx +1 -0
- package/src/components/FloatingChat/components/Layout.tsx +7 -2
- package/src/components/FloatingChat/components/ModalSheet.tsx +5 -7
- package/src/components/FloatingChat/components/ReviewCardsCarousel.tsx +3 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +0 -3
- package/src/components/ProductCard/ProductCard.tsx +12 -1
- package/src/components/ProductCard/components/Header.tsx +10 -8
- package/src/components/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.tsx +6 -3
- package/src/components/PromptButtonCarouselWithImage/components/Layout.tsx +13 -4
- package/src/components/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.tsx +63 -20
- package/src/components/PromptCarousel/PromptCarousel.tsx +89 -51
- package/src/components/PromptCarousel/hooks/index.ts +2 -4
- package/src/components/PromptCarousel/hooks/useCoordinatedScrollAnimation.ts +115 -0
- package/src/components/PromptCarousel/hooks/useHorizontalScrollAnimation.ts +71 -78
- package/src/components/PromptCarousel/hooks/useScrollSync.ts +83 -0
- package/src/components/TextField/utils/getIconColor.ts +1 -1
- package/src/components/TextField/utils/getSendIconElement.tsx +3 -1
- package/src/components/WidgetTextField/WidgetTextField.tsx +9 -1
- package/src/components/WidgetTextField/components/FakeTextInput.tsx +6 -2
- package/src/components/WidgetTextField/components/Icon.tsx +44 -9
- package/src/components/WidgetTextField/types/types.ts +3 -0
- package/src/components/utils/CustomIcon.tsx +1 -1
- package/src/components/utils/useDragToScroll.ts +83 -0
- package/dist/PromptCarousel/components/BlockScrollContainer.cjs +0 -23
- package/dist/PromptCarousel/components/BlockScrollContainer.js +0 -21
- package/dist/PromptCarousel/components/ButtonContainerRow.cjs +0 -34
- package/dist/PromptCarousel/components/ButtonContainerRow.js +0 -32
- package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.cjs +0 -45
- package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.js +0 -44
- package/dist/PromptCarousel/components/CarouselContentWithRowScroll.cjs +0 -33
- package/dist/PromptCarousel/components/CarouselContentWithRowScroll.js +0 -32
- package/dist/PromptCarousel/components/index.cjs +0 -13
- package/dist/PromptCarousel/components/index.js +0 -13
- package/dist/PromptCarousel/hooks/useButtonScrollPosition.cjs +0 -79
- package/dist/PromptCarousel/hooks/useButtonScrollPosition.js +0 -78
- package/dist/PromptCarousel/hooks/useCarouselAnimation.cjs +0 -23
- package/dist/PromptCarousel/hooks/useCarouselAnimation.js +0 -22
- package/dist/PromptCarousel/hooks/useCarouselRefs.cjs +0 -20
- package/dist/PromptCarousel/hooks/useCarouselRefs.js +0 -19
- package/dist/PromptCarousel/hooks/useGetScrollProperties.cjs +0 -18
- package/dist/PromptCarousel/hooks/useGetScrollProperties.js +0 -17
- package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.cjs +0 -78
- package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.js +0 -77
- package/src/components/PromptCarousel/components/BlockScrollContainer.tsx +0 -34
- package/src/components/PromptCarousel/components/ButtonContainerRow.tsx +0 -46
- package/src/components/PromptCarousel/components/CarouselContentWithBlockScroll.tsx +0 -83
- package/src/components/PromptCarousel/components/CarouselContentWithRowScroll.tsx +0 -71
- package/src/components/PromptCarousel/components/index.ts +0 -9
- package/src/components/PromptCarousel/hooks/useButtonScrollPosition.ts +0 -128
- package/src/components/PromptCarousel/hooks/useCarouselAnimation.ts +0 -47
- package/src/components/PromptCarousel/hooks/useCarouselRefs.ts +0 -27
|
@@ -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_PromptButton_types_index = require('../PromptButton/types/index.cjs');
|
|
6
6
|
require('../PromptButton/index.cjs');
|
|
7
7
|
const require_PromptCarousel_types_types = require('../PromptCarousel/types/types.cjs');
|
|
@@ -12,15 +12,25 @@ const require_WidgetTextField = require('../WidgetTextField/WidgetTextField.cjs'
|
|
|
12
12
|
require('../WidgetTextField/index.cjs');
|
|
13
13
|
const require_WidgetWrapperWithTitle = require('../WidgetWrapperWithTitle/WidgetWrapperWithTitle.cjs');
|
|
14
14
|
const require_index = require('./components/index.cjs');
|
|
15
|
+
let react = require("react");
|
|
15
16
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
17
|
|
|
17
18
|
//#region src/components/ChatPreviewComparison/ChatPreviewComparison.tsx
|
|
18
19
|
const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEventProps }) => {
|
|
19
20
|
const { id, testId, className, style } = baseProps ?? {};
|
|
20
21
|
const { theme = require_theme.Theme.GLOBAL_CUSTOM, variant = require_types.WidgetWrapperVariant.CARD_WITH_BORDER, hideImage, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
|
|
21
|
-
const { headlineText, messageText,
|
|
22
|
+
const { headlineText, messageText, promptButtons, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
|
|
22
23
|
const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
23
24
|
const finalTheme = require_resolveTheme.resolveTheme(theme);
|
|
25
|
+
const suggestionTextMap = (0, react.useMemo)(() => {
|
|
26
|
+
return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
|
|
27
|
+
}, [promptButtons]);
|
|
28
|
+
const promptButtonTexts = (0, react.useMemo)(() => {
|
|
29
|
+
return Object.keys(suggestionTextMap);
|
|
30
|
+
}, [suggestionTextMap]);
|
|
31
|
+
const handleSuggestionButtonClick = (0, react.useCallback)((text) => {
|
|
32
|
+
handlePromptButtonClick?.(suggestionTextMap[text]);
|
|
33
|
+
}, [handlePromptButtonClick, suggestionTextMap]);
|
|
24
34
|
const headline = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.ChatPreviewComparisonComponents.Headline, {
|
|
25
35
|
headlineText: headlineText ?? "",
|
|
26
36
|
theme: finalTheme
|
|
@@ -33,12 +43,12 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
|
|
|
33
43
|
promptButtonTexts: promptButtonTexts ?? [],
|
|
34
44
|
promptButtonType: require_PromptButton_types_index.PromptButtonVariant.SUGGESTED_RESPONSE,
|
|
35
45
|
promptCarouselRows: require_PromptCarousel_types_types.PromptCarouselRows.ALWAYS_ONE,
|
|
36
|
-
handleButtonClick:
|
|
46
|
+
handleButtonClick: handleSuggestionButtonClick
|
|
37
47
|
});
|
|
38
48
|
const widgetTextField = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetTextField.WidgetTextField, {
|
|
39
49
|
theme: finalTheme,
|
|
40
50
|
placeholder: textFieldPlaceholderText ?? "",
|
|
41
|
-
onClick: () => handleTextFieldClick?.(
|
|
51
|
+
onClick: () => handleTextFieldClick?.()
|
|
42
52
|
});
|
|
43
53
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetWrapperWithTitle.WidgetWrapperWithTitle, {
|
|
44
54
|
id,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewComparisonProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewComparison/ChatPreviewComparison.d.ts
|
|
5
5
|
declare const ChatPreviewComparison: ({
|
|
@@ -7,6 +7,6 @@ declare const ChatPreviewComparison: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: ChatPreviewComparisonProps) =>
|
|
10
|
+
}: ChatPreviewComparisonProps) => react_jsx_runtime21.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreviewComparison };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewComparisonProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewComparison/ChatPreviewComparison.d.ts
|
|
5
5
|
declare const ChatPreviewComparison: ({
|
|
@@ -7,6 +7,6 @@ declare const ChatPreviewComparison: ({
|
|
|
7
7
|
widgetContentProps,
|
|
8
8
|
widgetStyleProps,
|
|
9
9
|
widgetEventProps
|
|
10
|
-
}: ChatPreviewComparisonProps) =>
|
|
10
|
+
}: ChatPreviewComparisonProps) => react_jsx_runtime31.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ChatPreviewComparison };
|
|
@@ -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 { PromptButtonVariant } from "../PromptButton/types/index.js";
|
|
5
5
|
import "../PromptButton/index.js";
|
|
6
6
|
import { PromptCarouselRows } from "../PromptCarousel/types/types.js";
|
|
@@ -11,15 +11,25 @@ import { WidgetTextField } from "../WidgetTextField/WidgetTextField.js";
|
|
|
11
11
|
import "../WidgetTextField/index.js";
|
|
12
12
|
import { WidgetWrapperWithTitle } from "../WidgetWrapperWithTitle/WidgetWrapperWithTitle.js";
|
|
13
13
|
import { ChatPreviewComparisonComponents } from "./components/index.js";
|
|
14
|
+
import { useCallback, useMemo } from "react";
|
|
14
15
|
import { jsx } from "react/jsx-runtime";
|
|
15
16
|
|
|
16
17
|
//#region src/components/ChatPreviewComparison/ChatPreviewComparison.tsx
|
|
17
18
|
const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEventProps }) => {
|
|
18
19
|
const { id, testId, className, style } = baseProps ?? {};
|
|
19
20
|
const { theme = Theme.GLOBAL_CUSTOM, variant = WidgetWrapperVariant.CARD_WITH_BORDER, hideImage, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
|
|
20
|
-
const { headlineText, messageText,
|
|
21
|
+
const { headlineText, messageText, promptButtons, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
|
|
21
22
|
const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
|
|
22
23
|
const finalTheme = resolveTheme(theme);
|
|
24
|
+
const suggestionTextMap = useMemo(() => {
|
|
25
|
+
return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
|
|
26
|
+
}, [promptButtons]);
|
|
27
|
+
const promptButtonTexts = useMemo(() => {
|
|
28
|
+
return Object.keys(suggestionTextMap);
|
|
29
|
+
}, [suggestionTextMap]);
|
|
30
|
+
const handleSuggestionButtonClick = useCallback((text) => {
|
|
31
|
+
handlePromptButtonClick?.(suggestionTextMap[text]);
|
|
32
|
+
}, [handlePromptButtonClick, suggestionTextMap]);
|
|
23
33
|
const headline = /* @__PURE__ */ jsx(ChatPreviewComparisonComponents.Headline, {
|
|
24
34
|
headlineText: headlineText ?? "",
|
|
25
35
|
theme: finalTheme
|
|
@@ -32,12 +42,12 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
|
|
|
32
42
|
promptButtonTexts: promptButtonTexts ?? [],
|
|
33
43
|
promptButtonType: PromptButtonVariant.SUGGESTED_RESPONSE,
|
|
34
44
|
promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
|
|
35
|
-
handleButtonClick:
|
|
45
|
+
handleButtonClick: handleSuggestionButtonClick
|
|
36
46
|
});
|
|
37
47
|
const widgetTextField = /* @__PURE__ */ jsx(WidgetTextField, {
|
|
38
48
|
theme: finalTheme,
|
|
39
49
|
placeholder: textFieldPlaceholderText ?? "",
|
|
40
|
-
onClick: () => handleTextFieldClick?.(
|
|
50
|
+
onClick: () => handleTextFieldClick?.()
|
|
41
51
|
});
|
|
42
52
|
return /* @__PURE__ */ jsx(WidgetWrapperWithTitle, {
|
|
43
53
|
id,
|
|
@@ -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
|
-
require('../../Tokens/index.cjs');
|
|
4
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
5
3
|
const require_index = require('../../Typography/types/index.cjs');
|
|
6
4
|
const require_Typography = require('../../Typography/Typography.cjs');
|
|
7
5
|
require('../../Typography/index.cjs');
|
|
6
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
7
|
+
require('../../Tokens/index.cjs');
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
|
|
10
10
|
//#region src/components/ChatPreviewComparison/components/Headline.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import "../../Tokens/index.js";
|
|
3
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
4
2
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
5
3
|
import { Typography } from "../../Typography/Typography.js";
|
|
6
4
|
import "../../Typography/index.js";
|
|
5
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
6
|
+
import "../../Tokens/index.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/components/ChatPreviewComparison/components/Headline.tsx
|
|
@@ -3,12 +3,12 @@ const require_utils = require('../../DesignTokens/components/utils.cjs');
|
|
|
3
3
|
const require_aspectRatio = require('../../packages/components-v3/tokens/aspectRatio/aspectRatio.cjs');
|
|
4
4
|
const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
|
|
5
5
|
const require_breakpoints = require('../../packages/components-v3/tokens/breakpoints/breakpoints.cjs');
|
|
6
|
-
require('../../Tokens/index.cjs');
|
|
7
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
8
|
-
const require_Container = require('../../Container/Container.cjs');
|
|
9
|
-
require('../../Container/index.cjs');
|
|
10
6
|
const require_Stack = require('../../Stack/Stack.cjs');
|
|
11
7
|
require('../../Stack/index.cjs');
|
|
8
|
+
const require_Container = require('../../Container/Container.cjs');
|
|
9
|
+
require('../../Container/index.cjs');
|
|
10
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
11
|
+
require('../../Tokens/index.cjs');
|
|
12
12
|
const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
|
|
13
13
|
const require_useGetContentSize = require('../../utils/useGetContentSize.cjs');
|
|
14
14
|
const require_functions = require('../../SocialProof/utils/functions.cjs');
|
|
@@ -2,12 +2,12 @@ import { getCSSVariable } from "../../DesignTokens/components/utils.js";
|
|
|
2
2
|
import { AspectRatioCSSVar } from "../../packages/components-v3/tokens/aspectRatio/aspectRatio.js";
|
|
3
3
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
4
4
|
import { screensBreakpointsVariables } from "../../packages/components-v3/tokens/breakpoints/breakpoints.js";
|
|
5
|
-
import "../../Tokens/index.js";
|
|
6
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
7
|
-
import { Container } from "../../Container/Container.js";
|
|
8
|
-
import "../../Container/index.js";
|
|
9
5
|
import { Stack } from "../../Stack/Stack.js";
|
|
10
6
|
import "../../Stack/index.js";
|
|
7
|
+
import { Container } from "../../Container/Container.js";
|
|
8
|
+
import "../../Container/index.js";
|
|
9
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
10
|
+
import "../../Tokens/index.js";
|
|
11
11
|
import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
|
|
12
12
|
import { useGetContentSize } from "../../utils/useGetContentSize.js";
|
|
13
13
|
import { calculateWidthImageGallery } from "../../SocialProof/utils/functions.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
5
3
|
const require_index = require('../../Typography/types/index.cjs');
|
|
6
4
|
require('../../Typography/index.cjs');
|
|
5
|
+
const require_resolveTheme = require('../../utils/resolveTheme.cjs');
|
|
6
|
+
require('../../Tokens/index.cjs');
|
|
7
7
|
const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
-
import "../../Tokens/index.js";
|
|
3
|
-
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
4
2
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
5
3
|
import "../../Typography/index.js";
|
|
4
|
+
import { resolveTheme } from "../../utils/resolveTheme.js";
|
|
5
|
+
import "../../Tokens/index.js";
|
|
6
6
|
import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
|
|
7
7
|
import { Suspense, lazy } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Theme } from "../../tokens/theme/theme.cjs";
|
|
2
2
|
import { WidgetWrapperVariant } from "../../WidgetWrapper/types/types.cjs";
|
|
3
3
|
import { ImageGalleryImage } from "../../ImageGallery/types/types.cjs";
|
|
4
|
+
import { Suggestion } from "@envive-ai/react-hooks/application/models";
|
|
4
5
|
|
|
5
6
|
//#region src/components/ChatPreviewComparison/types/types.d.ts
|
|
6
7
|
|
|
@@ -53,7 +54,7 @@ type WidgetContentProps = {
|
|
|
53
54
|
/**
|
|
54
55
|
* Array of text labels for the prompt buttons.
|
|
55
56
|
*/
|
|
56
|
-
|
|
57
|
+
promptButtons?: Suggestion[];
|
|
57
58
|
/**
|
|
58
59
|
* Placeholder text for the text field input.
|
|
59
60
|
* Displayed when the text field is visible.
|
|
@@ -119,13 +120,12 @@ type WidgetEventProps = {
|
|
|
119
120
|
*
|
|
120
121
|
* @param text - The text label of the clicked prompt button
|
|
121
122
|
*/
|
|
122
|
-
handlePromptButtonClick?: (
|
|
123
|
+
handlePromptButtonClick?: (suggestion: Suggestion) => void;
|
|
123
124
|
/**
|
|
124
125
|
* Callback function invoked when the text field is clicked.
|
|
125
126
|
*
|
|
126
|
-
* @param text - The placeholder text of the text field
|
|
127
127
|
*/
|
|
128
|
-
handleTextFieldClick?: (
|
|
128
|
+
handleTextFieldClick?: () => void;
|
|
129
129
|
};
|
|
130
130
|
/**
|
|
131
131
|
* Props for the ChatPreviewComparison component.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
2
|
import { WidgetWrapperVariant } from "../../WidgetWrapper/types/types.js";
|
|
3
3
|
import { ImageGalleryImage } from "../../ImageGallery/types/types.js";
|
|
4
|
+
import { Suggestion } from "@envive-ai/react-hooks/application/models";
|
|
4
5
|
|
|
5
6
|
//#region src/components/ChatPreviewComparison/types/types.d.ts
|
|
6
7
|
|
|
@@ -53,7 +54,7 @@ type WidgetContentProps = {
|
|
|
53
54
|
/**
|
|
54
55
|
* Array of text labels for the prompt buttons.
|
|
55
56
|
*/
|
|
56
|
-
|
|
57
|
+
promptButtons?: Suggestion[];
|
|
57
58
|
/**
|
|
58
59
|
* Placeholder text for the text field input.
|
|
59
60
|
* Displayed when the text field is visible.
|
|
@@ -119,13 +120,12 @@ type WidgetEventProps = {
|
|
|
119
120
|
*
|
|
120
121
|
* @param text - The text label of the clicked prompt button
|
|
121
122
|
*/
|
|
122
|
-
handlePromptButtonClick?: (
|
|
123
|
+
handlePromptButtonClick?: (suggestion: Suggestion) => void;
|
|
123
124
|
/**
|
|
124
125
|
* Callback function invoked when the text field is clicked.
|
|
125
126
|
*
|
|
126
|
-
* @param text - The placeholder text of the text field
|
|
127
127
|
*/
|
|
128
|
-
handleTextFieldClick?: (
|
|
128
|
+
handleTextFieldClick?: () => void;
|
|
129
129
|
};
|
|
130
130
|
/**
|
|
131
131
|
* Props for the ChatPreviewComparison component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatPreviewLoadingProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ChatPreviewLoading/ChatPreviewLoading.d.ts
|
|
5
5
|
declare const ChatPreviewLoading: ({
|
|
@@ -15,6 +15,6 @@ declare const ChatPreviewLoading: ({
|
|
|
15
15
|
hideLogo,
|
|
16
16
|
logoSrc,
|
|
17
17
|
titleLabel
|
|
18
|
-
}: ChatPreviewLoadingProps) =>
|
|
18
|
+
}: ChatPreviewLoadingProps) => react_jsx_runtime18.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { ChatPreviewLoading };
|
|
@@ -18,9 +18,11 @@ declare const Container: ({
|
|
|
18
18
|
centerContent,
|
|
19
19
|
...props
|
|
20
20
|
}: ContainerProps & Omit<React.HTMLAttributes<HTMLElement>, "className" | "style" | "component">) => react10.DetailedReactHTMLElement<{
|
|
21
|
-
title?: string | undefined;
|
|
22
|
-
content?: string | undefined;
|
|
23
21
|
onClick?: react10.MouseEventHandler<HTMLElement>;
|
|
22
|
+
color?: string | undefined;
|
|
23
|
+
slot?: string | undefined;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
"aria-label"?: string | undefined;
|
|
24
26
|
defaultChecked?: boolean | undefined;
|
|
25
27
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
26
28
|
suppressContentEditableWarning?: boolean | undefined;
|
|
@@ -36,13 +38,13 @@ declare const Container: ({
|
|
|
36
38
|
hidden?: boolean | undefined;
|
|
37
39
|
lang?: string | undefined;
|
|
38
40
|
nonce?: string | undefined;
|
|
39
|
-
slot?: string | undefined;
|
|
40
41
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
41
42
|
tabIndex?: number | undefined;
|
|
42
43
|
translate?: "yes" | "no" | undefined;
|
|
43
44
|
radioGroup?: string | undefined;
|
|
44
45
|
role?: react10.AriaRole | undefined;
|
|
45
46
|
about?: string | undefined;
|
|
47
|
+
content?: string | undefined;
|
|
46
48
|
datatype?: string | undefined;
|
|
47
49
|
inlist?: any;
|
|
48
50
|
prefix?: string | undefined;
|
|
@@ -54,7 +56,6 @@ declare const Container: ({
|
|
|
54
56
|
vocab?: string | undefined;
|
|
55
57
|
autoCorrect?: string | undefined;
|
|
56
58
|
autoSave?: string | undefined;
|
|
57
|
-
color?: string | undefined;
|
|
58
59
|
itemProp?: string | undefined;
|
|
59
60
|
itemScope?: boolean | undefined;
|
|
60
61
|
itemType?: string | undefined;
|
|
@@ -97,7 +98,6 @@ declare const Container: ({
|
|
|
97
98
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
98
99
|
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
99
100
|
"aria-keyshortcuts"?: string | undefined;
|
|
100
|
-
"aria-label"?: string | undefined;
|
|
101
101
|
"aria-labelledby"?: string | undefined;
|
|
102
102
|
"aria-level"?: number | undefined;
|
|
103
103
|
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|