@envive-ai/react-widgets-v3 0.3.10 → 0.3.12

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.
Files changed (266) hide show
  1. package/dist/CXIntegration/hooks/useUnifiedCXButton.cjs +2 -1
  2. package/dist/CXIntegration/hooks/useUnifiedCXButton.js +2 -1
  3. package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.cjs +6 -0
  4. package/dist/CXIntegration/implementations/useGladlyUnifiedCXButton.js +6 -0
  5. package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.cjs +7 -6
  6. package/dist/CXIntegration/implementations/useGorgiasUnifiedCXButton.js +7 -6
  7. package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.cjs +10 -11
  8. package/dist/CXIntegration/implementations/useGrooveUnifiedCXButton.js +10 -11
  9. package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.cjs +10 -7
  10. package/dist/CXIntegration/implementations/useKustomerUnifiedCXButton.js +10 -7
  11. package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.cjs +2 -2
  12. package/dist/CXIntegration/implementations/useReDoUnifiedCXButton.js +2 -2
  13. package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.cjs +9 -7
  14. package/dist/CXIntegration/implementations/useRichpanelUnifiedCXButton.js +9 -7
  15. package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.cjs +13 -16
  16. package/dist/CXIntegration/implementations/useShopifyChatUnifiedCXButton.js +13 -16
  17. package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.cjs +6 -0
  18. package/dist/CXIntegration/implementations/useTidioUnifiedCXButton.js +6 -0
  19. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.cjs +7 -5
  20. package/dist/CXIntegration/implementations/useZendeskUnifiedCXButton.js +7 -5
  21. package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.cjs +6 -0
  22. package/dist/CXIntegration/implementations/useZowieUnifiedCXButton.js +6 -0
  23. package/dist/_virtual/rolldown_runtime.cjs +2 -0
  24. package/dist/debug/GenericSelect.cjs +167 -0
  25. package/dist/debug/GenericSelect.js +165 -0
  26. package/dist/debug/MessageContent.cjs +151 -0
  27. package/dist/debug/MessageContent.js +149 -0
  28. package/dist/debug/chatEmbed.cjs +95 -0
  29. package/dist/debug/chatEmbed.js +92 -0
  30. package/dist/debug/debugBar.cjs +17 -0
  31. package/dist/debug/debugBar.js +16 -0
  32. package/dist/debug/reportIssue.cjs +528 -0
  33. package/dist/debug/reportIssue.js +524 -0
  34. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/CustomerServiceApi.cjs +265 -0
  35. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/DefaultApi.cjs +591 -0
  36. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/InferenceApi.cjs +265 -0
  37. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/ProductsApi.cjs +105 -0
  38. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/SearchApi.cjs +229 -0
  39. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/apis/index.cjs +43 -0
  40. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/index.cjs +39 -0
  41. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationRequest.cjs +68 -0
  42. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddNoteToLatestConversationResponse.cjs +60 -0
  43. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AddToCartAttributes.cjs +53 -0
  44. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsIdentifyRequest.cjs +86 -0
  45. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AnalyticsTrackEventRequest.cjs +62 -0
  46. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AttachmentRequest.cjs +63 -0
  47. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AutoForm.cjs +55 -0
  48. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Context.cjs +89 -0
  49. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ConversationStatus.cjs +63 -0
  50. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationRequest.cjs +68 -0
  51. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CreateConversationResponse.cjs +64 -0
  52. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceAttachment.cjs +68 -0
  53. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversation.cjs +69 -0
  54. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceConversationMessages.cjs +67 -0
  55. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceCustomer.cjs +60 -0
  56. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustServiceMessage.cjs +85 -0
  57. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/CustomerServiceProvider.cjs +63 -0
  58. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributes.cjs +61 -0
  59. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormResponseAttributesFormCategory.cjs +55 -0
  60. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormSubmittedAttributes.cjs +65 -0
  61. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FormType.cjs +61 -0
  62. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/FulfillmentDisplayStatus.cjs +84 -0
  63. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GenerationParams.cjs +74 -0
  64. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/GetConversationMessagesRequest.cjs +61 -0
  65. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursRequest.cjs +54 -0
  66. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/IsBusinessHoursResponse.cjs +59 -0
  67. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/LabelValue.cjs +60 -0
  68. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ManualForm.cjs +55 -0
  69. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRule.cjs +70 -0
  70. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleAction.cjs +62 -0
  71. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionAttribute.cjs +58 -0
  72. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleActionType.cjs +64 -0
  73. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleCondition.cjs +60 -0
  74. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleOp.cjs +61 -0
  75. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/MerchRuleStatus.cjs +62 -0
  76. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/NextMessageRequest.cjs +78 -0
  77. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderItemInfo.cjs +78 -0
  78. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrderResponseAttributes.cjs +71 -0
  79. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Organization.cjs +83 -0
  80. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfig.cjs +82 -0
  81. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationConfigResults.cjs +70 -0
  82. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/OrganizationSettings.cjs +62 -0
  83. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PDPAttributes.cjs +61 -0
  84. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributeCategory.cjs +61 -0
  85. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributes.cjs +64 -0
  86. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPAttributesAttributes.cjs +55 -0
  87. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPIdAttributes.cjs +53 -0
  88. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PLPUrlAttributes.cjs +53 -0
  89. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitAttributes.cjs +62 -0
  90. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/PageVisitCategory.cjs +65 -0
  91. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalRequest.cjs +62 -0
  92. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductRetrievalResponse.cjs +55 -0
  93. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchFilterResponseAttributes.cjs +53 -0
  94. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchRequest.cjs +71 -0
  95. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponse.cjs +64 -0
  96. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseAttributes.cjs +60 -0
  97. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ProductSearchResponseV2.cjs +64 -0
  98. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/QueryTypedAttributes.cjs +53 -0
  99. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportContent.cjs +59 -0
  100. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ReportSessionRequest.cjs +99 -0
  101. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Response.cjs +68 -0
  102. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseCategory.cjs +69 -0
  103. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/ResponseProductAttributes.cjs +91 -0
  104. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchAttributes.cjs +65 -0
  105. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchResponseProduct.cjs +93 -0
  106. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SearchSuggestionsResponse.cjs +58 -0
  107. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageRequest.cjs +71 -0
  108. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SendMessageResponse.cjs +55 -0
  109. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigExperiment.cjs +64 -0
  110. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/StatsigFeatureGate.cjs +62 -0
  111. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/Suggestion.cjs +70 -0
  112. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionCategory.cjs +62 -0
  113. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SuggestionClickedAttributes.cjs +53 -0
  114. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventProductCategory.cjs +62 -0
  115. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventRequest.cjs +67 -0
  116. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/SupportedEventResponse.cjs +78 -0
  117. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfo.cjs +70 -0
  118. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/TurnInfoPrevUserEvent.cjs +60 -0
  119. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingGenericConfig.cjs +52 -0
  120. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPDPConfig.cjs +65 -0
  121. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingPLPConfig.cjs +61 -0
  122. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingRequest.cjs +69 -0
  123. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponse.cjs +73 -0
  124. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingResponseSpecificDetails.cjs +59 -0
  125. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UrlResolvingType.cjs +67 -0
  126. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEvent.cjs +69 -0
  127. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventAttributes.cjs +75 -0
  128. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/UserEventCategory.cjs +70 -0
  129. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1GetSessionMessages200Response.cjs +67 -0
  130. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/V1SearchExplainGet200Response.cjs +63 -0
  131. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetString.cjs +60 -0
  132. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextRequest.cjs +75 -0
  133. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetTextResponse.cjs +66 -0
  134. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/WidgetType.cjs +69 -0
  135. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/index.cjs +221 -0
  136. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/runtime.cjs +324 -0
  137. package/dist/node_modules/react-icons/fa/index.cjs +65 -0
  138. package/dist/node_modules/react-icons/fa/index.js +61 -0
  139. package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
  140. package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
  141. package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
  142. package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
  143. package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
  144. package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
  145. package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +27 -0
  146. package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +25 -0
  147. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
  148. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
  149. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
  150. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
  151. package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
  152. package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
  153. package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
  154. package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
  155. package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
  156. package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
  157. package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
  158. package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
  159. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs +3 -3
  160. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  161. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  162. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js +3 -3
  163. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  164. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  165. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.cjs +3 -3
  166. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  167. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  168. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.js +3 -3
  169. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.cjs +2 -2
  170. package/dist/widgets/FloatingChatWidget/FloatingChatOverlay.js +1 -1
  171. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +66 -36
  172. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  173. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  174. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +67 -37
  175. package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.cjs +50 -0
  176. package/dist/widgets/FloatingChatWidget/hooks/useAutoPopup.js +49 -0
  177. package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.cjs +4 -1
  178. package/dist/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.js +5 -2
  179. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.cjs +31 -0
  180. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +15 -0
  181. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +15 -0
  182. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.js +30 -0
  183. package/dist/widgets/FullPageSalesAgentWidget/index.cjs +3 -0
  184. package/dist/widgets/FullPageSalesAgentWidget/index.d.cts +2 -0
  185. package/dist/widgets/FullPageSalesAgentWidget/index.d.ts +2 -0
  186. package/dist/widgets/FullPageSalesAgentWidget/index.js +3 -0
  187. package/dist/widgets/ProductCardWidget/ProductCardWidget.cjs +3 -2
  188. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  189. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  190. package/dist/widgets/ProductCardWidget/ProductCardWidget.js +3 -2
  191. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.cjs +4 -3
  192. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  193. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  194. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.js +4 -3
  195. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +29 -5
  196. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  197. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  198. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +30 -6
  199. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  200. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  201. package/dist/widgets/SocialProofWidget/SocialProofWidget.cjs +8 -6
  202. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  203. package/dist/widgets/SocialProofWidget/SocialProofWidget.js +8 -6
  204. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.cjs +4 -3
  205. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  206. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  207. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.js +4 -3
  208. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  209. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  210. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.cjs +3 -2
  211. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  212. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  213. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.js +3 -2
  214. package/dist/widgets/utils/functions.cjs +1 -1
  215. package/dist/widgets/utils/functions.js +1 -1
  216. package/dist/widgets-v2/SearchResults/index.d.ts +3 -3
  217. package/dist/widgets-v2/SearchZeroState/index.d.ts +4 -4
  218. package/dist/widgets-v2/SuggestionBar/index.d.ts +3 -3
  219. package/dist/widgets-v2/SuggestionButtonContainer/index.d.ts +2 -2
  220. package/package.json +5 -1
  221. package/src/CXIntegration/hooks/useUnifiedCXButton.ts +4 -1
  222. package/src/CXIntegration/implementations/useGladlyUnifiedCXButton.ts +5 -0
  223. package/src/CXIntegration/implementations/useGorgiasUnifiedCXButton.ts +11 -8
  224. package/src/CXIntegration/implementations/useGrooveUnifiedCXButton.ts +12 -15
  225. package/src/CXIntegration/implementations/useKustomerUnifiedCXButton.ts +11 -11
  226. package/src/CXIntegration/implementations/useReDoUnifiedCXButton.ts +2 -4
  227. package/src/CXIntegration/implementations/useRichpanelUnifiedCXButton.ts +9 -10
  228. package/src/CXIntegration/implementations/useShopifyChatUnifiedCXButton.ts +18 -28
  229. package/src/CXIntegration/implementations/useTidioUnifiedCXButton.ts +5 -0
  230. package/src/CXIntegration/implementations/useZendeskUnifiedCXButton.ts +11 -6
  231. package/src/CXIntegration/implementations/useZowieUnifiedCXButton.ts +5 -0
  232. package/src/CXIntegration/types.ts +1 -0
  233. package/src/debug/GenericSelect.tsx +236 -0
  234. package/src/debug/MessageContent.tsx +248 -0
  235. package/src/debug/chatEmbed.tsx +119 -0
  236. package/src/debug/debugBar.tsx +12 -0
  237. package/src/debug/reportIssue.tsx +649 -0
  238. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +6 -0
  239. package/src/stories/FullPageSalesAgentWidget.stories.tsx +68 -0
  240. package/src/stories/SalesAgentTest/SalesAgentTest.tsx +10 -2
  241. package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +110 -65
  242. package/src/widgets/FloatingChatWidget/hooks/useAutoPopup.ts +65 -0
  243. package/src/widgets/FloatingChatWidget/hooks/useFloatingButtonVisibility.ts +11 -5
  244. package/src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.tsx +46 -0
  245. package/src/widgets/FullPageSalesAgentWidget/index.ts +1 -0
  246. package/src/widgets/ProductCardWidget/ProductCardWidget.tsx +5 -1
  247. package/src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.tsx +6 -1
  248. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +32 -3
  249. package/src/widgets/SocialProofWidget/SocialProofWidget.tsx +10 -2
  250. package/src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.tsx +6 -2
  251. package/src/widgets/TypingAnimationWidget/TypingAnimationWidget.tsx +5 -1
  252. /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResults.d.ts +0 -0
  253. /package/dist/{widgets → packages/widgets}/dist/SearchResults/SearchResultsWidget.d.ts +0 -0
  254. /package/dist/{widgets → packages/widgets}/dist/SearchResults/index.d.ts +0 -0
  255. /package/dist/{widgets → packages/widgets}/dist/SearchResults/types.d.ts +0 -0
  256. /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroState.d.ts +0 -0
  257. /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/SearchZeroStateWidget.d.ts +0 -0
  258. /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/index.d.ts +0 -0
  259. /package/dist/{widgets → packages/widgets}/dist/SearchZeroState/types.d.ts +0 -0
  260. /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/SuggestionBar.d.ts +0 -0
  261. /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/index.d.ts +0 -0
  262. /package/dist/{widgets → packages/widgets}/dist/SuggestionBar/types.d.ts +0 -0
  263. /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +0 -0
  264. /package/dist/{widgets → packages/widgets}/dist/SuggestionButtonContainer/types.d.ts +0 -0
  265. /package/dist/{widgets → packages/widgets}/dist/config/BaseWidgetConfig.d.ts +0 -0
  266. /package/dist/{widgets → packages/widgets}/dist/config/WidgetType.d.ts +0 -0
@@ -7,6 +7,7 @@ interface UseShopifyChatUnifiedCXButtonProps extends CustomerServiceImplProps {}
7
7
 
8
8
  export const useShopifyChatUnifiedCXButton = ({
9
9
  onSwitchToAgent,
10
+ onCXClose,
10
11
  suppressMerchantButton,
11
12
  }: UseShopifyChatUnifiedCXButtonProps): UnifiedCXButton => {
12
13
  const shopifyChatContainer = useElementObserver(SelectorFactory.id('ShopifyChat'));
@@ -16,9 +17,7 @@ export const useShopifyChatUnifiedCXButton = ({
16
17
  const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
17
18
 
18
19
  const toggle = () => {
19
- if (suppressMerchantButton) {
20
- enviveFloatingButton.hide();
21
- }
20
+ enviveFloatingButton.hide();
22
21
  shopifyButton.show();
23
22
  onSwitchToAgent();
24
23
  shopifyButton.fire('click');
@@ -30,45 +29,36 @@ export const useShopifyChatUnifiedCXButton = ({
30
29
 
31
30
  const isSwitchEnabled = () => isShopifyButtonEnabled();
32
31
 
33
- const hideEnviveFloatingButton = () => {
34
- enviveFloatingButton.hide();
35
- shopifyButton.show();
36
- };
37
-
38
- const showEnviveFloatingButton = () => {
39
- enviveFloatingButton.show();
40
- shopifyButton.hide();
41
- shopifyChatContainer.hide();
42
- };
43
-
44
32
  const handleChatStateChange = async (isOpen: boolean) => {
45
33
  if (isOpen) {
46
- hideEnviveFloatingButton();
34
+ enviveFloatingButton.hide();
35
+ if (suppressMerchantButton) {
36
+ shopifyButton.show();
37
+ }
47
38
  return;
48
39
  }
49
40
 
50
- showEnviveFloatingButton();
41
+ onCXClose?.();
42
+ enviveFloatingButton.show();
43
+ if (suppressMerchantButton) {
44
+ shopifyButton.hide();
45
+ shopifyChatContainer.hide();
46
+ }
51
47
  };
52
48
 
53
49
  shopifyButton.onAdd(() => {
54
- if (suppressMerchantButton) {
55
- const isOpen = shopifyChatContainer.targetNode?.getAttribute('is-open') === 'true';
56
- handleChatStateChange(isOpen);
57
- }
50
+ const isOpen = shopifyChatContainer.targetNode?.getAttribute('is-open') === 'true';
51
+ handleChatStateChange(isOpen);
58
52
  });
59
53
 
60
54
  shopifyChatContainer.onAdd(el => {
61
- if (suppressMerchantButton) {
62
- const isOpen = el?.getAttribute('is-open') === 'true';
63
- handleChatStateChange(isOpen);
64
- }
55
+ const isOpen = el?.getAttribute('is-open') === 'true';
56
+ handleChatStateChange(isOpen);
65
57
  });
66
58
 
67
59
  shopifyChatContainer.onChange(el => {
68
- if (suppressMerchantButton) {
69
- const isOpen = el?.getAttribute('is-open') === 'true';
70
- handleChatStateChange(isOpen);
71
- }
60
+ const isOpen = el?.getAttribute('is-open') === 'true';
61
+ handleChatStateChange(isOpen);
72
62
  });
73
63
 
74
64
  return {
@@ -1,3 +1,6 @@
1
+ import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
2
+ import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
3
+ import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
1
4
  import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
2
5
 
3
6
  declare global {
@@ -15,9 +18,11 @@ export const useTidioUnifiedCXButton = ({
15
18
  onSwitchToAgent,
16
19
  }: UseTidioUnifiedCXButtonProps): UnifiedCXButton => {
17
20
  const tidioButton = window.tidioChatApi;
21
+ const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
18
22
 
19
23
  const toggle = () => {
20
24
  onSwitchToAgent();
25
+ enviveFloatingButton.hide();
21
26
  if (tidioButton) {
22
27
  tidioButton.open();
23
28
  }
@@ -7,6 +7,7 @@ interface UseZendeskUnifiedCXButtonProps extends CustomerServiceImplProps {}
7
7
 
8
8
  export const useZendeskUnifiedCXButton = ({
9
9
  onSwitchToAgent,
10
+ onCXClose,
10
11
  suppressMerchantButton,
11
12
  }: UseZendeskUnifiedCXButtonProps): UnifiedCXButton => {
12
13
  const zendeskButton = useElementObserver(SelectorFactory.chain('id|launcher @ query|button'));
@@ -18,9 +19,7 @@ export const useZendeskUnifiedCXButton = ({
18
19
  zendeskIframe.hide();
19
20
  onSwitchToAgent();
20
21
  zendeskButton.fire('click');
21
- if (suppressMerchantButton) {
22
- enviveFloatingButton.hide();
23
- }
22
+ enviveFloatingButton.hide();
24
23
  };
25
24
 
26
25
  const isZendeskButtonEnabled = () => {
@@ -40,22 +39,28 @@ export const useZendeskUnifiedCXButton = ({
40
39
  });
41
40
 
42
41
  zendeskButton.onChange(el => {
43
- if (el && suppressMerchantButton) {
42
+ if (el) {
44
43
  const ariaLabel = el.getAttribute('aria-label');
45
44
 
46
45
  if (ariaLabel === 'Open messaging window') {
46
+ onCXClose?.();
47
47
  enviveFloatingButton.show();
48
- zendeskIframe.hide();
48
+ if (suppressMerchantButton) {
49
+ zendeskIframe.hide();
50
+ }
49
51
  }
50
52
 
51
53
  if (ariaLabel === 'Close messaging window') {
52
54
  enviveFloatingButton.hide();
53
- zendeskIframe.show();
55
+ if (suppressMerchantButton) {
56
+ zendeskIframe.show();
57
+ }
54
58
  }
55
59
  }
56
60
  });
57
61
 
58
62
  zendeskAlternativeIframe.onRemove(() => {
63
+ onCXClose?.();
59
64
  if (suppressMerchantButton) {
60
65
  enviveFloatingButton.show();
61
66
  zendeskIframe.hide();
@@ -1,3 +1,6 @@
1
+ import { SelectorFactory } from '@envive-ai/react-hooks/application/utils';
2
+ import { useElementObserver } from '@envive-ai/react-hooks/hooks/ElementObserver';
3
+ import { FLOATING_BUTTON_ID } from '../../widgets/FloatingChatWidget/constants';
1
4
  import { CustomerServiceImplProps, UnifiedCXButton } from '../types';
2
5
 
3
6
  declare global {
@@ -15,9 +18,11 @@ export const useZowieUnifiedCXButton = ({
15
18
  onSwitchToAgent,
16
19
  }: UseZowieUnifiedCXButtonProps): UnifiedCXButton => {
17
20
  const zowieButton = window?.Zowie;
21
+ const enviveFloatingButton = useElementObserver(SelectorFactory.id(FLOATING_BUTTON_ID));
18
22
 
19
23
  const toggle = () => {
20
24
  onSwitchToAgent();
25
+ enviveFloatingButton.hide();
21
26
  if (zowieButton) {
22
27
  zowieButton?.open();
23
28
  }
@@ -20,5 +20,6 @@ export interface UnifiedCXButton {
20
20
 
21
21
  export interface CustomerServiceImplProps {
22
22
  onSwitchToAgent: () => void;
23
+ onCXClose?: () => void;
23
24
  suppressMerchantButton?: boolean;
24
25
  }
@@ -0,0 +1,236 @@
1
+ import React, { CSSProperties, useRef, useState } from 'react';
2
+
3
+ type SelectType = 'priority';
4
+
5
+ interface CategorySkillItem {
6
+ icon: string;
7
+ label: string;
8
+ }
9
+
10
+ interface ChipItem {
11
+ label: string;
12
+ }
13
+
14
+ type DictionaryItem = CategorySkillItem | ChipItem;
15
+ type Dictionary = Record<string, DictionaryItem>;
16
+
17
+ const dictionaries: Record<SelectType, Dictionary> = {
18
+ priority: {
19
+ p0: { label: 'Urgent' },
20
+ p1: { label: 'High' },
21
+ p2: { label: 'Medium' },
22
+ p3: { label: 'Low' },
23
+ 'no priority': { label: 'No Priority' },
24
+ },
25
+ };
26
+
27
+ // Inline styles for Shadow DOM compatibility
28
+ const styles: Record<string, CSSProperties> = {
29
+ button: {
30
+ display: 'flex',
31
+ alignItems: 'center',
32
+ gap: '0.5rem',
33
+ fontSize: '0.75rem',
34
+ backgroundColor: 'transparent',
35
+ padding: '0.375rem 0.75rem',
36
+ borderRadius: '0.375rem',
37
+ cursor: 'pointer',
38
+ outline: 'none',
39
+ border: 'none',
40
+ },
41
+ buttonHover: {
42
+ backgroundColor: '#f9fafb',
43
+ },
44
+ dropdown: {
45
+ position: 'absolute',
46
+ left: '0',
47
+ zIndex: 10,
48
+ marginTop: '4px',
49
+ borderRadius: '8px',
50
+ width: '125px',
51
+ backgroundColor: 'white',
52
+ boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
53
+ border: '1px solid rgba(0, 0, 0, 0.05)',
54
+ },
55
+ dropdownItem: {
56
+ display: 'flex',
57
+ width: '100%',
58
+ alignItems: 'center',
59
+ padding: '4px 8px',
60
+ fontSize: '12px',
61
+ cursor: 'pointer',
62
+ border: 'none',
63
+ backgroundColor: 'transparent',
64
+ textAlign: 'left',
65
+ },
66
+ dropdownItemHover: {
67
+ backgroundColor: '#EBEEF6',
68
+ },
69
+ container: {
70
+ marginLeft: '-1rem',
71
+ position: 'relative',
72
+ },
73
+ };
74
+
75
+ // Badge style generator function
76
+ const getBadgeStyles = (variant?: string): CSSProperties => {
77
+ let backgroundColor;
78
+ let textColor;
79
+
80
+ switch (variant) {
81
+ case 'p0':
82
+ backgroundColor = '#940F24';
83
+ textColor = '#F9E8EA';
84
+ break;
85
+ case 'p1':
86
+ backgroundColor = '#F9E8EA';
87
+ textColor = '#940F24';
88
+ break;
89
+ case 'p2':
90
+ backgroundColor = '#FEEBCB';
91
+ textColor = '#C05621';
92
+ break;
93
+ case 'p3':
94
+ backgroundColor = '#E6F6F4';
95
+ textColor = '#007F6D';
96
+ break;
97
+ default:
98
+ backgroundColor = '#EBEEF6';
99
+ textColor = '#3C57AA';
100
+ }
101
+
102
+ // Using fixed medium size values
103
+ return {
104
+ display: 'inline-flex',
105
+ borderRadius: '4px',
106
+ backgroundColor,
107
+ color: textColor,
108
+ fontSize: '0.875rem',
109
+ paddingLeft: '0.625rem',
110
+ paddingRight: '0.625rem',
111
+ paddingTop: '0.25rem',
112
+ paddingBottom: '0.25rem',
113
+ };
114
+ };
115
+
116
+ interface SelectProps {
117
+ type: SelectType;
118
+ selectedKey: string;
119
+ onSelect?: (key: string) => void;
120
+ buttonStyle?: CSSProperties;
121
+ menuStyle?: CSSProperties;
122
+ }
123
+
124
+ export function GenericSelect({
125
+ type,
126
+ selectedKey,
127
+ onSelect,
128
+ buttonStyle = {},
129
+ menuStyle = {},
130
+ }: Readonly<SelectProps>) {
131
+ const [isOpen, setIsOpen] = useState(false);
132
+ const [isHovering, setIsHovering] = useState<string | null>(null);
133
+ const menuRef = useRef<HTMLDivElement>(null);
134
+ const dictionary = dictionaries[type];
135
+
136
+ const renderItem = (key: string, item: DictionaryItem) => {
137
+ const chipItem = item as ChipItem;
138
+ const badgeStyles = getBadgeStyles(key);
139
+
140
+ return <span style={badgeStyles}>{chipItem.label}</span>;
141
+ };
142
+
143
+ // Close menu when clicking outside
144
+ React.useEffect(() => {
145
+ const handleClickOutside = (event: MouseEvent) => {
146
+ // Check if the click target is within our menu ref
147
+ const isOutside = menuRef.current && !menuRef.current.contains(event.target as Node);
148
+
149
+ // Also check the event path (for Shadow DOM compatibility)
150
+ const path = event.composedPath ? event.composedPath() : [];
151
+ const isInPath = menuRef.current && path.includes(menuRef.current);
152
+
153
+ // Only close if truly outside (not in the path)
154
+ if (isOutside && !isInPath) {
155
+ setIsOpen(false);
156
+ }
157
+ };
158
+
159
+ document.addEventListener('mouseup', handleClickOutside, true);
160
+
161
+ return () => {
162
+ document.removeEventListener('mouseup', handleClickOutside, true);
163
+ };
164
+ }, [isOpen]);
165
+
166
+ if (!dictionary) {
167
+ console.error(`Invalid type "${type}".`);
168
+ return null;
169
+ }
170
+
171
+ return (
172
+ <div
173
+ style={styles.container}
174
+ ref={menuRef}
175
+ >
176
+ <button
177
+ type="button"
178
+ style={{
179
+ ...styles.button,
180
+ ...(isHovering === 'button' ? styles.buttonHover : {}),
181
+ ...buttonStyle,
182
+ }}
183
+ onClick={() => {
184
+ setIsOpen(!isOpen);
185
+ }}
186
+ onMouseEnter={() => setIsHovering('button')}
187
+ onMouseLeave={() => setIsHovering(null)}
188
+ >
189
+ {dictionary[selectedKey] ? (
190
+ renderItem(selectedKey, dictionary[selectedKey])
191
+ ) : (
192
+ <span
193
+ style={{ color: '#6b7280' }}
194
+ >{`Select ${type.charAt(0).toUpperCase() + type.slice(1)}`}</span>
195
+ )}
196
+ </button>
197
+
198
+ {isOpen && (
199
+ <div
200
+ style={{
201
+ ...styles.dropdown,
202
+ ...menuStyle,
203
+ }}
204
+ >
205
+ <div style={{ padding: '0.25rem 0' }}>
206
+ {Object.entries(dictionary)
207
+ .filter(([key]) => key !== selectedKey)
208
+ .map(([key, item]) => (
209
+ <button
210
+ type="button"
211
+ key={key}
212
+ style={{
213
+ ...styles.dropdownItem,
214
+ ...(isHovering === key ? styles.dropdownItemHover : {}),
215
+ }}
216
+ onMouseEnter={() => setIsHovering(key)}
217
+ onMouseLeave={() => setIsHovering(null)}
218
+ onClick={e => {
219
+ // Stop event propagation to prevent handleClickOutside from firing
220
+ e.stopPropagation();
221
+
222
+ if (onSelect) {
223
+ onSelect(key);
224
+ }
225
+ setIsOpen(false);
226
+ }}
227
+ >
228
+ {renderItem(key, item)}
229
+ </button>
230
+ ))}
231
+ </div>
232
+ </div>
233
+ )}
234
+ </div>
235
+ );
236
+ }
@@ -0,0 +1,248 @@
1
+ import { FaFile, FaLink, FaPaperclip, FaSearch, FaTag } from 'react-icons/fa';
2
+ import { ReviewCard } from '@envive-ai/react-toolkit-v3/ReviewCard';
3
+ import { Message as MessageComponent } from '@envive-ai/react-toolkit-v3/Message';
4
+ import classNames from 'classnames';
5
+ import { Message, MessageType } from '@envive-ai/react-hooks/application/models';
6
+
7
+ const textContentMessageTypes = new Set([
8
+ MessageType.Text,
9
+ MessageType.QueryTyped,
10
+ MessageType.SuggestionClicked,
11
+ MessageType.CXAgentResponse,
12
+ ]);
13
+
14
+ const containerClassNames = classNames({
15
+ 'envive-tw-flex': true,
16
+ 'envive-tw-flex-col': true,
17
+ 'envive-tw-gap-1': true,
18
+ });
19
+
20
+ const fontSemiboldClassNames = classNames({
21
+ 'envive-tw-font-semibold': true,
22
+ });
23
+
24
+ const flexItemsClassNames = classNames({
25
+ 'envive-tw-flex': true,
26
+ 'envive-tw-items-center': true,
27
+ });
28
+
29
+ const gap1ClassNames = classNames({
30
+ 'envive-tw-gap-1': true,
31
+ });
32
+
33
+ const textLinkClassNames = classNames({
34
+ 'envive-tw-text-[--spiffy-colors-text-link]': true,
35
+ 'envive-tw-underline': true,
36
+ });
37
+
38
+ const textLgClassNames = classNames({
39
+ 'envive-tw-text-lg': true,
40
+ });
41
+
42
+ const iconClassNames = classNames({
43
+ 'envive-tw-w-3': true,
44
+ 'envive-tw-h-3': true,
45
+ });
46
+
47
+ export const MessageContent = ({ message: m }: { message: Message }) => {
48
+ // text messages
49
+ if (textContentMessageTypes.has(m.type)) {
50
+ if (m.type === MessageType.Text) {
51
+ return (
52
+ <MessageComponent
53
+ key={m.id}
54
+ content={m.metadata.content}
55
+ />
56
+ );
57
+ }
58
+ if (m.type === MessageType.QueryTyped) {
59
+ return (
60
+ <MessageComponent
61
+ key={m.id}
62
+ content={m.metadata.content}
63
+ />
64
+ );
65
+ }
66
+ if (m.type === MessageType.SuggestionClicked) {
67
+ return (
68
+ <MessageComponent
69
+ key={m.id}
70
+ content={m.metadata.suggestionContent}
71
+ />
72
+ );
73
+ }
74
+ if (m.type === MessageType.CXAgentResponse) {
75
+ return (
76
+ <MessageComponent
77
+ key={m.id}
78
+ content={m.metadata.message}
79
+ />
80
+ );
81
+ }
82
+ return (
83
+ <MessageComponent
84
+ key={m.id}
85
+ content="unknown"
86
+ />
87
+ );
88
+ }
89
+
90
+ if (m.type === MessageType.Product) {
91
+ return (
92
+ <div className={classNames(flexItemsClassNames, gap1ClassNames, 'envive-tw-text-sm')}>
93
+ <FaTag className={iconClassNames} />
94
+
95
+ <a
96
+ href={m.metadata.url}
97
+ target="_blank"
98
+ rel="noopener noreferrer"
99
+ className={textLinkClassNames}
100
+ >
101
+ {m.metadata.title}
102
+ </a>
103
+ </div>
104
+ );
105
+ }
106
+
107
+ if (m.type === MessageType.Review) {
108
+ return (
109
+ <ReviewCard
110
+ name={m.metadata?.reviewer ?? ''}
111
+ rating={m.metadata?.stars ?? 0}
112
+ reviewText={m.metadata?.review ?? ''}
113
+ />
114
+ );
115
+ }
116
+
117
+ if (m.type === MessageType.Separator) {
118
+ return (
119
+ <div className="envive-tw-relative envive-tw-flex envive-tw-w-full envive-tw-items-center envive-tw-p-2">
120
+ <div className="envive-tw-flex-grow envive-tw-border-t envive-tw-border-gray-500" />
121
+
122
+ <span className="envive-tw-flex-shrink envive-tw-px-4 envive-tw-text-sm envive-tw-text-gray-500">
123
+ New Discussion
124
+ </span>
125
+
126
+ <div className="envive-tw-flex-grow envive-tw-border-t envive-tw-border-gray-500" />
127
+ </div>
128
+ );
129
+ }
130
+
131
+ if (m.type === MessageType.Page) {
132
+ return (
133
+ <div className={containerClassNames}>
134
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
135
+ <FaFile className={iconClassNames} />
136
+
137
+ <span className={classNames(textLgClassNames, fontSemiboldClassNames)}>
138
+ {m.metadata?.title}
139
+ </span>
140
+ </div>
141
+
142
+ {m.metadata?.url && (
143
+ <div className={classNames(flexItemsClassNames, gap1ClassNames)}>
144
+ <FaLink className={iconClassNames} />
145
+
146
+ <a
147
+ href={m.metadata.url}
148
+ target="_blank"
149
+ rel="noopener noreferrer"
150
+ className={textLinkClassNames}
151
+ >
152
+ {m.metadata.url}
153
+ </a>
154
+ </div>
155
+ )}
156
+ </div>
157
+ );
158
+ }
159
+
160
+ if (m.type === MessageType.Search) {
161
+ return (
162
+ <div className={containerClassNames}>
163
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
164
+ <FaSearch className={iconClassNames} /> Search
165
+ </div>
166
+
167
+ <div>{m.metadata?.searchTerm}</div>
168
+ </div>
169
+ );
170
+ }
171
+
172
+ if (m.type === MessageType.Attachment) {
173
+ return (
174
+ <div className={containerClassNames}>
175
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
176
+ <FaPaperclip className={iconClassNames} /> Attachment
177
+ </div>
178
+
179
+ <div>{m.metadata?.message}</div>
180
+
181
+ {m.metadata?.attachment.map(attachment => (
182
+ <div key={attachment.id}>
183
+ <a
184
+ href={attachment.url ?? ''}
185
+ target="_blank"
186
+ rel="noopener noreferrer"
187
+ className={textLinkClassNames}
188
+ >
189
+ {attachment.name}
190
+ </a>
191
+ </div>
192
+ ))}
193
+ </div>
194
+ );
195
+ }
196
+
197
+ if (m.type === MessageType.Form) {
198
+ return (
199
+ <div className={containerClassNames}>
200
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
201
+ <FaPaperclip className={iconClassNames} /> Form Request
202
+ </div>
203
+
204
+ <div>{m.metadata?.formType}</div>
205
+ </div>
206
+ );
207
+ }
208
+
209
+ if (m.type === MessageType.ProductSearch) {
210
+ return (
211
+ <div className={containerClassNames}>
212
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
213
+ <FaPaperclip className={iconClassNames} /> Product Search Results
214
+ </div>
215
+
216
+ <div>
217
+ {m.metadata?.generatedQuery} - {m.metadata?.productCount} results
218
+ </div>
219
+ </div>
220
+ );
221
+ }
222
+
223
+ if (m.type === MessageType.ProductSearchFilter) {
224
+ return (
225
+ <div className={containerClassNames}>
226
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
227
+ <FaPaperclip className={iconClassNames} /> Product Search Filter
228
+ </div>
229
+
230
+ <div>Filter: {m.metadata?.filterName}</div>
231
+ </div>
232
+ );
233
+ }
234
+
235
+ if (m.type === MessageType.Order) {
236
+ return (
237
+ <div className={containerClassNames}>
238
+ <div className={classNames(fontSemiboldClassNames, flexItemsClassNames, gap1ClassNames)}>
239
+ <FaPaperclip className={iconClassNames} /> Order Information
240
+ </div>
241
+
242
+ <div>OrderNumber: {m.metadata?.orderNumber}</div>
243
+ </div>
244
+ );
245
+ }
246
+
247
+ throw new Error(`Unsupported message type: ${JSON.stringify(m)}`);
248
+ };