@envive-ai/react-toolkit-v3 0.3.29 → 0.3.31
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/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.d.cts +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/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +218 -218
- package/dist/Container/Container.d.ts +218 -218
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/FloatingButton/FloatingButton.cjs +2 -1
- package/dist/FloatingButton/FloatingButton.d.cts +4 -3
- package/dist/FloatingButton/FloatingButton.d.ts +4 -3
- package/dist/FloatingButton/FloatingButton.js +2 -1
- package/dist/FloatingButton/components/Container.cjs +2 -1
- package/dist/FloatingButton/components/Container.js +2 -1
- package/dist/FloatingButton/types/types.d.cts +4 -0
- package/dist/FloatingButton/types/types.d.ts +4 -0
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FloatingChat/components/AgentMessage.cjs +1 -0
- package/dist/FloatingChat/components/AgentMessage.js +1 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
- 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/MarkdownProcessor/MarkdownProcessor.cjs +7 -3
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +4 -3
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +4 -3
- package/dist/MarkdownProcessor/MarkdownProcessor.js +7 -3
- package/dist/MarkdownProcessor/components/MarkdownLink.cjs +3 -2
- package/dist/MarkdownProcessor/components/MarkdownLink.js +3 -2
- package/dist/MarkdownProcessor/types/types.d.cts +5 -0
- package/dist/MarkdownProcessor/types/types.d.ts +5 -0
- package/dist/MarkdownProcessor/utils/functions.cjs +2 -1
- package/dist/MarkdownProcessor/utils/functions.js +2 -1
- package/dist/Message/Message.cjs +5 -4
- package/dist/Message/Message.d.cts +2 -1
- package/dist/Message/Message.d.ts +2 -1
- package/dist/Message/Message.js +5 -4
- package/dist/Message/components/AgentContent.cjs +3 -2
- package/dist/Message/components/AgentContent.js +3 -2
- package/dist/Message/components/LinkButton.cjs +2 -2
- package/dist/Message/components/LinkButton.d.cts +4 -1
- package/dist/Message/components/LinkButton.d.ts +4 -1
- package/dist/Message/components/LinkButton.js +2 -2
- package/dist/Message/hooks/useGetLinkButtonIconProperties.cjs +4 -3
- package/dist/Message/hooks/useGetLinkButtonIconProperties.js +4 -3
- package/dist/Message/types/index.d.cts +4 -0
- package/dist/Message/types/index.d.ts +4 -0
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +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/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- 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/index.d.cts +6 -6
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetTextField/hooks/useGetContainerProperties.cjs +3 -2
- package/dist/WidgetTextField/hooks/useGetContainerProperties.js +3 -2
- package/dist/WidgetWrapper/WidgetWrapper.cjs +8 -1
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.js +8 -1
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.cjs +1 -1
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/FloatingButton/FloatingButton.tsx +2 -0
- package/src/components/FloatingButton/components/Container.tsx +3 -0
- package/src/components/FloatingButton/types/types.ts +4 -0
- package/src/components/FloatingChat/components/AgentMessage.tsx +1 -0
- package/src/components/MarkdownProcessor/MarkdownProcessor.tsx +3 -2
- package/src/components/MarkdownProcessor/components/MarkdownLink.tsx +4 -1
- package/src/components/MarkdownProcessor/types/types.ts +5 -0
- package/src/components/MarkdownProcessor/utils/functions.tsx +4 -0
- package/src/components/Message/Message.tsx +4 -2
- package/src/components/Message/components/AgentContent.tsx +4 -0
- package/src/components/Message/components/LinkButton.tsx +4 -1
- package/src/components/Message/hooks/useGetLinkButtonIconProperties.ts +7 -3
- package/src/components/Message/types/index.ts +3 -0
- package/src/components/WidgetTextField/hooks/useGetContainerProperties.ts +2 -1
- package/src/components/WidgetWrapper/WidgetWrapper.tsx +10 -2
- package/src/components/WidgetWrapperWithTitle/WidgetWrapperWithTitle.tsx +5 -5
- package/src/components/utils/resolveTheme.ts +2 -2
|
@@ -40,6 +40,10 @@ type FloatingButtonBackgroundColor = Extract<ColorNames, 'background-primary' |
|
|
|
40
40
|
* Props for the FloatingButton component.
|
|
41
41
|
*/
|
|
42
42
|
type FloatingButtonProps = {
|
|
43
|
+
/**
|
|
44
|
+
* Ref forwarded to the outermost container div.
|
|
45
|
+
*/
|
|
46
|
+
containerRef?: React.RefObject<HTMLDivElement>;
|
|
43
47
|
/**
|
|
44
48
|
* Unique identifier for the floating button element.
|
|
45
49
|
*/
|
|
@@ -40,6 +40,10 @@ type FloatingButtonBackgroundColor = Extract<ColorNames, 'background-primary' |
|
|
|
40
40
|
* Props for the FloatingButton component.
|
|
41
41
|
*/
|
|
42
42
|
type FloatingButtonProps = {
|
|
43
|
+
/**
|
|
44
|
+
* Ref forwarded to the outermost container div.
|
|
45
|
+
*/
|
|
46
|
+
containerRef?: React.RefObject<HTMLDivElement>;
|
|
43
47
|
/**
|
|
44
48
|
* Unique identifier for the floating button element.
|
|
45
49
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingChatProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime29 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FloatingChat/FloatingChat.d.ts
|
|
5
5
|
declare const FloatingChat: ({
|
|
@@ -19,6 +19,6 @@ declare const FloatingChat: ({
|
|
|
19
19
|
onSwipeClose,
|
|
20
20
|
onToggleCXButton,
|
|
21
21
|
setIsResultsModalOpen
|
|
22
|
-
}: FloatingChatProps) =>
|
|
22
|
+
}: FloatingChatProps) => react_jsx_runtime29.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FloatingChat };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingChatProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime24 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FloatingChat/FloatingChat.d.ts
|
|
5
5
|
declare const FloatingChat: ({
|
|
@@ -19,6 +19,6 @@ declare const FloatingChat: ({
|
|
|
19
19
|
onSwipeClose,
|
|
20
20
|
onToggleCXButton,
|
|
21
21
|
setIsResultsModalOpen
|
|
22
|
-
}: FloatingChatProps) =>
|
|
22
|
+
}: FloatingChatProps) => react_jsx_runtime24.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FloatingChat };
|
|
@@ -65,6 +65,7 @@ const AgentMessage = ({ theme = require_theme.Theme.GLOBAL_CUSTOM, agentName, ty
|
|
|
65
65
|
};
|
|
66
66
|
if (textContentMessageTypes.has(type)) return messages.map((msg) => {
|
|
67
67
|
if (msg.type === __envive_ai_react_hooks_application_models.MessageType.Text && msg.metadata.content) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Message.Message, {
|
|
68
|
+
theme: finalTheme,
|
|
68
69
|
variant: require_index.MessageVariant.AGENT,
|
|
69
70
|
agentName: hideAgentName ? void 0 : agentName,
|
|
70
71
|
showSparkle: isResponseStreaming || isPendingResponse,
|
|
@@ -64,6 +64,7 @@ const AgentMessage = ({ theme = Theme.GLOBAL_CUSTOM, agentName, type, messages,
|
|
|
64
64
|
};
|
|
65
65
|
if (textContentMessageTypes.has(type)) return messages.map((msg) => {
|
|
66
66
|
if (msg.type === MessageType.Text && msg.metadata.content) return /* @__PURE__ */ jsx(Message, {
|
|
67
|
+
theme: finalTheme,
|
|
67
68
|
variant: MessageVariant.AGENT,
|
|
68
69
|
agentName: hideAgentName ? void 0 : agentName,
|
|
69
70
|
showSparkle: isResponseStreaming || isPendingResponse,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Theme } from "../tokens/theme/theme.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
3
3
|
import { FloatingChatConfig, FullPageSalesAgentWidgetV3Config, 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
|
widgetConfig,
|
|
20
20
|
hardcopyContent,
|
|
21
21
|
voiceInputEnabled
|
|
22
|
-
}: FullPageSalesAgentProps) =>
|
|
22
|
+
}: FullPageSalesAgentProps) => react_jsx_runtime25.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_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { FloatingChatConfig, FullPageSalesAgentWidgetV3Config, 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
|
widgetConfig,
|
|
20
20
|
hardcopyContent,
|
|
21
21
|
voiceInputEnabled
|
|
22
|
-
}: FullPageSalesAgentProps) =>
|
|
22
|
+
}: FullPageSalesAgentProps) => react_jsx_runtime0.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FullPageSalesAgent };
|
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_runtime21 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_runtime21.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Image };
|
package/dist/Image/Image.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 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_runtime10.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Image };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageGalleryProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ImageGallery/ImageGallery.d.ts
|
|
5
5
|
|
|
@@ -40,6 +40,6 @@ declare const ImageGallery: ({
|
|
|
40
40
|
"aria-describedby": ariaDescribedBy,
|
|
41
41
|
role,
|
|
42
42
|
"aria-hidden": ariaHidden
|
|
43
|
-
}: ImageGalleryProps) =>
|
|
43
|
+
}: ImageGalleryProps) => react_jsx_runtime0.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { ImageGallery };
|
|
@@ -7,14 +7,17 @@ let react_markdown = require("react-markdown");
|
|
|
7
7
|
react_markdown = require_rolldown_runtime.__toESM(react_markdown);
|
|
8
8
|
|
|
9
9
|
//#region src/components/MarkdownProcessor/MarkdownProcessor.tsx
|
|
10
|
-
const MarkdownProcessor = ({ content, clampParagraphs = void 0, textColor, textVariant, onLinkClick }) => {
|
|
10
|
+
const MarkdownProcessor = ({ content, clampParagraphs = void 0, textColor, textVariant, onLinkClick, theme }) => {
|
|
11
11
|
const processedContent = content.replace(/<br\s*[\\/]?>/gi, "\n\n");
|
|
12
12
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_markdown.default, {
|
|
13
13
|
components: (0, react.useMemo)(() => ({
|
|
14
14
|
li: require_index.MarkdownProcessorComponents.MarkdownListItem,
|
|
15
15
|
ul: require_index.MarkdownProcessorComponents.MarkdownUnorderedList,
|
|
16
16
|
ol: require_index.MarkdownProcessorComponents.MarkdownOrderedList,
|
|
17
|
-
a: require_functions.createMarkdownLinkComponent({
|
|
17
|
+
a: require_functions.createMarkdownLinkComponent({
|
|
18
|
+
onLinkClick,
|
|
19
|
+
theme
|
|
20
|
+
}),
|
|
18
21
|
p: require_functions.createMarkdownParagraphComponent({
|
|
19
22
|
clampParagraphs,
|
|
20
23
|
textColor,
|
|
@@ -24,7 +27,8 @@ const MarkdownProcessor = ({ content, clampParagraphs = void 0, textColor, textV
|
|
|
24
27
|
clampParagraphs,
|
|
25
28
|
textColor,
|
|
26
29
|
textVariant,
|
|
27
|
-
onLinkClick
|
|
30
|
+
onLinkClick,
|
|
31
|
+
theme
|
|
28
32
|
]),
|
|
29
33
|
children: processedContent
|
|
30
34
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarkdownProcessorProps } from "./types/types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/MarkdownProcessor/MarkdownProcessor.d.ts
|
|
5
5
|
declare const MarkdownProcessor: ({
|
|
@@ -7,7 +7,8 @@ declare const MarkdownProcessor: ({
|
|
|
7
7
|
clampParagraphs,
|
|
8
8
|
textColor,
|
|
9
9
|
textVariant,
|
|
10
|
-
onLinkClick
|
|
11
|
-
|
|
10
|
+
onLinkClick,
|
|
11
|
+
theme
|
|
12
|
+
}: MarkdownProcessorProps) => react_jsx_runtime2.JSX.Element;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { MarkdownProcessor };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarkdownProcessorProps } from "./types/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/MarkdownProcessor/MarkdownProcessor.d.ts
|
|
5
5
|
declare const MarkdownProcessor: ({
|
|
@@ -7,7 +7,8 @@ declare const MarkdownProcessor: ({
|
|
|
7
7
|
clampParagraphs,
|
|
8
8
|
textColor,
|
|
9
9
|
textVariant,
|
|
10
|
-
onLinkClick
|
|
11
|
-
|
|
10
|
+
onLinkClick,
|
|
11
|
+
theme
|
|
12
|
+
}: MarkdownProcessorProps) => react_jsx_runtime22.JSX.Element;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { MarkdownProcessor };
|
|
@@ -5,14 +5,17 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import ReactMarkdown from "react-markdown";
|
|
6
6
|
|
|
7
7
|
//#region src/components/MarkdownProcessor/MarkdownProcessor.tsx
|
|
8
|
-
const MarkdownProcessor = ({ content, clampParagraphs = void 0, textColor, textVariant, onLinkClick }) => {
|
|
8
|
+
const MarkdownProcessor = ({ content, clampParagraphs = void 0, textColor, textVariant, onLinkClick, theme }) => {
|
|
9
9
|
const processedContent = content.replace(/<br\s*[\\/]?>/gi, "\n\n");
|
|
10
10
|
return /* @__PURE__ */ jsx(ReactMarkdown, {
|
|
11
11
|
components: useMemo(() => ({
|
|
12
12
|
li: MarkdownProcessorComponents.MarkdownListItem,
|
|
13
13
|
ul: MarkdownProcessorComponents.MarkdownUnorderedList,
|
|
14
14
|
ol: MarkdownProcessorComponents.MarkdownOrderedList,
|
|
15
|
-
a: createMarkdownLinkComponent({
|
|
15
|
+
a: createMarkdownLinkComponent({
|
|
16
|
+
onLinkClick,
|
|
17
|
+
theme
|
|
18
|
+
}),
|
|
16
19
|
p: createMarkdownParagraphComponent({
|
|
17
20
|
clampParagraphs,
|
|
18
21
|
textColor,
|
|
@@ -22,7 +25,8 @@ const MarkdownProcessor = ({ content, clampParagraphs = void 0, textColor, textV
|
|
|
22
25
|
clampParagraphs,
|
|
23
26
|
textColor,
|
|
24
27
|
textVariant,
|
|
25
|
-
onLinkClick
|
|
28
|
+
onLinkClick,
|
|
29
|
+
theme
|
|
26
30
|
]),
|
|
27
31
|
children: processedContent
|
|
28
32
|
});
|
|
@@ -5,11 +5,12 @@ const require_LinkButton = require('../../Message/components/LinkButton.cjs');
|
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
|
|
7
7
|
//#region src/components/MarkdownProcessor/components/MarkdownLink.tsx
|
|
8
|
-
const MarkdownLink = ({ href, onClick, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkButton.LinkButton, {
|
|
8
|
+
const MarkdownLink = ({ href, onClick, children, theme }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LinkButton.LinkButton, {
|
|
9
9
|
url: href,
|
|
10
10
|
text: children?.toString(),
|
|
11
11
|
typographyColor: require_index.TypographyColor.TEXT_SECONDARY,
|
|
12
|
-
onClick
|
|
12
|
+
onClick,
|
|
13
|
+
theme
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
//#endregion
|
|
@@ -4,11 +4,12 @@ import { LinkButton } from "../../Message/components/LinkButton.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/MarkdownProcessor/components/MarkdownLink.tsx
|
|
7
|
-
const MarkdownLink = ({ href, onClick, children }) => /* @__PURE__ */ jsx(LinkButton, {
|
|
7
|
+
const MarkdownLink = ({ href, onClick, children, theme }) => /* @__PURE__ */ jsx(LinkButton, {
|
|
8
8
|
url: href,
|
|
9
9
|
text: children?.toString(),
|
|
10
10
|
typographyColor: TypographyColor.TEXT_SECONDARY,
|
|
11
|
-
onClick
|
|
11
|
+
onClick,
|
|
12
|
+
theme
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme } from "../../tokens/theme/theme.cjs";
|
|
1
2
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.cjs";
|
|
2
3
|
|
|
3
4
|
//#region src/components/MarkdownProcessor/types/types.d.ts
|
|
@@ -43,6 +44,10 @@ type MarkdownProcessorProps = {
|
|
|
43
44
|
* Callback invoked when a markdown link is clicked. Receives the link URL as an argument.
|
|
44
45
|
*/
|
|
45
46
|
onLinkClick?: (url: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Theme applied to link icons. When STANDARD or MODERN, link icons get 2px border radius.
|
|
49
|
+
*/
|
|
50
|
+
theme?: Theme;
|
|
46
51
|
};
|
|
47
52
|
//#endregion
|
|
48
53
|
export { MarkdownProcessorProps };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
1
2
|
import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
|
|
2
3
|
|
|
3
4
|
//#region src/components/MarkdownProcessor/types/types.d.ts
|
|
@@ -43,6 +44,10 @@ type MarkdownProcessorProps = {
|
|
|
43
44
|
* Callback invoked when a markdown link is clicked. Receives the link URL as an argument.
|
|
44
45
|
*/
|
|
45
46
|
onLinkClick?: (url: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Theme applied to link icons. When STANDARD or MODERN, link icons get 2px border radius.
|
|
49
|
+
*/
|
|
50
|
+
theme?: Theme;
|
|
46
51
|
};
|
|
47
52
|
//#endregion
|
|
48
53
|
export { MarkdownProcessorProps };
|
|
@@ -13,10 +13,11 @@ const createMarkdownParagraphComponent = ({ clampParagraphs, textColor, textVari
|
|
|
13
13
|
Component.displayName = "MarkdownParagraphComponent";
|
|
14
14
|
return Component;
|
|
15
15
|
};
|
|
16
|
-
const createMarkdownLinkComponent = ({ onLinkClick }) => {
|
|
16
|
+
const createMarkdownLinkComponent = ({ onLinkClick, theme }) => {
|
|
17
17
|
const Component = ({ href, children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.MarkdownProcessorComponents.MarkdownLink, {
|
|
18
18
|
href,
|
|
19
19
|
onClick: onLinkClick,
|
|
20
|
+
theme,
|
|
20
21
|
children
|
|
21
22
|
});
|
|
22
23
|
Component.displayName = "MarkdownLinkComponent";
|
|
@@ -12,10 +12,11 @@ const createMarkdownParagraphComponent = ({ clampParagraphs, textColor, textVari
|
|
|
12
12
|
Component.displayName = "MarkdownParagraphComponent";
|
|
13
13
|
return Component;
|
|
14
14
|
};
|
|
15
|
-
const createMarkdownLinkComponent = ({ onLinkClick }) => {
|
|
15
|
+
const createMarkdownLinkComponent = ({ onLinkClick, theme }) => {
|
|
16
16
|
const Component = ({ href, children }) => /* @__PURE__ */ jsx(MarkdownProcessorComponents.MarkdownLink, {
|
|
17
17
|
href,
|
|
18
18
|
onClick: onLinkClick,
|
|
19
|
+
theme,
|
|
19
20
|
children
|
|
20
21
|
});
|
|
21
22
|
Component.displayName = "MarkdownLinkComponent";
|
package/dist/Message/Message.cjs
CHANGED
|
@@ -8,7 +8,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
/**
|
|
9
9
|
* Message component that renders a chat message with two variants: agent and user.
|
|
10
10
|
*/
|
|
11
|
-
const Message = ({ variant = require_index.MessageVariant.AGENT, agentName, content, isLoading = false, showSparkle = false, id, testId, className, style, ariaLabel, onLinkClick }) => {
|
|
11
|
+
const Message = ({ variant = require_index.MessageVariant.AGENT, agentName, content, isLoading = false, showSparkle = false, id, testId, className, style, ariaLabel, onLinkClick, theme }) => {
|
|
12
12
|
const validationResult = require_validateMessageProps.validateMessageProps({
|
|
13
13
|
variant,
|
|
14
14
|
agentName,
|
|
@@ -32,11 +32,12 @@ const Message = ({ variant = require_index.MessageVariant.AGENT, agentName, cont
|
|
|
32
32
|
showSparkle
|
|
33
33
|
}),
|
|
34
34
|
isAgent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.MessageComponents.AgentContent, {
|
|
35
|
-
content,
|
|
35
|
+
content: content ?? "",
|
|
36
36
|
isLoading,
|
|
37
|
-
onLinkClick
|
|
37
|
+
onLinkClick,
|
|
38
|
+
theme
|
|
38
39
|
}),
|
|
39
|
-
isUser && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.MessageComponents.UserContent, { content })
|
|
40
|
+
isUser && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index$1.MessageComponents.UserContent, { content: content ?? "" })
|
|
40
41
|
]
|
|
41
42
|
});
|
|
42
43
|
};
|
package/dist/Message/Message.js
CHANGED
|
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
/**
|
|
8
8
|
* Message component that renders a chat message with two variants: agent and user.
|
|
9
9
|
*/
|
|
10
|
-
const Message = ({ variant = MessageVariant.AGENT, agentName, content, isLoading = false, showSparkle = false, id, testId, className, style, ariaLabel, onLinkClick }) => {
|
|
10
|
+
const Message = ({ variant = MessageVariant.AGENT, agentName, content, isLoading = false, showSparkle = false, id, testId, className, style, ariaLabel, onLinkClick, theme }) => {
|
|
11
11
|
const validationResult = validateMessageProps({
|
|
12
12
|
variant,
|
|
13
13
|
agentName,
|
|
@@ -31,11 +31,12 @@ const Message = ({ variant = MessageVariant.AGENT, agentName, content, isLoading
|
|
|
31
31
|
showSparkle
|
|
32
32
|
}),
|
|
33
33
|
isAgent && /* @__PURE__ */ jsx(MessageComponents.AgentContent, {
|
|
34
|
-
content,
|
|
34
|
+
content: content ?? "",
|
|
35
35
|
isLoading,
|
|
36
|
-
onLinkClick
|
|
36
|
+
onLinkClick,
|
|
37
|
+
theme
|
|
37
38
|
}),
|
|
38
|
-
isUser && /* @__PURE__ */ jsx(MessageComponents.UserContent, { content })
|
|
39
|
+
isUser && /* @__PURE__ */ jsx(MessageComponents.UserContent, { content: content ?? "" })
|
|
39
40
|
]
|
|
40
41
|
});
|
|
41
42
|
};
|
|
@@ -8,13 +8,14 @@ const MarkdownProcessor = (0, react.lazy)(async () => ({ default: (await Promise
|
|
|
8
8
|
/**
|
|
9
9
|
* Component that renders the message content for the agent.
|
|
10
10
|
*/
|
|
11
|
-
const AgentContent = ({ content, isLoading = false, onLinkClick }) => {
|
|
11
|
+
const AgentContent = ({ content, isLoading = false, onLinkClick, theme }) => {
|
|
12
12
|
if (isLoading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LoadingSkeleton.LoadingSkeleton, {});
|
|
13
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
14
14
|
fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LoadingSkeleton.LoadingSkeleton, {}),
|
|
15
15
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkdownProcessor, {
|
|
16
16
|
content,
|
|
17
|
-
onLinkClick
|
|
17
|
+
onLinkClick,
|
|
18
|
+
theme
|
|
18
19
|
})
|
|
19
20
|
});
|
|
20
21
|
};
|
|
@@ -7,13 +7,14 @@ const MarkdownProcessor = lazy(async () => ({ default: (await import("../../Mark
|
|
|
7
7
|
/**
|
|
8
8
|
* Component that renders the message content for the agent.
|
|
9
9
|
*/
|
|
10
|
-
const AgentContent = ({ content, isLoading = false, onLinkClick }) => {
|
|
10
|
+
const AgentContent = ({ content, isLoading = false, onLinkClick, theme }) => {
|
|
11
11
|
if (isLoading) return /* @__PURE__ */ jsx(LoadingSkeleton, {});
|
|
12
12
|
return /* @__PURE__ */ jsx(Suspense, {
|
|
13
13
|
fallback: /* @__PURE__ */ jsx(LoadingSkeleton, {}),
|
|
14
14
|
children: /* @__PURE__ */ jsx(MarkdownProcessor, {
|
|
15
15
|
content,
|
|
16
|
-
onLinkClick
|
|
16
|
+
onLinkClick,
|
|
17
|
+
theme
|
|
17
18
|
})
|
|
18
19
|
});
|
|
19
20
|
};
|
|
@@ -15,9 +15,9 @@ __envive_ai_react_icons_VectorUpRight = require_rolldown_runtime.__toESM(__enviv
|
|
|
15
15
|
* Component that renders an external link with an icon.
|
|
16
16
|
* Uses an inline span with button role for better accessibility and inline text flow.
|
|
17
17
|
*/
|
|
18
|
-
const LinkButton = ({ url, text, typographyColor, onClick }) => {
|
|
18
|
+
const LinkButton = ({ url, text, typographyColor, onClick, theme }) => {
|
|
19
19
|
const { containerClasses } = require_useGetLinkButtonProperties.useGetLinkButtonProperties();
|
|
20
|
-
const { iconContainerClasses } = require_useGetLinkButtonIconProperties.useGetLinkButtonIconProperties();
|
|
20
|
+
const { iconContainerClasses } = require_useGetLinkButtonIconProperties.useGetLinkButtonIconProperties(theme);
|
|
21
21
|
const handleClick = () => {
|
|
22
22
|
require_openUrlInNewTab.openUrlInNewTab(url);
|
|
23
23
|
onClick?.(url);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme } from "../../tokens/theme/theme.cjs";
|
|
1
2
|
import { TypographyColor } from "../../Typography/types/index.cjs";
|
|
2
3
|
|
|
3
4
|
//#region src/components/Message/components/LinkButton.d.ts
|
|
@@ -6,6 +7,7 @@ type LinkButtonProps = {
|
|
|
6
7
|
text: string;
|
|
7
8
|
typographyColor?: TypographyColor;
|
|
8
9
|
onClick?: (url: string) => void;
|
|
10
|
+
theme?: Theme;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* Component that renders an external link with an icon.
|
|
@@ -15,7 +17,8 @@ declare const LinkButton: ({
|
|
|
15
17
|
url,
|
|
16
18
|
text,
|
|
17
19
|
typographyColor,
|
|
18
|
-
onClick
|
|
20
|
+
onClick,
|
|
21
|
+
theme
|
|
19
22
|
}: LinkButtonProps) => React.ReactNode;
|
|
20
23
|
//#endregion
|
|
21
24
|
export { LinkButton };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
1
2
|
import { TypographyColor } from "../../Typography/types/index.js";
|
|
2
3
|
|
|
3
4
|
//#region src/components/Message/components/LinkButton.d.ts
|
|
@@ -6,6 +7,7 @@ type LinkButtonProps = {
|
|
|
6
7
|
text: string;
|
|
7
8
|
typographyColor?: TypographyColor;
|
|
8
9
|
onClick?: (url: string) => void;
|
|
10
|
+
theme?: Theme;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* Component that renders an external link with an icon.
|
|
@@ -15,7 +17,8 @@ declare const LinkButton: ({
|
|
|
15
17
|
url,
|
|
16
18
|
text,
|
|
17
19
|
typographyColor,
|
|
18
|
-
onClick
|
|
20
|
+
onClick,
|
|
21
|
+
theme
|
|
19
22
|
}: LinkButtonProps) => React.ReactNode;
|
|
20
23
|
//#endregion
|
|
21
24
|
export { LinkButton };
|
|
@@ -13,9 +13,9 @@ import VectorUpRight from "@envive-ai/react-icons/VectorUpRight";
|
|
|
13
13
|
* Component that renders an external link with an icon.
|
|
14
14
|
* Uses an inline span with button role for better accessibility and inline text flow.
|
|
15
15
|
*/
|
|
16
|
-
const LinkButton = ({ url, text, typographyColor, onClick }) => {
|
|
16
|
+
const LinkButton = ({ url, text, typographyColor, onClick, theme }) => {
|
|
17
17
|
const { containerClasses } = useGetLinkButtonProperties();
|
|
18
|
-
const { iconContainerClasses } = useGetLinkButtonIconProperties();
|
|
18
|
+
const { iconContainerClasses } = useGetLinkButtonIconProperties(theme);
|
|
19
19
|
const handleClick = () => {
|
|
20
20
|
openUrlInNewTab(url);
|
|
21
21
|
onClick?.(url);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
|
|
2
3
|
let react = require("react");
|
|
3
4
|
|
|
4
5
|
//#region src/components/Message/hooks/useGetLinkButtonIconProperties.ts
|
|
5
6
|
/**
|
|
6
7
|
* Hook that returns CSS classes for the LinkButton icon container element.
|
|
7
8
|
*/
|
|
8
|
-
const useGetLinkButtonIconProperties = () => {
|
|
9
|
+
const useGetLinkButtonIconProperties = (theme) => {
|
|
9
10
|
return { iconContainerClasses: (0, react.useMemo)(() => {
|
|
10
|
-
return `envive-tw-inline-flex envive-tw-h-4 envive-tw-w-4 envive-tw-items-center envive-tw-justify-center envive-tw-align-middle envive-tw-rounded-
|
|
11
|
-
}, []) };
|
|
11
|
+
return `envive-tw-inline-flex envive-tw-h-4 envive-tw-w-4 envive-tw-items-center envive-tw-justify-center envive-tw-align-middle ${`${theme === require_theme.Theme.STANDARD || theme === require_theme.Theme.MODERN ? "envive-tw-rounded-2" : ""} envive-tw-bg-background-secondary`} envive-tw-transition-colors envive-tw-duration-200 group-hover:envive-tw-bg-[color-mix(in_srgb,var(--envive-colors-background-secondary)_90%,#000000_10%)]`;
|
|
12
|
+
}, [theme]) };
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
//#endregion
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
|
|
3
4
|
//#region src/components/Message/hooks/useGetLinkButtonIconProperties.ts
|
|
4
5
|
/**
|
|
5
6
|
* Hook that returns CSS classes for the LinkButton icon container element.
|
|
6
7
|
*/
|
|
7
|
-
const useGetLinkButtonIconProperties = () => {
|
|
8
|
+
const useGetLinkButtonIconProperties = (theme) => {
|
|
8
9
|
return { iconContainerClasses: useMemo(() => {
|
|
9
|
-
return `envive-tw-inline-flex envive-tw-h-4 envive-tw-w-4 envive-tw-items-center envive-tw-justify-center envive-tw-align-middle envive-tw-rounded-
|
|
10
|
-
}, []) };
|
|
10
|
+
return `envive-tw-inline-flex envive-tw-h-4 envive-tw-w-4 envive-tw-items-center envive-tw-justify-center envive-tw-align-middle ${`${theme === Theme.STANDARD || theme === Theme.MODERN ? "envive-tw-rounded-2" : ""} envive-tw-bg-background-secondary`} envive-tw-transition-colors envive-tw-duration-200 group-hover:envive-tw-bg-[color-mix(in_srgb,var(--envive-colors-background-secondary)_90%,#000000_10%)]`;
|
|
11
|
+
}, [theme]) };
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
//#endregion
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { Theme } from "../../tokens/theme/theme.cjs";
|
|
2
|
+
|
|
1
3
|
//#region src/components/Message/types/index.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* Visual variant of the message component.
|
|
4
7
|
*/
|
|
@@ -56,6 +59,7 @@ interface MessageProps {
|
|
|
56
59
|
*/
|
|
57
60
|
style?: React.CSSProperties;
|
|
58
61
|
onLinkClick?: (url: string) => void;
|
|
62
|
+
theme?: Theme;
|
|
59
63
|
}
|
|
60
64
|
//#endregion
|
|
61
65
|
export { MessageProps, MessageVariant };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
|
|
2
|
+
|
|
1
3
|
//#region src/components/Message/types/index.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* Visual variant of the message component.
|
|
4
7
|
*/
|
|
@@ -56,6 +59,7 @@ interface MessageProps {
|
|
|
56
59
|
*/
|
|
57
60
|
style?: React.CSSProperties;
|
|
58
61
|
onLinkClick?: (url: string) => void;
|
|
62
|
+
theme?: Theme;
|
|
59
63
|
}
|
|
60
64
|
//#endregion
|
|
61
65
|
export { MessageProps, MessageVariant };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProductCardProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ProductCard/ProductCard.d.ts
|
|
5
5
|
declare const ProductCard: ({
|
|
@@ -27,6 +27,6 @@ declare const ProductCard: ({
|
|
|
27
27
|
onInputClick,
|
|
28
28
|
onTranscriptionStarted,
|
|
29
29
|
onTranscriptionCompleted
|
|
30
|
-
}: ProductCardProps) =>
|
|
30
|
+
}: ProductCardProps) => react_jsx_runtime0.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { ProductCard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProductCardProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ProductCard/ProductCard.d.ts
|
|
5
5
|
declare const ProductCard: ({
|
|
@@ -27,6 +27,6 @@ declare const ProductCard: ({
|
|
|
27
27
|
onInputClick,
|
|
28
28
|
onTranscriptionStarted,
|
|
29
29
|
onTranscriptionCompleted
|
|
30
|
-
}: ProductCardProps) =>
|
|
30
|
+
}: ProductCardProps) => react_jsx_runtime15.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { ProductCard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PromptButtonProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/PromptButton/PromptButton.d.ts
|
|
5
5
|
declare const PromptButton: ({
|
|
@@ -22,6 +22,6 @@ declare const PromptButton: ({
|
|
|
22
22
|
onTouchEnd,
|
|
23
23
|
ariaLabel,
|
|
24
24
|
ariaDescribedBy
|
|
25
|
-
}: PromptButtonProps) =>
|
|
25
|
+
}: PromptButtonProps) => react_jsx_runtime19.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { PromptButton };
|