@envive-ai/react-widgets-v3 0.3.10 → 0.3.11
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/_virtual/rolldown_runtime.cjs +2 -0
- package/dist/debug/GenericSelect.cjs +167 -0
- package/dist/debug/GenericSelect.js +165 -0
- package/dist/debug/MessageContent.cjs +151 -0
- package/dist/debug/MessageContent.js +149 -0
- package/dist/debug/chatEmbed.cjs +95 -0
- package/dist/debug/chatEmbed.js +92 -0
- package/dist/debug/debugBar.cjs +18 -0
- package/dist/debug/debugBar.js +17 -0
- package/dist/debug/reportIssue.cjs +528 -0
- package/dist/debug/reportIssue.js +524 -0
- package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
- package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/CustomerServiceApi.cjs +265 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/DefaultApi.cjs +591 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/InferenceApi.cjs +265 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/ProductsApi.cjs +105 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/SearchApi.cjs +229 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/index.cjs +43 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/index.cjs +39 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationRequest.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationResponse.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddToCartAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsIdentifyRequest.cjs +86 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsTrackEventRequest.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AttachmentRequest.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AutoForm.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Context.cjs +89 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ConversationStatus.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationRequest.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationResponse.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceAttachment.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversation.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversationMessages.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceCustomer.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceMessage.cjs +85 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustomerServiceProvider.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributes.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributesFormCategory.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormSubmittedAttributes.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormType.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FulfillmentDisplayStatus.cjs +84 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GenerationParams.cjs +74 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GetConversationMessagesRequest.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursRequest.cjs +54 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursResponse.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/LabelValue.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ManualForm.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRule.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleAction.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionAttribute.cjs +58 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionType.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleCondition.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleOp.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleStatus.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/NextMessageRequest.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderItemInfo.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderResponseAttributes.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Organization.cjs +83 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfig.cjs +82 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfigResults.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationSettings.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PDPAttributes.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributeCategory.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributes.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributesAttributes.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPIdAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPUrlAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitAttributes.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitCategory.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalRequest.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalResponse.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchFilterResponseAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchRequest.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponse.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseAttributes.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseV2.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/QueryTypedAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportContent.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportSessionRequest.cjs +99 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Response.cjs +68 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseCategory.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseProductAttributes.cjs +91 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchAttributes.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchResponseProduct.cjs +93 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchSuggestionsResponse.cjs +58 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageRequest.cjs +71 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageResponse.cjs +55 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigExperiment.cjs +64 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigFeatureGate.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Suggestion.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionCategory.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionClickedAttributes.cjs +53 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventProductCategory.cjs +62 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventRequest.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventResponse.cjs +78 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfo.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfoPrevUserEvent.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingGenericConfig.cjs +52 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPDPConfig.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPLPConfig.cjs +61 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingRequest.cjs +65 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponse.cjs +73 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponseSpecificDetails.cjs +59 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingType.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEvent.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventAttributes.cjs +75 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventCategory.cjs +70 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1GetSessionMessages200Response.cjs +67 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1SearchExplainGet200Response.cjs +63 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetString.cjs +60 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextRequest.cjs +73 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextResponse.cjs +66 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetType.cjs +69 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/index.cjs +221 -0
- package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/runtime.cjs +324 -0
- package/dist/node_modules/react-icons/fa/index.cjs +65 -0
- package/dist/node_modules/react-icons/fa/index.js +61 -0
- package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
- package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
- package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
- package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +27 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +25 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
- package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/{widgets → packages/widgets}/dist/SuggestionBar/SuggestionBar.d.ts +2 -2
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
- package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +3 -3
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +1 -1
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +3 -1
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
- package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +3 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +4 -1
- package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +5 -2
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +31 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +15 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +15 -0
- package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +30 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.cjs +3 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.d.cts +2 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.d.ts +2 -0
- package/dist/widgets/FullPageSalesAgentWidget/index.js +3 -0
- package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +3 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
- package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -2
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +4 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
- package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +4 -3
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +28 -4
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +29 -5
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
- package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
- package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +8 -6
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
- package/dist/widgets/SocialProofWidget/SocialProofWidget.js +8 -6
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +3 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
- package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +3 -2
- package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +3 -2
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
- package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -2
- package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/widgets/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/widgets/dist/SuggestionBar/SuggestionBar.d.cts +2 -2
- package/dist/widgets/utils/functions.cjs +1 -1
- package/dist/widgets/utils/functions.js +1 -1
- package/dist/widgets-v2/SearchResults/index.d.ts +3 -3
- package/dist/widgets-v2/SearchZeroState/index.d.ts +4 -4
- package/dist/widgets-v2/SuggestionBar/index.d.ts +3 -3
- package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +2 -2
- package/package.json +5 -1
- package/src/debug/GenericSelect.tsx +236 -0
- package/src/debug/MessageContent.tsx +248 -0
- package/src/debug/chatEmbed.tsx +119 -0
- package/src/debug/debugBar.tsx +13 -0
- package/src/debug/reportIssue.tsx +649 -0
- package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +6 -0
- package/src/stories/FullPageSalesAgentWidget.stories.tsx +68 -0
- package/src/stories/SalesAgentTest/SalesAgentTest.tsx +10 -2
- package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +2 -0
- package/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.ts +11 -5
- package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +46 -0
- package/src/widgets/FullPageSalesAgentWidget/index.ts +1 -0
- package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +5 -1
- package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +6 -1
- package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +31 -2
- package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +10 -2
- package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +5 -1
- package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +5 -1
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResults.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchResults/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroState.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/index.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/types.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/BaseWidgetConfig.d.ts +0 -0
- /package/dist/{widgets → packages/widgets}/dist/config/WidgetType.d.ts +0 -0
|
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
11
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -26,4 +27,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
27
|
|
|
27
28
|
//#endregion
|
|
28
29
|
|
|
30
|
+
exports.__commonJSMin = __commonJSMin;
|
|
29
31
|
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
|
|
6
|
+
//#region src/debug/GenericSelect.tsx
|
|
7
|
+
const dictionaries = { priority: {
|
|
8
|
+
p0: { label: "Urgent" },
|
|
9
|
+
p1: { label: "High" },
|
|
10
|
+
p2: { label: "Medium" },
|
|
11
|
+
p3: { label: "Low" },
|
|
12
|
+
"no priority": { label: "No Priority" }
|
|
13
|
+
} };
|
|
14
|
+
const styles = {
|
|
15
|
+
button: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
gap: "0.5rem",
|
|
19
|
+
fontSize: "0.75rem",
|
|
20
|
+
backgroundColor: "transparent",
|
|
21
|
+
padding: "0.375rem 0.75rem",
|
|
22
|
+
borderRadius: "0.375rem",
|
|
23
|
+
cursor: "pointer",
|
|
24
|
+
outline: "none",
|
|
25
|
+
border: "none"
|
|
26
|
+
},
|
|
27
|
+
buttonHover: { backgroundColor: "#f9fafb" },
|
|
28
|
+
dropdown: {
|
|
29
|
+
position: "absolute",
|
|
30
|
+
left: "0",
|
|
31
|
+
zIndex: 10,
|
|
32
|
+
marginTop: "4px",
|
|
33
|
+
borderRadius: "8px",
|
|
34
|
+
width: "125px",
|
|
35
|
+
backgroundColor: "white",
|
|
36
|
+
boxShadow: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
|
|
37
|
+
border: "1px solid rgba(0, 0, 0, 0.05)"
|
|
38
|
+
},
|
|
39
|
+
dropdownItem: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
width: "100%",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
padding: "4px 8px",
|
|
44
|
+
fontSize: "12px",
|
|
45
|
+
cursor: "pointer",
|
|
46
|
+
border: "none",
|
|
47
|
+
backgroundColor: "transparent",
|
|
48
|
+
textAlign: "left"
|
|
49
|
+
},
|
|
50
|
+
dropdownItemHover: { backgroundColor: "#EBEEF6" },
|
|
51
|
+
container: {
|
|
52
|
+
marginLeft: "-1rem",
|
|
53
|
+
position: "relative"
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const getBadgeStyles = (variant) => {
|
|
57
|
+
let backgroundColor;
|
|
58
|
+
let textColor;
|
|
59
|
+
switch (variant) {
|
|
60
|
+
case "p0":
|
|
61
|
+
backgroundColor = "#940F24";
|
|
62
|
+
textColor = "#F9E8EA";
|
|
63
|
+
break;
|
|
64
|
+
case "p1":
|
|
65
|
+
backgroundColor = "#F9E8EA";
|
|
66
|
+
textColor = "#940F24";
|
|
67
|
+
break;
|
|
68
|
+
case "p2":
|
|
69
|
+
backgroundColor = "#FEEBCB";
|
|
70
|
+
textColor = "#C05621";
|
|
71
|
+
break;
|
|
72
|
+
case "p3":
|
|
73
|
+
backgroundColor = "#E6F6F4";
|
|
74
|
+
textColor = "#007F6D";
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
backgroundColor = "#EBEEF6";
|
|
78
|
+
textColor = "#3C57AA";
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
display: "inline-flex",
|
|
82
|
+
borderRadius: "4px",
|
|
83
|
+
backgroundColor,
|
|
84
|
+
color: textColor,
|
|
85
|
+
fontSize: "0.875rem",
|
|
86
|
+
paddingLeft: "0.625rem",
|
|
87
|
+
paddingRight: "0.625rem",
|
|
88
|
+
paddingTop: "0.25rem",
|
|
89
|
+
paddingBottom: "0.25rem"
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
function GenericSelect({ type, selectedKey, onSelect, buttonStyle = {}, menuStyle = {} }) {
|
|
93
|
+
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
94
|
+
const [isHovering, setIsHovering] = (0, react.useState)(null);
|
|
95
|
+
const menuRef = (0, react.useRef)(null);
|
|
96
|
+
const dictionary = dictionaries[type];
|
|
97
|
+
const renderItem = (key, item) => {
|
|
98
|
+
const chipItem = item;
|
|
99
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
100
|
+
style: getBadgeStyles(key),
|
|
101
|
+
children: chipItem.label
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
react.default.useEffect(() => {
|
|
105
|
+
const handleClickOutside = (event) => {
|
|
106
|
+
const isOutside = menuRef.current && !menuRef.current.contains(event.target);
|
|
107
|
+
const path = event.composedPath ? event.composedPath() : [];
|
|
108
|
+
const isInPath = menuRef.current && path.includes(menuRef.current);
|
|
109
|
+
if (isOutside && !isInPath) setIsOpen(false);
|
|
110
|
+
};
|
|
111
|
+
document.addEventListener("mouseup", handleClickOutside, true);
|
|
112
|
+
return () => {
|
|
113
|
+
document.removeEventListener("mouseup", handleClickOutside, true);
|
|
114
|
+
};
|
|
115
|
+
}, [isOpen]);
|
|
116
|
+
if (!dictionary) {
|
|
117
|
+
console.error(`Invalid type "${type}".`);
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
121
|
+
style: styles.container,
|
|
122
|
+
ref: menuRef,
|
|
123
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
124
|
+
type: "button",
|
|
125
|
+
style: {
|
|
126
|
+
...styles.button,
|
|
127
|
+
...isHovering === "button" ? styles.buttonHover : {},
|
|
128
|
+
...buttonStyle
|
|
129
|
+
},
|
|
130
|
+
onClick: () => {
|
|
131
|
+
setIsOpen(!isOpen);
|
|
132
|
+
},
|
|
133
|
+
onMouseEnter: () => setIsHovering("button"),
|
|
134
|
+
onMouseLeave: () => setIsHovering(null),
|
|
135
|
+
children: dictionary[selectedKey] ? renderItem(selectedKey, dictionary[selectedKey]) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
136
|
+
style: { color: "#6b7280" },
|
|
137
|
+
children: `Select ${type.charAt(0).toUpperCase() + type.slice(1)}`
|
|
138
|
+
})
|
|
139
|
+
}), isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
140
|
+
style: {
|
|
141
|
+
...styles.dropdown,
|
|
142
|
+
...menuStyle
|
|
143
|
+
},
|
|
144
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
145
|
+
style: { padding: "0.25rem 0" },
|
|
146
|
+
children: Object.entries(dictionary).filter(([key]) => key !== selectedKey).map(([key, item]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
147
|
+
type: "button",
|
|
148
|
+
style: {
|
|
149
|
+
...styles.dropdownItem,
|
|
150
|
+
...isHovering === key ? styles.dropdownItemHover : {}
|
|
151
|
+
},
|
|
152
|
+
onMouseEnter: () => setIsHovering(key),
|
|
153
|
+
onMouseLeave: () => setIsHovering(null),
|
|
154
|
+
onClick: (e) => {
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
if (onSelect) onSelect(key);
|
|
157
|
+
setIsOpen(false);
|
|
158
|
+
},
|
|
159
|
+
children: renderItem(key, item)
|
|
160
|
+
}, key))
|
|
161
|
+
})
|
|
162
|
+
})]
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
exports.GenericSelect = GenericSelect;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/debug/GenericSelect.tsx
|
|
5
|
+
const dictionaries = { priority: {
|
|
6
|
+
p0: { label: "Urgent" },
|
|
7
|
+
p1: { label: "High" },
|
|
8
|
+
p2: { label: "Medium" },
|
|
9
|
+
p3: { label: "Low" },
|
|
10
|
+
"no priority": { label: "No Priority" }
|
|
11
|
+
} };
|
|
12
|
+
const styles = {
|
|
13
|
+
button: {
|
|
14
|
+
display: "flex",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
gap: "0.5rem",
|
|
17
|
+
fontSize: "0.75rem",
|
|
18
|
+
backgroundColor: "transparent",
|
|
19
|
+
padding: "0.375rem 0.75rem",
|
|
20
|
+
borderRadius: "0.375rem",
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
outline: "none",
|
|
23
|
+
border: "none"
|
|
24
|
+
},
|
|
25
|
+
buttonHover: { backgroundColor: "#f9fafb" },
|
|
26
|
+
dropdown: {
|
|
27
|
+
position: "absolute",
|
|
28
|
+
left: "0",
|
|
29
|
+
zIndex: 10,
|
|
30
|
+
marginTop: "4px",
|
|
31
|
+
borderRadius: "8px",
|
|
32
|
+
width: "125px",
|
|
33
|
+
backgroundColor: "white",
|
|
34
|
+
boxShadow: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
|
|
35
|
+
border: "1px solid rgba(0, 0, 0, 0.05)"
|
|
36
|
+
},
|
|
37
|
+
dropdownItem: {
|
|
38
|
+
display: "flex",
|
|
39
|
+
width: "100%",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
padding: "4px 8px",
|
|
42
|
+
fontSize: "12px",
|
|
43
|
+
cursor: "pointer",
|
|
44
|
+
border: "none",
|
|
45
|
+
backgroundColor: "transparent",
|
|
46
|
+
textAlign: "left"
|
|
47
|
+
},
|
|
48
|
+
dropdownItemHover: { backgroundColor: "#EBEEF6" },
|
|
49
|
+
container: {
|
|
50
|
+
marginLeft: "-1rem",
|
|
51
|
+
position: "relative"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const getBadgeStyles = (variant) => {
|
|
55
|
+
let backgroundColor;
|
|
56
|
+
let textColor;
|
|
57
|
+
switch (variant) {
|
|
58
|
+
case "p0":
|
|
59
|
+
backgroundColor = "#940F24";
|
|
60
|
+
textColor = "#F9E8EA";
|
|
61
|
+
break;
|
|
62
|
+
case "p1":
|
|
63
|
+
backgroundColor = "#F9E8EA";
|
|
64
|
+
textColor = "#940F24";
|
|
65
|
+
break;
|
|
66
|
+
case "p2":
|
|
67
|
+
backgroundColor = "#FEEBCB";
|
|
68
|
+
textColor = "#C05621";
|
|
69
|
+
break;
|
|
70
|
+
case "p3":
|
|
71
|
+
backgroundColor = "#E6F6F4";
|
|
72
|
+
textColor = "#007F6D";
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
backgroundColor = "#EBEEF6";
|
|
76
|
+
textColor = "#3C57AA";
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
display: "inline-flex",
|
|
80
|
+
borderRadius: "4px",
|
|
81
|
+
backgroundColor,
|
|
82
|
+
color: textColor,
|
|
83
|
+
fontSize: "0.875rem",
|
|
84
|
+
paddingLeft: "0.625rem",
|
|
85
|
+
paddingRight: "0.625rem",
|
|
86
|
+
paddingTop: "0.25rem",
|
|
87
|
+
paddingBottom: "0.25rem"
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
function GenericSelect({ type, selectedKey, onSelect, buttonStyle = {}, menuStyle = {} }) {
|
|
91
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
92
|
+
const [isHovering, setIsHovering] = useState(null);
|
|
93
|
+
const menuRef = useRef(null);
|
|
94
|
+
const dictionary = dictionaries[type];
|
|
95
|
+
const renderItem = (key, item) => {
|
|
96
|
+
const chipItem = item;
|
|
97
|
+
return /* @__PURE__ */ jsx("span", {
|
|
98
|
+
style: getBadgeStyles(key),
|
|
99
|
+
children: chipItem.label
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
const handleClickOutside = (event) => {
|
|
104
|
+
const isOutside = menuRef.current && !menuRef.current.contains(event.target);
|
|
105
|
+
const path = event.composedPath ? event.composedPath() : [];
|
|
106
|
+
const isInPath = menuRef.current && path.includes(menuRef.current);
|
|
107
|
+
if (isOutside && !isInPath) setIsOpen(false);
|
|
108
|
+
};
|
|
109
|
+
document.addEventListener("mouseup", handleClickOutside, true);
|
|
110
|
+
return () => {
|
|
111
|
+
document.removeEventListener("mouseup", handleClickOutside, true);
|
|
112
|
+
};
|
|
113
|
+
}, [isOpen]);
|
|
114
|
+
if (!dictionary) {
|
|
115
|
+
console.error(`Invalid type "${type}".`);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
style: styles.container,
|
|
120
|
+
ref: menuRef,
|
|
121
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
122
|
+
type: "button",
|
|
123
|
+
style: {
|
|
124
|
+
...styles.button,
|
|
125
|
+
...isHovering === "button" ? styles.buttonHover : {},
|
|
126
|
+
...buttonStyle
|
|
127
|
+
},
|
|
128
|
+
onClick: () => {
|
|
129
|
+
setIsOpen(!isOpen);
|
|
130
|
+
},
|
|
131
|
+
onMouseEnter: () => setIsHovering("button"),
|
|
132
|
+
onMouseLeave: () => setIsHovering(null),
|
|
133
|
+
children: dictionary[selectedKey] ? renderItem(selectedKey, dictionary[selectedKey]) : /* @__PURE__ */ jsx("span", {
|
|
134
|
+
style: { color: "#6b7280" },
|
|
135
|
+
children: `Select ${type.charAt(0).toUpperCase() + type.slice(1)}`
|
|
136
|
+
})
|
|
137
|
+
}), isOpen && /* @__PURE__ */ jsx("div", {
|
|
138
|
+
style: {
|
|
139
|
+
...styles.dropdown,
|
|
140
|
+
...menuStyle
|
|
141
|
+
},
|
|
142
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
143
|
+
style: { padding: "0.25rem 0" },
|
|
144
|
+
children: Object.entries(dictionary).filter(([key]) => key !== selectedKey).map(([key, item]) => /* @__PURE__ */ jsx("button", {
|
|
145
|
+
type: "button",
|
|
146
|
+
style: {
|
|
147
|
+
...styles.dropdownItem,
|
|
148
|
+
...isHovering === key ? styles.dropdownItemHover : {}
|
|
149
|
+
},
|
|
150
|
+
onMouseEnter: () => setIsHovering(key),
|
|
151
|
+
onMouseLeave: () => setIsHovering(null),
|
|
152
|
+
onClick: (e) => {
|
|
153
|
+
e.stopPropagation();
|
|
154
|
+
if (onSelect) onSelect(key);
|
|
155
|
+
setIsOpen(false);
|
|
156
|
+
},
|
|
157
|
+
children: renderItem(key, item)
|
|
158
|
+
}, key))
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
//#endregion
|
|
165
|
+
export { GenericSelect };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_index = require('../node_modules/react-icons/fa/index.cjs');
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
5
|
+
let classnames = require("classnames");
|
|
6
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
|
+
let __envive_ai_react_toolkit_v3_ReviewCard = require("@envive-ai/react-toolkit-v3/ReviewCard");
|
|
8
|
+
let __envive_ai_react_toolkit_v3_Message = require("@envive-ai/react-toolkit-v3/Message");
|
|
9
|
+
|
|
10
|
+
//#region src/debug/MessageContent.tsx
|
|
11
|
+
const textContentMessageTypes = new Set([
|
|
12
|
+
__envive_ai_react_hooks_application_models.MessageType.Text,
|
|
13
|
+
__envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
14
|
+
__envive_ai_react_hooks_application_models.MessageType.SuggestionClicked,
|
|
15
|
+
__envive_ai_react_hooks_application_models.MessageType.CXAgentResponse
|
|
16
|
+
]);
|
|
17
|
+
const containerClassNames = (0, classnames.default)({
|
|
18
|
+
"envive-tw-flex": true,
|
|
19
|
+
"envive-tw-flex-col": true,
|
|
20
|
+
"envive-tw-gap-1": true
|
|
21
|
+
});
|
|
22
|
+
const fontSemiboldClassNames = (0, classnames.default)({ "envive-tw-font-semibold": true });
|
|
23
|
+
const flexItemsClassNames = (0, classnames.default)({
|
|
24
|
+
"envive-tw-flex": true,
|
|
25
|
+
"envive-tw-items-center": true
|
|
26
|
+
});
|
|
27
|
+
const gap1ClassNames = (0, classnames.default)({ "envive-tw-gap-1": true });
|
|
28
|
+
const textLinkClassNames = (0, classnames.default)({
|
|
29
|
+
"envive-tw-text-[--spiffy-colors-text-link]": true,
|
|
30
|
+
"envive-tw-underline": true
|
|
31
|
+
});
|
|
32
|
+
const textLgClassNames = (0, classnames.default)({ "envive-tw-text-lg": true });
|
|
33
|
+
const iconClassNames = (0, classnames.default)({
|
|
34
|
+
"envive-tw-w-3": true,
|
|
35
|
+
"envive-tw-h-3": true
|
|
36
|
+
});
|
|
37
|
+
const MessageContent = ({ message: m }) => {
|
|
38
|
+
if (textContentMessageTypes.has(m.type)) {
|
|
39
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Text) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_Message.Message, { content: m.metadata.content }, m.id);
|
|
40
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.QueryTyped) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_Message.Message, { content: m.metadata.content }, m.id);
|
|
41
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.SuggestionClicked) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_Message.Message, { content: m.metadata.suggestionContent }, m.id);
|
|
42
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.CXAgentResponse) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_Message.Message, { content: m.metadata.message }, m.id);
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_Message.Message, { content: "unknown" }, m.id);
|
|
44
|
+
}
|
|
45
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Product) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
46
|
+
className: (0, classnames.default)(flexItemsClassNames, gap1ClassNames, "envive-tw-text-sm"),
|
|
47
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaTag, { className: iconClassNames }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
48
|
+
href: m.metadata.url,
|
|
49
|
+
target: "_blank",
|
|
50
|
+
rel: "noopener noreferrer",
|
|
51
|
+
className: textLinkClassNames,
|
|
52
|
+
children: m.metadata.title
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Review) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_ReviewCard.ReviewCard, {
|
|
56
|
+
name: m.metadata?.reviewer ?? "",
|
|
57
|
+
rating: m.metadata?.stars ?? 0,
|
|
58
|
+
reviewText: m.metadata?.review ?? ""
|
|
59
|
+
});
|
|
60
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Separator) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
61
|
+
className: "envive-tw-relative envive-tw-flex envive-tw-w-full envive-tw-items-center envive-tw-p-2",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "envive-tw-flex-grow envive-tw-border-t envive-tw-border-gray-500" }),
|
|
64
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
65
|
+
className: "envive-tw-flex-shrink envive-tw-px-4 envive-tw-text-sm envive-tw-text-gray-500",
|
|
66
|
+
children: "New Discussion"
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "envive-tw-flex-grow envive-tw-border-t envive-tw-border-gray-500" })
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Page) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
72
|
+
className: containerClassNames,
|
|
73
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
74
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
75
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaFile, { className: iconClassNames }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
76
|
+
className: (0, classnames.default)(textLgClassNames, fontSemiboldClassNames),
|
|
77
|
+
children: m.metadata?.title
|
|
78
|
+
})]
|
|
79
|
+
}), m.metadata?.url && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
80
|
+
className: (0, classnames.default)(flexItemsClassNames, gap1ClassNames),
|
|
81
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaLink, { className: iconClassNames }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
82
|
+
href: m.metadata.url,
|
|
83
|
+
target: "_blank",
|
|
84
|
+
rel: "noopener noreferrer",
|
|
85
|
+
className: textLinkClassNames,
|
|
86
|
+
children: m.metadata.url
|
|
87
|
+
})]
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Search) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
91
|
+
className: containerClassNames,
|
|
92
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
93
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
94
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaSearch, { className: iconClassNames }), " Search"]
|
|
95
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: m.metadata?.searchTerm })]
|
|
96
|
+
});
|
|
97
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Attachment) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
98
|
+
className: containerClassNames,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
101
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
102
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaPaperclip, { className: iconClassNames }), " Attachment"]
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: m.metadata?.message }),
|
|
105
|
+
m.metadata?.attachment.map((attachment) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
106
|
+
href: attachment.url ?? "",
|
|
107
|
+
target: "_blank",
|
|
108
|
+
rel: "noopener noreferrer",
|
|
109
|
+
className: textLinkClassNames,
|
|
110
|
+
children: attachment.name
|
|
111
|
+
}) }, attachment.id))
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Form) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
115
|
+
className: containerClassNames,
|
|
116
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
117
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
118
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaPaperclip, { className: iconClassNames }), " Form Request"]
|
|
119
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: m.metadata?.formType })]
|
|
120
|
+
});
|
|
121
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.ProductSearch) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
122
|
+
className: containerClassNames,
|
|
123
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
124
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
125
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaPaperclip, { className: iconClassNames }), " Product Search Results"]
|
|
126
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
127
|
+
m.metadata?.generatedQuery,
|
|
128
|
+
" - ",
|
|
129
|
+
m.metadata?.productCount,
|
|
130
|
+
" results"
|
|
131
|
+
] })]
|
|
132
|
+
});
|
|
133
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.ProductSearchFilter) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
134
|
+
className: containerClassNames,
|
|
135
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
136
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
137
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaPaperclip, { className: iconClassNames }), " Product Search Filter"]
|
|
138
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Filter: ", m.metadata?.filterName] })]
|
|
139
|
+
});
|
|
140
|
+
if (m.type === __envive_ai_react_hooks_application_models.MessageType.Order) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
141
|
+
className: containerClassNames,
|
|
142
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
143
|
+
className: (0, classnames.default)(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
144
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.FaPaperclip, { className: iconClassNames }), " Order Information"]
|
|
145
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["OrderNumber: ", m.metadata?.orderNumber] })]
|
|
146
|
+
});
|
|
147
|
+
throw new Error(`Unsupported message type: ${JSON.stringify(m)}`);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
exports.MessageContent = MessageContent;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { FaFile, FaLink, FaPaperclip, FaSearch, FaTag } from "../node_modules/react-icons/fa/index.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { MessageType } from "@envive-ai/react-hooks/application/models";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { ReviewCard } from "@envive-ai/react-toolkit-v3/ReviewCard";
|
|
6
|
+
import { Message } from "@envive-ai/react-toolkit-v3/Message";
|
|
7
|
+
|
|
8
|
+
//#region src/debug/MessageContent.tsx
|
|
9
|
+
const textContentMessageTypes = new Set([
|
|
10
|
+
MessageType.Text,
|
|
11
|
+
MessageType.QueryTyped,
|
|
12
|
+
MessageType.SuggestionClicked,
|
|
13
|
+
MessageType.CXAgentResponse
|
|
14
|
+
]);
|
|
15
|
+
const containerClassNames = classNames({
|
|
16
|
+
"envive-tw-flex": true,
|
|
17
|
+
"envive-tw-flex-col": true,
|
|
18
|
+
"envive-tw-gap-1": true
|
|
19
|
+
});
|
|
20
|
+
const fontSemiboldClassNames = classNames({ "envive-tw-font-semibold": true });
|
|
21
|
+
const flexItemsClassNames = classNames({
|
|
22
|
+
"envive-tw-flex": true,
|
|
23
|
+
"envive-tw-items-center": true
|
|
24
|
+
});
|
|
25
|
+
const gap1ClassNames = classNames({ "envive-tw-gap-1": true });
|
|
26
|
+
const textLinkClassNames = classNames({
|
|
27
|
+
"envive-tw-text-[--spiffy-colors-text-link]": true,
|
|
28
|
+
"envive-tw-underline": true
|
|
29
|
+
});
|
|
30
|
+
const textLgClassNames = classNames({ "envive-tw-text-lg": true });
|
|
31
|
+
const iconClassNames = classNames({
|
|
32
|
+
"envive-tw-w-3": true,
|
|
33
|
+
"envive-tw-h-3": true
|
|
34
|
+
});
|
|
35
|
+
const MessageContent = ({ message: m }) => {
|
|
36
|
+
if (textContentMessageTypes.has(m.type)) {
|
|
37
|
+
if (m.type === MessageType.Text) return /* @__PURE__ */ jsx(Message, { content: m.metadata.content }, m.id);
|
|
38
|
+
if (m.type === MessageType.QueryTyped) return /* @__PURE__ */ jsx(Message, { content: m.metadata.content }, m.id);
|
|
39
|
+
if (m.type === MessageType.SuggestionClicked) return /* @__PURE__ */ jsx(Message, { content: m.metadata.suggestionContent }, m.id);
|
|
40
|
+
if (m.type === MessageType.CXAgentResponse) return /* @__PURE__ */ jsx(Message, { content: m.metadata.message }, m.id);
|
|
41
|
+
return /* @__PURE__ */ jsx(Message, { content: "unknown" }, m.id);
|
|
42
|
+
}
|
|
43
|
+
if (m.type === MessageType.Product) return /* @__PURE__ */ jsxs("div", {
|
|
44
|
+
className: classNames(flexItemsClassNames, gap1ClassNames, "envive-tw-text-sm"),
|
|
45
|
+
children: [/* @__PURE__ */ jsx(FaTag, { className: iconClassNames }), /* @__PURE__ */ jsx("a", {
|
|
46
|
+
href: m.metadata.url,
|
|
47
|
+
target: "_blank",
|
|
48
|
+
rel: "noopener noreferrer",
|
|
49
|
+
className: textLinkClassNames,
|
|
50
|
+
children: m.metadata.title
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
if (m.type === MessageType.Review) return /* @__PURE__ */ jsx(ReviewCard, {
|
|
54
|
+
name: m.metadata?.reviewer ?? "",
|
|
55
|
+
rating: m.metadata?.stars ?? 0,
|
|
56
|
+
reviewText: m.metadata?.review ?? ""
|
|
57
|
+
});
|
|
58
|
+
if (m.type === MessageType.Separator) return /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "envive-tw-relative envive-tw-flex envive-tw-w-full envive-tw-items-center envive-tw-p-2",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx("div", { className: "envive-tw-flex-grow envive-tw-border-t envive-tw-border-gray-500" }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "envive-tw-flex-shrink envive-tw-px-4 envive-tw-text-sm envive-tw-text-gray-500",
|
|
64
|
+
children: "New Discussion"
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx("div", { className: "envive-tw-flex-grow envive-tw-border-t envive-tw-border-gray-500" })
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
if (m.type === MessageType.Page) return /* @__PURE__ */ jsxs("div", {
|
|
70
|
+
className: containerClassNames,
|
|
71
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
72
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
73
|
+
children: [/* @__PURE__ */ jsx(FaFile, { className: iconClassNames }), /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: classNames(textLgClassNames, fontSemiboldClassNames),
|
|
75
|
+
children: m.metadata?.title
|
|
76
|
+
})]
|
|
77
|
+
}), m.metadata?.url && /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
className: classNames(flexItemsClassNames, gap1ClassNames),
|
|
79
|
+
children: [/* @__PURE__ */ jsx(FaLink, { className: iconClassNames }), /* @__PURE__ */ jsx("a", {
|
|
80
|
+
href: m.metadata.url,
|
|
81
|
+
target: "_blank",
|
|
82
|
+
rel: "noopener noreferrer",
|
|
83
|
+
className: textLinkClassNames,
|
|
84
|
+
children: m.metadata.url
|
|
85
|
+
})]
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
if (m.type === MessageType.Search) return /* @__PURE__ */ jsxs("div", {
|
|
89
|
+
className: containerClassNames,
|
|
90
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
91
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
92
|
+
children: [/* @__PURE__ */ jsx(FaSearch, { className: iconClassNames }), " Search"]
|
|
93
|
+
}), /* @__PURE__ */ jsx("div", { children: m.metadata?.searchTerm })]
|
|
94
|
+
});
|
|
95
|
+
if (m.type === MessageType.Attachment) return /* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: containerClassNames,
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsxs("div", {
|
|
99
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
100
|
+
children: [/* @__PURE__ */ jsx(FaPaperclip, { className: iconClassNames }), " Attachment"]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ jsx("div", { children: m.metadata?.message }),
|
|
103
|
+
m.metadata?.attachment.map((attachment) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("a", {
|
|
104
|
+
href: attachment.url ?? "",
|
|
105
|
+
target: "_blank",
|
|
106
|
+
rel: "noopener noreferrer",
|
|
107
|
+
className: textLinkClassNames,
|
|
108
|
+
children: attachment.name
|
|
109
|
+
}) }, attachment.id))
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
if (m.type === MessageType.Form) return /* @__PURE__ */ jsxs("div", {
|
|
113
|
+
className: containerClassNames,
|
|
114
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
115
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
116
|
+
children: [/* @__PURE__ */ jsx(FaPaperclip, { className: iconClassNames }), " Form Request"]
|
|
117
|
+
}), /* @__PURE__ */ jsx("div", { children: m.metadata?.formType })]
|
|
118
|
+
});
|
|
119
|
+
if (m.type === MessageType.ProductSearch) return /* @__PURE__ */ jsxs("div", {
|
|
120
|
+
className: containerClassNames,
|
|
121
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
122
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
123
|
+
children: [/* @__PURE__ */ jsx(FaPaperclip, { className: iconClassNames }), " Product Search Results"]
|
|
124
|
+
}), /* @__PURE__ */ jsxs("div", { children: [
|
|
125
|
+
m.metadata?.generatedQuery,
|
|
126
|
+
" - ",
|
|
127
|
+
m.metadata?.productCount,
|
|
128
|
+
" results"
|
|
129
|
+
] })]
|
|
130
|
+
});
|
|
131
|
+
if (m.type === MessageType.ProductSearchFilter) return /* @__PURE__ */ jsxs("div", {
|
|
132
|
+
className: containerClassNames,
|
|
133
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
134
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
135
|
+
children: [/* @__PURE__ */ jsx(FaPaperclip, { className: iconClassNames }), " Product Search Filter"]
|
|
136
|
+
}), /* @__PURE__ */ jsxs("div", { children: ["Filter: ", m.metadata?.filterName] })]
|
|
137
|
+
});
|
|
138
|
+
if (m.type === MessageType.Order) return /* @__PURE__ */ jsxs("div", {
|
|
139
|
+
className: containerClassNames,
|
|
140
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames),
|
|
142
|
+
children: [/* @__PURE__ */ jsx(FaPaperclip, { className: iconClassNames }), " Order Information"]
|
|
143
|
+
}), /* @__PURE__ */ jsxs("div", { children: ["OrderNumber: ", m.metadata?.orderNumber] })]
|
|
144
|
+
});
|
|
145
|
+
throw new Error(`Unsupported message type: ${JSON.stringify(m)}`);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
export { MessageContent };
|