@envive-ai/react-widgets-v3 0.3.55 → 0.3.57

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 (54) hide show
  1. package/dist/debug/GenericSelect.cjs +4 -1
  2. package/dist/debug/GenericSelect.js +3 -1
  3. package/dist/debug/reportIssue.cjs +6 -3
  4. package/dist/debug/reportIssue.js +5 -3
  5. package/dist/hocs/withBaseWidget/withBaseWidget.cjs +13 -4
  6. package/dist/hocs/withBaseWidget/withBaseWidget.d.cts +2 -2
  7. package/dist/hocs/withBaseWidget/withBaseWidget.d.ts +2 -2
  8. package/dist/hocs/withBaseWidget/withBaseWidget.js +13 -4
  9. package/dist/node_modules/@spiffy-ai/commerce-api-client/dist/models/AISuggestionsServedMethodAttribution.cjs +10 -2
  10. package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  11. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts +3 -3
  12. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.cts +3 -3
  13. package/dist/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts +3 -3
  14. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.cts +3 -3
  15. package/dist/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts +3 -3
  16. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.cjs +3 -25
  17. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.cts +2 -2
  18. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  19. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.js +4 -26
  20. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  21. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  22. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  23. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  24. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  25. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  26. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.cjs +1 -1
  27. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  28. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  29. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.js +1 -1
  30. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  31. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  32. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  33. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  34. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  35. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  36. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  37. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  38. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  39. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
  40. package/package.json +1 -1
  41. package/src/debug/GenericSelect.tsx +4 -1
  42. package/src/debug/reportIssue.tsx +6 -3
  43. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +159 -2
  44. package/src/hocs/withBaseWidget/withBaseWidget.tsx +29 -1
  45. package/src/widgets/ChatPreviewWidget/__tests__/ChatPreviewWidget.test.tsx +5 -1
  46. package/src/widgets/FloatingChatWidget/FloatingChatWidget.tsx +19 -42
  47. package/src/widgets/FloatingChatWidget/__tests__/FloatingChatWidget.test.tsx +1 -1
  48. package/src/widgets/ProductCardWidget/__tests__/ProductCardWidget.test.tsx +6 -1
  49. package/src/widgets/PromptButtonCarouselWithImageWidget/__tests__/PromptButtonCarouselWithImageWidget.test.tsx +5 -1
  50. package/src/widgets/PromptCarouselWidget/PromptCarouselWidget.tsx +3 -1
  51. package/src/widgets/PromptCarouselWidget/__tests__/PromptCarouselWidget.test.tsx +1 -1
  52. package/src/widgets/SocialProofWidget/__tests__/SocialProofWidget.test.tsx +5 -1
  53. package/src/widgets/TitledPromptCarouselWidget/__tests__/TitledPromptCarouselWidget.test.tsx +1 -1
  54. package/src/widgets/TypingAnimationWidget/__tests__/TypingAnimationWidget.test.tsx +5 -1
@@ -2,8 +2,11 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  let react = require("react");
3
3
  react = require_rolldown_runtime.__toESM(react);
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
+ let __envive_ai_react_hooks_application_logging = require("@envive-ai/react-hooks/application/logging");
6
+ __envive_ai_react_hooks_application_logging = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_logging);
5
7
 
6
8
  //#region src/debug/GenericSelect.tsx
9
+ const logger = new __envive_ai_react_hooks_application_logging.default("GenericSelect");
7
10
  const dictionaries = { priority: {
8
11
  p0: { label: "Urgent" },
9
12
  p1: { label: "High" },
@@ -114,7 +117,7 @@ function GenericSelect({ type, selectedKey, onSelect, buttonStyle = {}, menuStyl
114
117
  };
115
118
  }, [isOpen]);
116
119
  if (!dictionary) {
117
- console.error(`Invalid type "${type}".`);
120
+ logger.logError(`Invalid type "${type}".`, void 0);
118
121
  return null;
119
122
  }
120
123
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -1,7 +1,9 @@
1
1
  import React, { useRef, useState } from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import Logger from "@envive-ai/react-hooks/application/logging";
3
4
 
4
5
  //#region src/debug/GenericSelect.tsx
6
+ const logger = new Logger("GenericSelect");
5
7
  const dictionaries = { priority: {
6
8
  p0: { label: "Urgent" },
7
9
  p1: { label: "High" },
@@ -112,7 +114,7 @@ function GenericSelect({ type, selectedKey, onSelect, buttonStyle = {}, menuStyl
112
114
  };
113
115
  }, [isOpen]);
114
116
  if (!dictionary) {
115
- console.error(`Invalid type "${type}".`);
117
+ logger.logError(`Invalid type "${type}".`, void 0);
116
118
  return null;
117
119
  }
118
120
  return /* @__PURE__ */ jsxs("div", {
@@ -15,9 +15,12 @@ let __envive_ai_react_hooks_application_commerce_api = require("@envive-ai/react
15
15
  __envive_ai_react_hooks_application_commerce_api = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_commerce_api);
16
16
  let __envive_ai_react_hooks_atoms_envive_enviveConfig = require("@envive-ai/react-hooks/atoms/envive/enviveConfig");
17
17
  let __envive_ai_react_hooks_application_utils = require("@envive-ai/react-hooks/application/utils");
18
+ let __envive_ai_react_hooks_application_logging = require("@envive-ai/react-hooks/application/logging");
19
+ __envive_ai_react_hooks_application_logging = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_logging);
18
20
 
19
21
  //#region src/debug/reportIssue.tsx
20
22
  var import_dist = require_index.default;
23
+ const logger = new __envive_ai_react_hooks_application_logging.default("reportIssue");
21
24
  const messageContent = (m) => {
22
25
  if (m.type === __envive_ai_react_hooks_application_models.MessageType.Text) return m.metadata.content;
23
26
  if (m.type === __envive_ai_react_hooks_application_models.MessageType.Product) return `PRODUCT ID: ${m.metadata?.id}`;
@@ -39,7 +42,7 @@ const ReportHeader = ({ onClose }) => {
39
42
  try {
40
43
  await navigator.clipboard.writeText(userId);
41
44
  } catch (err) {
42
- console.error("Failed to copy to clipboard:", err);
45
+ logger.logError("Failed to copy to clipboard", err);
43
46
  }
44
47
  }, [userId]);
45
48
  const headerTitleClassnames = (0, classnames.default)({
@@ -431,11 +434,11 @@ const ReportIssue = () => {
431
434
  turn_info: turnInfo,
432
435
  report_type: reportType
433
436
  };
434
- console.info("Submitting report", request);
437
+ logger.logInfo("Submitting report", request);
435
438
  await __envive_ai_react_hooks_application_commerce_api.default.reportSession(request);
436
439
  onClose();
437
440
  } catch (error) {
438
- console.error("Error sending report", error);
441
+ logger.logError("Error sending report", error);
439
442
  setErrorMessage("There was an error sending the report. Please try again or contact Envive Support.");
440
443
  } finally {
441
444
  setIsReporting(false);
@@ -12,8 +12,10 @@ import classNames from "classnames";
12
12
  import CommerceApiClient from "@envive-ai/react-hooks/application/commerce-api";
13
13
  import { orgShortNameAtom } from "@envive-ai/react-hooks/atoms/envive/enviveConfig";
14
14
  import { StringUtils, validateEmail } from "@envive-ai/react-hooks/application/utils";
15
+ import Logger from "@envive-ai/react-hooks/application/logging";
15
16
 
16
17
  //#region src/debug/reportIssue.tsx
18
+ const logger = new Logger("reportIssue");
17
19
  const messageContent = (m) => {
18
20
  if (m.type === MessageType.Text) return m.metadata.content;
19
21
  if (m.type === MessageType.Product) return `PRODUCT ID: ${m.metadata?.id}`;
@@ -35,7 +37,7 @@ const ReportHeader = ({ onClose }) => {
35
37
  try {
36
38
  await navigator.clipboard.writeText(userId);
37
39
  } catch (err) {
38
- console.error("Failed to copy to clipboard:", err);
40
+ logger.logError("Failed to copy to clipboard", err);
39
41
  }
40
42
  }, [userId]);
41
43
  const headerTitleClassnames = classNames({
@@ -427,11 +429,11 @@ const ReportIssue = () => {
427
429
  turn_info: turnInfo,
428
430
  report_type: reportType
429
431
  };
430
- console.info("Submitting report", request);
432
+ logger.logInfo("Submitting report", request);
431
433
  await CommerceApiClient.reportSession(request);
432
434
  onClose();
433
435
  } catch (error) {
434
- console.error("Error sending report", error);
436
+ logger.logError("Error sending report", error);
435
437
  setErrorMessage("There was an error sending the report. Please try again or contact Envive Support.");
436
438
  } finally {
437
439
  setIsReporting(false);
@@ -22,7 +22,10 @@ function withBaseWidget(Widget, options) {
22
22
  const { getWidgetConfig, isLoading: isWidgetConfigLoading } = (0, __envive_ai_react_hooks_contexts_widgetConfigContext.useWidgetConfig)();
23
23
  const [uiConfig, setUiConfig] = (0, react.useState)(void 0);
24
24
  const { getUiConfig, isLoading: isUiConfigLoading } = (0, __envive_ai_react_hooks_contexts_uiConfigContext.useUiConfig)();
25
- const isLoading = isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading;
25
+ const [hardcopySettled, setHardcopySettled] = (0, react.useState)(false);
26
+ const [widgetConfigSettled, setWidgetConfigSettled] = (0, react.useState)(false);
27
+ const [uiConfigSettled, setUiConfigSettled] = (0, react.useState)(false);
28
+ const isLoading = !(hardcopySettled && widgetConfigSettled && uiConfigSettled) && (isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading);
26
29
  const { isVisible } = (0, __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent.useTrackComponentVisibleEvent)(widgetRef, {
27
30
  widget_config_id: widgetConfigId,
28
31
  widget_type: widgetType,
@@ -42,7 +45,9 @@ function withBaseWidget(Widget, options) {
42
45
  getHardcopy({
43
46
  widgetType,
44
47
  userEvent
45
- }).then(setHardcopyContent).catch(() => {});
48
+ }).then(setHardcopyContent).catch(() => {}).finally(() => {
49
+ setHardcopySettled(true);
50
+ });
46
51
  }, [
47
52
  startLoading,
48
53
  widgetType,
@@ -52,7 +57,9 @@ function withBaseWidget(Widget, options) {
52
57
  ]);
53
58
  (0, react.useEffect)(() => {
54
59
  if (!startLoading) return;
55
- getUiConfig().then(setUiConfig).catch(() => {});
60
+ getUiConfig().then(setUiConfig).catch(() => {}).finally(() => {
61
+ setUiConfigSettled(true);
62
+ });
56
63
  }, [
57
64
  startLoading,
58
65
  getUiConfig,
@@ -64,7 +71,9 @@ function withBaseWidget(Widget, options) {
64
71
  getWidgetConfig({
65
72
  widgetConfigId,
66
73
  widgetType
67
- }).then(setWidgetConfig).catch(() => {});
74
+ }).then(setWidgetConfig).catch(() => {}).finally(() => {
75
+ setWidgetConfigSettled(true);
76
+ });
68
77
  }, [
69
78
  startLoading,
70
79
  widgetConfigId,
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/hocs/withBaseWidget/withBaseWidget.d.ts
5
5
  declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
6
- (props: P): react_jsx_runtime7.JSX.Element;
6
+ (props: P): react_jsx_runtime0.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.js";
2
- import * as react_jsx_runtime18 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/hocs/withBaseWidget/withBaseWidget.d.ts
5
5
  declare function withBaseWidget<P extends BaseWidgetProps>(Widget: React.ComponentType<P>, options?: WithBaseWidgetOptions): {
6
- (props: P): react_jsx_runtime18.JSX.Element;
6
+ (props: P): react_jsx_runtime13.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  //#endregion
@@ -21,7 +21,10 @@ function withBaseWidget(Widget, options) {
21
21
  const { getWidgetConfig, isLoading: isWidgetConfigLoading } = useWidgetConfig();
22
22
  const [uiConfig, setUiConfig] = useState(void 0);
23
23
  const { getUiConfig, isLoading: isUiConfigLoading } = useUiConfig();
24
- const isLoading = isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading;
24
+ const [hardcopySettled, setHardcopySettled] = useState(false);
25
+ const [widgetConfigSettled, setWidgetConfigSettled] = useState(false);
26
+ const [uiConfigSettled, setUiConfigSettled] = useState(false);
27
+ const isLoading = !(hardcopySettled && widgetConfigSettled && uiConfigSettled) && (isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading);
25
28
  const { isVisible } = useTrackComponentVisibleEvent(widgetRef, {
26
29
  widget_config_id: widgetConfigId,
27
30
  widget_type: widgetType,
@@ -41,7 +44,9 @@ function withBaseWidget(Widget, options) {
41
44
  getHardcopy({
42
45
  widgetType,
43
46
  userEvent
44
- }).then(setHardcopyContent).catch(() => {});
47
+ }).then(setHardcopyContent).catch(() => {}).finally(() => {
48
+ setHardcopySettled(true);
49
+ });
45
50
  }, [
46
51
  startLoading,
47
52
  widgetType,
@@ -51,7 +56,9 @@ function withBaseWidget(Widget, options) {
51
56
  ]);
52
57
  useEffect(() => {
53
58
  if (!startLoading) return;
54
- getUiConfig().then(setUiConfig).catch(() => {});
59
+ getUiConfig().then(setUiConfig).catch(() => {}).finally(() => {
60
+ setUiConfigSettled(true);
61
+ });
55
62
  }, [
56
63
  startLoading,
57
64
  getUiConfig,
@@ -63,7 +70,9 @@ function withBaseWidget(Widget, options) {
63
70
  getWidgetConfig({
64
71
  widgetConfigId,
65
72
  widgetType
66
- }).then(setWidgetConfig).catch(() => {});
73
+ }).then(setWidgetConfig).catch(() => {}).finally(() => {
74
+ setWidgetConfigSettled(true);
75
+ });
67
76
  }, [
68
77
  startLoading,
69
78
  widgetConfigId,
@@ -49,7 +49,11 @@ var require_AISuggestionsServedMethodAttribution = /* @__PURE__ */ require_rolld
49
49
  "mode": json["mode"] == null ? void 0 : json["mode"],
50
50
  "schema_version": json["schema_version"] == null ? void 0 : json["schema_version"],
51
51
  "served_method_id": json["served_method_id"] == null ? void 0 : json["served_method_id"],
52
- "served_method_type": json["served_method_type"] == null ? void 0 : json["served_method_type"]
52
+ "served_method_type": json["served_method_type"] == null ? void 0 : json["served_method_type"],
53
+ "sig": json["sig"] == null ? void 0 : json["sig"],
54
+ "training_entity_id": json["training_entity_id"] == null ? void 0 : json["training_entity_id"],
55
+ "training_page_variant": json["training_page_variant"] == null ? void 0 : json["training_page_variant"],
56
+ "training_widget_type": json["training_widget_type"] == null ? void 0 : json["training_widget_type"]
53
57
  };
54
58
  }
55
59
  function AISuggestionsServedMethodAttributionToJSON(json) {
@@ -64,7 +68,11 @@ var require_AISuggestionsServedMethodAttribution = /* @__PURE__ */ require_rolld
64
68
  "mode": value["mode"],
65
69
  "schema_version": value["schema_version"],
66
70
  "served_method_id": value["served_method_id"],
67
- "served_method_type": value["served_method_type"]
71
+ "served_method_type": value["served_method_type"],
72
+ "sig": value["sig"],
73
+ "training_entity_id": value["training_entity_id"],
74
+ "training_page_variant": value["training_page_variant"],
75
+ "training_widget_type": value["training_widget_type"]
68
76
  };
69
77
  }
70
78
  }));
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region ../widgets/dist/SearchResults/SearchResultsWidget.d.ts
4
4
  //#region src/SearchResults/SearchResultsWidget.d.ts
5
- declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
5
+ declare const SearchResultsWidget: () => react_jsx_runtime0.JSX.Element;
6
6
  //#endregion
7
7
 
8
8
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.ts
5
5
  declare const ChatPreviewComparisonWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime16.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewComparisonWidgetProps {
@@ -12,7 +12,7 @@ interface ChatPreviewComparisonWidgetProps {
12
12
  declare const ChatPreviewComparisonWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: ChatPreviewComparisonWidgetProps): react_jsx_runtime0.JSX.Element;
15
+ }: ChatPreviewComparisonWidgetProps): react_jsx_runtime16.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
5
5
  declare const ChatPreviewLoadingWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime3.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime13.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewLoadingWidgetProps {
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
11
11
  }
12
12
  declare const ChatPreviewLoadingWidget: ({
13
13
  widgetConfigId
14
- }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime3.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime13.JSX.Element;
15
15
  //#endregion
16
16
  export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.d.ts
5
5
  declare const ChatPreviewLoadingWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime10.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime14.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewLoadingWidgetProps {
@@ -11,6 +11,6 @@ interface ChatPreviewLoadingWidgetProps {
11
11
  }
12
12
  declare const ChatPreviewLoadingWidget: ({
13
13
  widgetConfigId
14
- }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime10.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime14.JSX.Element;
15
15
  //#endregion
16
16
  export { ChatPreviewLoadingWidget, ChatPreviewLoadingWidgetProps, ChatPreviewLoadingWidgetWithBaseWidget };
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
5
5
  declare const ChatPreviewWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime8.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime10.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewWidgetProps {
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
12
12
  declare const ChatPreviewWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: ChatPreviewWidgetProps): react_jsx_runtime8.JSX.Element;
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime10.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/ChatPreviewWidget/ChatPreviewWidget.d.ts
5
5
  declare const ChatPreviewWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime3.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime11.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface ChatPreviewWidgetProps {
@@ -12,7 +12,7 @@ interface ChatPreviewWidgetProps {
12
12
  declare const ChatPreviewWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: ChatPreviewWidgetProps): react_jsx_runtime3.JSX.Element;
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime11.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -18,8 +18,6 @@ let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/c
18
18
  let __envive_ai_react_hooks_hooks_ChatToggle = require("@envive-ai/react-hooks/hooks/ChatToggle");
19
19
  let __envive_ai_react_hooks_contexts_featureFlagServiceContext = require("@envive-ai/react-hooks/contexts/featureFlagServiceContext");
20
20
  let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
21
- let __envive_ai_react_hooks_hooks_WidgetInteraction = require("@envive-ai/react-hooks/hooks/WidgetInteraction");
22
- let __envive_ai_react_hooks_hooks_WidgetInteraction_types = require("@envive-ai/react-hooks/hooks/WidgetInteraction/types");
23
21
  let __envive_ai_react_toolkit_v3_Tokens = require("@envive-ai/react-toolkit-v3/Tokens");
24
22
  let __envive_ai_react_toolkit_v3_FloatingButton = require("@envive-ai/react-toolkit-v3/FloatingButton");
25
23
 
@@ -47,7 +45,6 @@ const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchT
47
45
  const FloatingChatWidgetHandler = (props) => {
48
46
  const { previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled, previewDisclaimer } = props;
49
47
  const salesAgentData = (0, __envive_ai_react_hooks_contexts_salesAgentContext.useSalesAgent)();
50
- const { trackWidgetInteraction } = (0, __envive_ai_react_hooks_hooks_WidgetInteraction.useWidgetInteraction)();
51
48
  const { userHasInteractedValue } = require_useGetWidgetStatus.default();
52
49
  const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
53
50
  const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
@@ -65,16 +62,6 @@ const FloatingChatWidgetHandler = (props) => {
65
62
  (0, react.useEffect)(() => {
66
63
  if (isOpen) setIsCXOpen(false);
67
64
  }, [isOpen]);
68
- const handleClose = (type) => {
69
- trackWidgetInteraction({
70
- eventName: __envive_ai_react_hooks_contexts_amplitudeContext.EnviveMetricsEventName.WidgetInteraction,
71
- trigger: {
72
- widget: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionComponent.FLOATING_CHAT,
73
- widget_interaction: __envive_ai_react_hooks_hooks_WidgetInteraction_types.WidgetInteractionType.WIDGET_COLLAPSED,
74
- widget_interaction_data: { widget_collapsed: type }
75
- }
76
- });
77
- };
78
65
  const { shouldShowFloatingButton } = require_useFloatingButtonVisibility.useFloatingButtonVisibility({
79
66
  floatingButtonShowConfig: floatingButton?.showOption,
80
67
  isChatOpen: isOpen,
@@ -102,10 +89,7 @@ const FloatingChatWidgetHandler = (props) => {
102
89
  children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [!previewButtonOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FloatingChatOverlay.FloatingChatOverlay, {
103
90
  isOpened: effectiveIsOpen,
104
91
  isResultsModalOpen,
105
- onClose: previewChatAlwaysOpen ? () => {} : () => {
106
- closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
107
- handleClose({ collapse_source: "body_click" });
108
- },
92
+ onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY, void 0, "body_click"),
109
93
  previewMode: !!previewChatAlwaysOpen,
110
94
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatingChat, {
111
95
  setIsResultsModalOpen,
@@ -118,14 +102,8 @@ const FloatingChatWidgetHandler = (props) => {
118
102
  isFloatingChatOpen: effectiveIsOpen,
119
103
  onToggleCXButton: toggle,
120
104
  debugBar: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_debugBar.DebugBar, {}),
121
- onSwipeClose: previewChatAlwaysOpen ? () => {} : () => {
122
- closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON);
123
- handleClose({ collapse_source: "swipe" });
124
- },
125
- onClose: previewChatAlwaysOpen ? () => {} : () => {
126
- closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON);
127
- handleClose({ collapse_source: "close_button" });
128
- }
105
+ onSwipeClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON, void 0, "swipe"),
106
+ onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(__envive_ai_react_hooks_application_models.ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON, void 0, "close_button")
129
107
  }) })
130
108
  }), buttonShouldRender && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_v3_FloatingButton.FloatingButton, {
131
109
  containerRef: floatingButtonVisibilityRef,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
@@ -13,7 +13,7 @@ declare const FloatingChatWidget: {
13
13
  previewChatAlwaysOpen,
14
14
  previewCXButtonsEnabled,
15
15
  previewDisclaimer
16
- }?: FloatingChatWidgetProps): react_jsx_runtime14.JSX.Element;
16
+ }?: FloatingChatWidgetProps): react_jsx_runtime15.JSX.Element;
17
17
  displayName: string;
18
18
  };
19
19
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FloatingChatWidget/FloatingChatWidget.d.ts
4
4
  interface FloatingChatWidgetProps {
@@ -13,7 +13,7 @@ declare const FloatingChatWidget: {
13
13
  previewChatAlwaysOpen,
14
14
  previewCXButtonsEnabled,
15
15
  previewDisclaimer
16
- }?: FloatingChatWidgetProps): react_jsx_runtime15.JSX.Element;
16
+ }?: FloatingChatWidgetProps): react_jsx_runtime4.JSX.Element;
17
17
  displayName: string;
18
18
  };
19
19
  //#endregion
@@ -9,7 +9,7 @@ import { FloatingChatOverlay } from "./FloatingChatOverlay.js";
9
9
  import { useFloatingButtonVisibility } from "./hooks/useFloatingButtonVisibility.js";
10
10
  import { useAutoPopup } from "./hooks/useAutoPopup.js";
11
11
  import { Suspense, lazy, useEffect, useMemo, useRef, useState } from "react";
12
- import { EnviveMetricsEventName, useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
12
+ import { useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
13
13
  import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
14
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
15
  import { useSalesAgent } from "@envive-ai/react-hooks/contexts/salesAgentContext";
@@ -17,8 +17,6 @@ import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
17
17
  import { useChatToggle } from "@envive-ai/react-hooks/hooks/ChatToggle";
18
18
  import { useFeatureFlagService } from "@envive-ai/react-hooks/contexts/featureFlagServiceContext";
19
19
  import { ChatElementDisplayLocationV3, FeatureGates } from "@envive-ai/react-hooks/application/models";
20
- import { useWidgetInteraction } from "@envive-ai/react-hooks/hooks/WidgetInteraction";
21
- import { WidgetInteractionComponent, WidgetInteractionType } from "@envive-ai/react-hooks/hooks/WidgetInteraction/types";
22
20
  import { Theme } from "@envive-ai/react-toolkit-v3/Tokens";
23
21
  import { FloatingButton } from "@envive-ai/react-toolkit-v3/FloatingButton";
24
22
 
@@ -46,7 +44,6 @@ const CXButtonProvider = ({ provider, enabled, suppressMerchantButton, onSwitchT
46
44
  const FloatingChatWidgetHandler = (props) => {
47
45
  const { previewButtonOnly, previewChatAlwaysOpen, previewCXButtonsEnabled, previewDisclaimer } = props;
48
46
  const salesAgentData = useSalesAgent();
49
- const { trackWidgetInteraction } = useWidgetInteraction();
50
47
  const { userHasInteractedValue } = useGetWidgetStatus_default();
51
48
  const { uiConfig, isUiConfigLoading, hardcopyContent } = props;
52
49
  const { customerServiceIntegration, floatingButton, floatingChat } = uiConfig ?? {};
@@ -64,16 +61,6 @@ const FloatingChatWidgetHandler = (props) => {
64
61
  useEffect(() => {
65
62
  if (isOpen) setIsCXOpen(false);
66
63
  }, [isOpen]);
67
- const handleClose = (type) => {
68
- trackWidgetInteraction({
69
- eventName: EnviveMetricsEventName.WidgetInteraction,
70
- trigger: {
71
- widget: WidgetInteractionComponent.FLOATING_CHAT,
72
- widget_interaction: WidgetInteractionType.WIDGET_COLLAPSED,
73
- widget_interaction_data: { widget_collapsed: type }
74
- }
75
- });
76
- };
77
64
  const { shouldShowFloatingButton } = useFloatingButtonVisibility({
78
65
  floatingButtonShowConfig: floatingButton?.showOption,
79
66
  isChatOpen: isOpen,
@@ -101,10 +88,7 @@ const FloatingChatWidgetHandler = (props) => {
101
88
  children: ({ isSwitchEnabled, toggle }) => /* @__PURE__ */ jsxs(Fragment, { children: [!previewButtonOnly && /* @__PURE__ */ jsx(FloatingChatOverlay, {
102
89
  isOpened: effectiveIsOpen,
103
90
  isResultsModalOpen,
104
- onClose: previewChatAlwaysOpen ? () => {} : () => {
105
- closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY);
106
- handleClose({ collapse_source: "body_click" });
107
- },
91
+ onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_OVERLAY, void 0, "body_click"),
108
92
  previewMode: !!previewChatAlwaysOpen,
109
93
  children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(FloatingChat, {
110
94
  setIsResultsModalOpen,
@@ -117,14 +101,8 @@ const FloatingChatWidgetHandler = (props) => {
117
101
  isFloatingChatOpen: effectiveIsOpen,
118
102
  onToggleCXButton: toggle,
119
103
  debugBar: /* @__PURE__ */ jsx(DebugBar, {}),
120
- onSwipeClose: previewChatAlwaysOpen ? () => {} : () => {
121
- closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON);
122
- handleClose({ collapse_source: "swipe" });
123
- },
124
- onClose: previewChatAlwaysOpen ? () => {} : () => {
125
- closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON);
126
- handleClose({ collapse_source: "close_button" });
127
- }
104
+ onSwipeClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON, void 0, "swipe"),
105
+ onClose: previewChatAlwaysOpen ? () => {} : () => closeChat(ChatElementDisplayLocationV3.FLOATING_CHAT_CLOSE_BUTTON, void 0, "close_button")
128
106
  }) })
129
107
  }), buttonShouldRender && /* @__PURE__ */ jsx(FloatingButton, {
130
108
  containerRef: floatingButtonVisibilityRef,
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts
4
4
 
@@ -8,7 +8,7 @@ interface FullPageSalesAgentBaseWidgetProps {
8
8
  declare const FullPageSalesAgentWidget: {
9
9
  ({
10
10
  widgetConfigId
11
- }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime1.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime18.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime16 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts
4
4
 
@@ -8,7 +8,7 @@ interface FullPageSalesAgentBaseWidgetProps {
8
8
  declare const FullPageSalesAgentWidget: {
9
9
  ({
10
10
  widgetConfigId
11
- }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime16.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime8.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime10.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime12.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/ProductCardWidget/ProductCardWidget.d.ts
4
4
  interface ProductCardWidgetProps {
@@ -7,7 +7,7 @@ interface ProductCardWidgetProps {
7
7
  declare const ProductCardWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: ProductCardWidgetProps): react_jsx_runtime2.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime10.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime18 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
5
5
  declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime18.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime1.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface PromptButtonCarouselWithImageWidgetProps {
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
12
12
  declare const PromptButtonCarouselWithImageWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime18.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime1.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.js";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts
5
5
  declare const PromptButtonCarouselWithImageWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime8.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime5.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface PromptButtonCarouselWithImageWidgetProps {
@@ -12,7 +12,7 @@ interface PromptButtonCarouselWithImageWidgetProps {
12
12
  declare const PromptButtonCarouselWithImageWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime8.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime5.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion