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

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 (43) hide show
  1. package/dist/debug/GenericSelect.cjs +1 -1
  2. package/dist/debug/GenericSelect.js +1 -1
  3. package/dist/debug/reportIssue.cjs +2 -2
  4. package/dist/debug/reportIssue.js +1 -1
  5. package/dist/hocs/withBaseWidget/withBaseWidget.cjs +34 -1
  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 +33 -1
  9. package/dist/packages/widgets/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
  10. package/dist/widgets/ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.d.cts +3 -3
  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.d.cts +2 -2
  17. package/dist/widgets/FloatingChatWidget/FloatingChatWidget.d.ts +2 -2
  18. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.cts +2 -2
  19. package/dist/widgets/FullPageSalesAgentWidget/FullPageSalesAgentWidget.d.ts +2 -2
  20. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.cts +2 -2
  21. package/dist/widgets/ProductCardWidget/ProductCardWidget.d.ts +2 -2
  22. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.cts +3 -3
  23. package/dist/widgets/PromptButtonCarouselWithImageWidget/PromptButtonCarouselWithImageWidget.d.ts +3 -3
  24. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.cts +2 -2
  25. package/dist/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts +2 -2
  26. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.cjs +1 -1
  27. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.cts +2 -2
  28. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts +2 -2
  29. package/dist/widgets/SocialProofFlowWidget/SocialProofFlowWidget.js +1 -1
  30. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.cts +3 -3
  31. package/dist/widgets/SocialProofWidget/SocialProofWidget.d.ts +3 -3
  32. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.cts +2 -2
  33. package/dist/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts +2 -2
  34. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.cjs +1 -1
  35. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.cts +2 -2
  36. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts +2 -2
  37. package/dist/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.js +1 -1
  38. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.cts +3 -3
  39. package/dist/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts +3 -3
  40. package/dist/widgets/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
  41. package/package.json +1 -1
  42. package/src/hocs/withBaseWidget/__tests__/withBaseWidget.test.tsx +76 -2
  43. package/src/hocs/withBaseWidget/withBaseWidget.tsx +42 -0
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  let react = require("react");
3
3
  react = require_rolldown_runtime.__toESM(react);
4
- let react_jsx_runtime = require("react/jsx-runtime");
5
4
  let __envive_ai_react_hooks_application_logging = require("@envive-ai/react-hooks/application/logging");
6
5
  __envive_ai_react_hooks_application_logging = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_logging);
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
7
 
8
8
  //#region src/debug/GenericSelect.tsx
9
9
  const logger = new __envive_ai_react_hooks_application_logging.default("GenericSelect");
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useState } from "react";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import Logger from "@envive-ai/react-hooks/application/logging";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/debug/GenericSelect.tsx
6
6
  const logger = new Logger("GenericSelect");
@@ -4,6 +4,8 @@ const require_IconCloseVariant = require('../packages/icons/dist/IconCloseVarian
4
4
  const require_GenericSelect = require('./GenericSelect.cjs');
5
5
  const require_chatEmbed = require('./chatEmbed.cjs');
6
6
  let react = require("react");
7
+ let __envive_ai_react_hooks_application_logging = require("@envive-ai/react-hooks/application/logging");
8
+ __envive_ai_react_hooks_application_logging = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_logging);
7
9
  let react_jsx_runtime = require("react/jsx-runtime");
8
10
  let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
9
11
  let jotai = require("jotai");
@@ -15,8 +17,6 @@ let __envive_ai_react_hooks_application_commerce_api = require("@envive-ai/react
15
17
  __envive_ai_react_hooks_application_commerce_api = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_commerce_api);
16
18
  let __envive_ai_react_hooks_atoms_envive_enviveConfig = require("@envive-ai/react-hooks/atoms/envive/enviveConfig");
17
19
  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);
20
20
 
21
21
  //#region src/debug/reportIssue.tsx
22
22
  var import_dist = require_index.default;
@@ -2,6 +2,7 @@ import { IconCloseVariant_default } from "../packages/icons/dist/IconCloseVarian
2
2
  import { GenericSelect } from "./GenericSelect.js";
3
3
  import chatEmbed_default from "./chatEmbed.js";
4
4
  import { useCallback, useEffect, useState } from "react";
5
+ import Logger from "@envive-ai/react-hooks/application/logging";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { chatAtom, lastAssistantMessageAtom } from "@envive-ai/react-hooks/atoms/chat";
7
8
  import { useAtomValue } from "jotai";
@@ -12,7 +13,6 @@ import classNames from "classnames";
12
13
  import CommerceApiClient from "@envive-ai/react-hooks/application/commerce-api";
13
14
  import { orgShortNameAtom } from "@envive-ai/react-hooks/atoms/envive/enviveConfig";
14
15
  import { StringUtils, validateEmail } from "@envive-ai/react-hooks/application/utils";
15
- import Logger from "@envive-ai/react-hooks/application/logging";
16
16
 
17
17
  //#region src/debug/reportIssue.tsx
18
18
  const logger = new Logger("reportIssue");
@@ -1,5 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  let react = require("react");
3
+ let __envive_ai_react_hooks_application_logging = require("@envive-ai/react-hooks/application/logging");
4
+ __envive_ai_react_hooks_application_logging = require_rolldown_runtime.__toESM(__envive_ai_react_hooks_application_logging);
3
5
  let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
4
6
  let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
5
7
  let __envive_ai_react_hooks_contexts_hardcopyContext = require("@envive-ai/react-hooks/contexts/hardcopyContext");
@@ -9,6 +11,8 @@ let __envive_ai_react_hooks_contexts_uiConfigContext = require("@envive-ai/react
9
11
  let react_jsx_runtime = require("react/jsx-runtime");
10
12
 
11
13
  //#region src/hocs/withBaseWidget/withBaseWidget.tsx
14
+ const logger = new __envive_ai_react_hooks_application_logging.default("withBaseWidget");
15
+ const WIDGET_LOADING_WATCHDOG_MS = 5e3;
12
16
  function withBaseWidget(Widget, options) {
13
17
  const WrappedWidget = (props) => {
14
18
  const { widgetConfigId, widgetType } = props;
@@ -25,7 +29,8 @@ function withBaseWidget(Widget, options) {
25
29
  const [hardcopySettled, setHardcopySettled] = (0, react.useState)(false);
26
30
  const [widgetConfigSettled, setWidgetConfigSettled] = (0, react.useState)(false);
27
31
  const [uiConfigSettled, setUiConfigSettled] = (0, react.useState)(false);
28
- const isLoading = !(hardcopySettled && widgetConfigSettled && uiConfigSettled) && (isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading);
32
+ const ownRequestsSettled = hardcopySettled && widgetConfigSettled && uiConfigSettled;
33
+ const isLoading = !ownRequestsSettled && (isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading);
29
34
  const { isVisible } = (0, __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent.useTrackComponentVisibleEvent)(widgetRef, {
30
35
  widget_config_id: widgetConfigId,
31
36
  widget_type: widgetType,
@@ -39,6 +44,34 @@ function withBaseWidget(Widget, options) {
39
44
  widgetConfigId,
40
45
  widgetType
41
46
  ]);
47
+ const settledStateRef = (0, react.useRef)({
48
+ hardcopy: false,
49
+ widgetConfig: false,
50
+ uiConfig: false
51
+ });
52
+ settledStateRef.current = {
53
+ hardcopy: hardcopySettled,
54
+ widgetConfig: widgetConfigSettled,
55
+ uiConfig: uiConfigSettled
56
+ };
57
+ (0, react.useEffect)(() => {
58
+ if (!startLoading || ownRequestsSettled) return;
59
+ const timer = setTimeout(() => {
60
+ const settled = settledStateRef.current;
61
+ logger.logError(`Widget still loading ${WIDGET_LOADING_WATCHDOG_MS}ms after fetches started`, void 0, {
62
+ widget_type: widgetType,
63
+ widget_config_id: widgetConfigId,
64
+ pending_requests: Object.entries(settled).filter(([, isSettled]) => !isSettled).map(([name]) => name),
65
+ connection_type: navigator.connection?.effectiveType
66
+ });
67
+ }, WIDGET_LOADING_WATCHDOG_MS);
68
+ return () => clearTimeout(timer);
69
+ }, [
70
+ startLoading,
71
+ ownRequestsSettled,
72
+ widgetConfigId,
73
+ widgetType
74
+ ]);
42
75
  (0, react.useEffect)(() => {
43
76
  if (!startLoading || hardcopyFetchedRef.current) return;
44
77
  hardcopyFetchedRef.current = true;
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps, WithBaseWidgetOptions } from "./types.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 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_runtime0.JSX.Element;
6
+ (props: P): react_jsx_runtime6.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_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 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_runtime13.JSX.Element;
6
+ (props: P): react_jsx_runtime17.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useMemo, useRef, useState } from "react";
2
+ import Logger from "@envive-ai/react-hooks/application/logging";
2
3
  import { useAmplitude } from "@envive-ai/react-hooks/contexts/amplitudeContext";
3
4
  import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
4
5
  import { useHardcopy } from "@envive-ai/react-hooks/contexts/hardcopyContext";
@@ -8,6 +9,8 @@ import { useUiConfig } from "@envive-ai/react-hooks/contexts/uiConfigContext";
8
9
  import { jsx } from "react/jsx-runtime";
9
10
 
10
11
  //#region src/hocs/withBaseWidget/withBaseWidget.tsx
12
+ const logger = new Logger("withBaseWidget");
13
+ const WIDGET_LOADING_WATCHDOG_MS = 5e3;
11
14
  function withBaseWidget(Widget, options) {
12
15
  const WrappedWidget = (props) => {
13
16
  const { widgetConfigId, widgetType } = props;
@@ -24,7 +27,8 @@ function withBaseWidget(Widget, options) {
24
27
  const [hardcopySettled, setHardcopySettled] = useState(false);
25
28
  const [widgetConfigSettled, setWidgetConfigSettled] = useState(false);
26
29
  const [uiConfigSettled, setUiConfigSettled] = useState(false);
27
- const isLoading = !(hardcopySettled && widgetConfigSettled && uiConfigSettled) && (isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading);
30
+ const ownRequestsSettled = hardcopySettled && widgetConfigSettled && uiConfigSettled;
31
+ const isLoading = !ownRequestsSettled && (isHardcopyLoading || isPageLoading || isWidgetConfigLoading || isUiConfigLoading);
28
32
  const { isVisible } = useTrackComponentVisibleEvent(widgetRef, {
29
33
  widget_config_id: widgetConfigId,
30
34
  widget_type: widgetType,
@@ -38,6 +42,34 @@ function withBaseWidget(Widget, options) {
38
42
  widgetConfigId,
39
43
  widgetType
40
44
  ]);
45
+ const settledStateRef = useRef({
46
+ hardcopy: false,
47
+ widgetConfig: false,
48
+ uiConfig: false
49
+ });
50
+ settledStateRef.current = {
51
+ hardcopy: hardcopySettled,
52
+ widgetConfig: widgetConfigSettled,
53
+ uiConfig: uiConfigSettled
54
+ };
55
+ useEffect(() => {
56
+ if (!startLoading || ownRequestsSettled) return;
57
+ const timer = setTimeout(() => {
58
+ const settled = settledStateRef.current;
59
+ logger.logError(`Widget still loading ${WIDGET_LOADING_WATCHDOG_MS}ms after fetches started`, void 0, {
60
+ widget_type: widgetType,
61
+ widget_config_id: widgetConfigId,
62
+ pending_requests: Object.entries(settled).filter(([, isSettled]) => !isSettled).map(([name]) => name),
63
+ connection_type: navigator.connection?.effectiveType
64
+ });
65
+ }, WIDGET_LOADING_WATCHDOG_MS);
66
+ return () => clearTimeout(timer);
67
+ }, [
68
+ startLoading,
69
+ ownRequestsSettled,
70
+ widgetConfigId,
71
+ widgetType
72
+ ]);
41
73
  useEffect(() => {
42
74
  if (!startLoading || hardcopyFetchedRef.current) return;
43
75
  hardcopyFetchedRef.current = true;
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 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_runtime0.JSX.Element;
5
+ declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
6
6
  //#endregion
7
7
 
8
8
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime16 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 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_runtime16.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime8.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_runtime16.JSX.Element;
15
+ }: ChatPreviewComparisonWidgetProps): react_jsx_runtime8.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_runtime16 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime9 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_runtime16.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime9.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_runtime16.JSX.Element;
15
+ }: ChatPreviewComparisonWidgetProps): react_jsx_runtime9.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_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 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_runtime13.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime4.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_runtime13.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime4.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_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime15 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_runtime14.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime15.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_runtime14.JSX.Element;
14
+ }: ChatPreviewLoadingWidgetProps) => react_jsx_runtime15.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_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 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_runtime10.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime1.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_runtime10.JSX.Element;
15
+ }: ChatPreviewWidgetProps): 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_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 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_runtime11.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime12.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_runtime11.JSX.Element;
15
+ }: ChatPreviewWidgetProps): react_jsx_runtime12.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 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_runtime11.JSX.Element;
17
17
  displayName: string;
18
18
  };
19
19
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 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_runtime4.JSX.Element;
16
+ }?: FloatingChatWidgetProps): react_jsx_runtime11.JSX.Element;
17
17
  displayName: string;
18
18
  };
19
19
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime18 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 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_runtime18.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime12.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 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_runtime8.JSX.Element;
11
+ }: FullPageSalesAgentBaseWidgetProps): react_jsx_runtime0.JSX.Element;
12
12
  displayName: string;
13
13
  };
14
14
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 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_runtime12.JSX.Element;
10
+ }: ProductCardWidgetProps): react_jsx_runtime3.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 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_runtime8.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_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 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_runtime1.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime14.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_runtime1.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime14.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_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 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_runtime5.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime4.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_runtime5.JSX.Element;
15
+ }: PromptButtonCarouselWithImageWidgetProps): react_jsx_runtime4.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
4
4
  interface PromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
7
7
  declare const PromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: PromptCarouselWidgetProps): react_jsx_runtime9.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime10.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/PromptCarouselWidget/PromptCarouselWidget.d.ts
4
4
  interface PromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface PromptCarouselWidgetProps {
7
7
  declare const PromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: PromptCarouselWidgetProps): react_jsx_runtime1.JSX.Element;
10
+ }: PromptCarouselWidgetProps): react_jsx_runtime7.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
3
3
  const require_ChatPreviewComparisonWidget = require('../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs');
4
- const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
5
4
  const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
5
+ const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
6
6
  const require_SocialProofWidget = require('../SocialProofWidget/SocialProofWidget.cjs');
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime19 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
4
4
  interface SocialProofFlowWidgetProps {
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
7
7
  declare const SocialProofFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: SocialProofFlowWidgetProps): react_jsx_runtime0.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime19.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/SocialProofFlowWidget/SocialProofFlowWidget.d.ts
4
4
  interface SocialProofFlowWidgetProps {
@@ -7,7 +7,7 @@ interface SocialProofFlowWidgetProps {
7
7
  declare const SocialProofFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: SocialProofFlowWidgetProps): react_jsx_runtime0.JSX.Element;
10
+ }: SocialProofFlowWidgetProps): react_jsx_runtime14.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
2
2
  import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
3
- import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
4
3
  import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
4
+ import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
5
5
  import { SocialProofWidgetWithBaseWidget } from "../SocialProofWidget/SocialProofWidget.js";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
5
5
  declare const SocialProofWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime4.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime17.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface SocialProofWidgetProps {
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
12
12
  declare const SocialProofWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: SocialProofWidgetProps): react_jsx_runtime4.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime17.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_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/SocialProofWidget/SocialProofWidget.d.ts
5
5
  declare const SocialProofWidgetWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime2.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime18.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface SocialProofWidgetProps {
@@ -12,7 +12,7 @@ interface SocialProofWidgetProps {
12
12
  declare const SocialProofWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: SocialProofWidgetProps): react_jsx_runtime2.JSX.Element;
15
+ }: SocialProofWidgetProps): react_jsx_runtime18.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
4
4
  interface TitledPromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
7
7
  declare const TitledPromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TitledPromptCarouselWidgetProps): react_jsx_runtime3.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime16.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TitledPromptCarouselWidget/TitledPromptCarouselWidget.d.ts
4
4
  interface TitledPromptCarouselWidgetProps {
@@ -7,7 +7,7 @@ interface TitledPromptCarouselWidgetProps {
7
7
  declare const TitledPromptCarouselWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TitledPromptCarouselWidgetProps): react_jsx_runtime7.JSX.Element;
10
+ }: TitledPromptCarouselWidgetProps): react_jsx_runtime6.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_ChatPreviewLoadingWidget = require('../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.cjs');
3
3
  const require_ChatPreviewComparisonWidget = require('../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.cjs');
4
- const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
5
4
  const require_useGetWidgetStatus = require('../hooks/useGetWidgetStatus.cjs');
5
+ const require_ChatPreviewWidget = require('../ChatPreviewWidget/ChatPreviewWidget.cjs');
6
6
  const require_TypingAnimationWidget = require('../TypingAnimationWidget/TypingAnimationWidget.cjs');
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let __envive_ai_react_hooks_contexts_typesV3 = require("@envive-ai/react-hooks/contexts/typesV3");
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
4
4
  interface TypingAnimationFlowWidgetProps {
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
7
7
  declare const TypingAnimationFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TypingAnimationFlowWidgetProps): react_jsx_runtime8.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime7.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/widgets/TypingAnimationFlowWidget/TypingAnimationFlowWidget.d.ts
4
4
  interface TypingAnimationFlowWidgetProps {
@@ -7,7 +7,7 @@ interface TypingAnimationFlowWidgetProps {
7
7
  declare const TypingAnimationFlowWidget: {
8
8
  ({
9
9
  widgetConfigId
10
- }: TypingAnimationFlowWidgetProps): react_jsx_runtime0.JSX.Element;
10
+ }: TypingAnimationFlowWidgetProps): react_jsx_runtime3.JSX.Element;
11
11
  displayName: string;
12
12
  };
13
13
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { ChatPreviewLoadingWidgetWithBaseWidget } from "../ChatPreviewLoadingWidget/ChatPreviewLoadingWidget.js";
2
2
  import { ChatPreviewComparisonWidgetWithBaseWidget } from "../ChatPreviewComparisonWidget/ChatPreviewComparisonWidget.js";
3
- import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
4
3
  import useGetWidgetStatus_default from "../hooks/useGetWidgetStatus.js";
4
+ import { ChatPreviewWidgetWithBaseWidget } from "../ChatPreviewWidget/ChatPreviewWidget.js";
5
5
  import { TypingAnimationWithBaseWidget } from "../TypingAnimationWidget/TypingAnimationWidget.js";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { WidgetTypeV3 } from "@envive-ai/react-hooks/contexts/typesV3";
@@ -1,9 +1,9 @@
1
1
  import { BaseWidgetProps } from "../../hocs/withBaseWidget/types.cjs";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
5
5
  declare const TypingAnimationWithBaseWidget: {
6
- (props: BaseWidgetProps): react_jsx_runtime6.JSX.Element;
6
+ (props: BaseWidgetProps): react_jsx_runtime0.JSX.Element;
7
7
  displayName: string;
8
8
  };
9
9
  interface TypingAnimationWidgetProps {
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
12
12
  declare const TypingAnimationWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: TypingAnimationWidgetProps): react_jsx_runtime6.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime0.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_runtime18 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/widgets/TypingAnimationWidget/TypingAnimationWidget.d.ts
5
5
  declare const TypingAnimationWithBaseWidget: {
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 TypingAnimationWidgetProps {
@@ -12,7 +12,7 @@ interface TypingAnimationWidgetProps {
12
12
  declare const TypingAnimationWidget: {
13
13
  ({
14
14
  widgetConfigId
15
- }: TypingAnimationWidgetProps): react_jsx_runtime18.JSX.Element;
15
+ }: TypingAnimationWidgetProps): react_jsx_runtime1.JSX.Element;
16
16
  displayName: string;
17
17
  };
18
18
  //#endregion
@@ -1,8 +1,8 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 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_runtime0.JSX.Element;
5
+ declare const SearchResultsWidget: () => react_jsx_runtime1.JSX.Element;
6
6
  //#endregion
7
7
 
8
8
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-widgets-v3",
3
- "version": "0.3.57",
3
+ "version": "0.3.58",
4
4
  "description": "React widget library v3 for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -1,12 +1,13 @@
1
- import { render, screen, waitFor } from '@testing-library/react';
1
+ import { act, render, screen, waitFor } from '@testing-library/react';
2
2
  import { RefObject } from 'react';
3
3
  import { HardcopyResponse } from '@envive-ai/react-hooks/contexts/hardcopyContext';
4
4
  import { WidgetTypeV3 } from '@envive-ai/react-hooks/contexts/typesV3';
5
5
  import { UserEvent, UserEventCategory } from '@spiffy-ai/commerce-api-client';
6
6
  import { BaseWidgetProps } from '../types';
7
- import { withBaseWidget } from '../withBaseWidget';
7
+ import { WIDGET_LOADING_WATCHDOG_MS, withBaseWidget } from '../withBaseWidget';
8
8
 
9
9
  // Mock the contexts
10
+ const { mockLogError } = vi.hoisted(() => ({ mockLogError: vi.fn() }));
10
11
  const mockTrackEvent = vi.fn();
11
12
  const mockGetHardcopy = vi.fn();
12
13
  const mockGetWidgetConfig = vi.fn();
@@ -29,6 +30,18 @@ vi.mock('@envive-ai/react-hooks/contexts/amplitudeContext', () => ({
29
30
  },
30
31
  }));
31
32
 
33
+ vi.mock('@envive-ai/react-hooks/application/logging', () => ({
34
+ default: class MockLogger {
35
+ logError = mockLogError;
36
+
37
+ logWarn = vi.fn();
38
+
39
+ logInfo = vi.fn();
40
+
41
+ logDebug = vi.fn();
42
+ },
43
+ }));
44
+
32
45
  vi.mock('@envive-ai/react-hooks/contexts/hardcopyContext', () => ({
33
46
  useHardcopy: () => ({
34
47
  getHardcopy: mockGetHardcopy,
@@ -469,6 +482,67 @@ describe('withBaseWidget', () => {
469
482
  expect(screen.getByTestId('hardcopy-content')).toBeInTheDocument();
470
483
  });
471
484
 
485
+ it('logs a watchdog error when the widget is still loading after the timeout', async () => {
486
+ vi.useFakeTimers();
487
+ try {
488
+ // Hardcopy never settles — the widget stays in its loading state
489
+ mockGetHardcopy.mockReturnValue(new Promise<HardcopyResponse>(() => {}));
490
+
491
+ const WrappedWidget = withBaseWidget(TestWidget);
492
+ render(
493
+ <WrappedWidget
494
+ widgetConfigId="test-config-watchdog"
495
+ widgetType={WidgetTypeV3.PromptCarouselV3}
496
+ />,
497
+ );
498
+
499
+ // Let the config fetches settle first so only hardcopy is still pending
500
+ await act(async () => {
501
+ await vi.advanceTimersByTimeAsync(0);
502
+ });
503
+ await act(async () => {
504
+ await vi.advanceTimersByTimeAsync(WIDGET_LOADING_WATCHDOG_MS);
505
+ });
506
+
507
+ expect(mockLogError).toHaveBeenCalledTimes(1);
508
+ const [message, , context] = mockLogError.mock.calls[0];
509
+ expect(message).toContain('still loading');
510
+ expect(context).toMatchObject({
511
+ widget_type: WidgetTypeV3.PromptCarouselV3,
512
+ widget_config_id: 'test-config-watchdog',
513
+ pending_requests: ['hardcopy'],
514
+ });
515
+ } finally {
516
+ vi.useRealTimers();
517
+ }
518
+ });
519
+
520
+ it('does not log a watchdog error when the widget settles before the timeout', async () => {
521
+ vi.useFakeTimers();
522
+ try {
523
+ const WrappedWidget = withBaseWidget(TestWidget);
524
+ render(
525
+ <WrappedWidget
526
+ widgetConfigId="test-config-watchdog-ok"
527
+ widgetType={WidgetTypeV3.PromptCarouselV3}
528
+ />,
529
+ );
530
+
531
+ // Let the mocked fetches resolve, then run past the watchdog deadline
532
+ await act(async () => {
533
+ await vi.advanceTimersByTimeAsync(0);
534
+ });
535
+ expect(screen.getByTestId('is-loading')).toHaveTextContent('false');
536
+ await act(async () => {
537
+ await vi.advanceTimersByTimeAsync(WIDGET_LOADING_WATCHDOG_MS * 2);
538
+ });
539
+
540
+ expect(mockLogError).not.toHaveBeenCalled();
541
+ } finally {
542
+ vi.useRealTimers();
543
+ }
544
+ });
545
+
472
546
  it('still settles and stops loading when its own requests fail', async () => {
473
547
  mockHardcopyLoading = true;
474
548
  mockGetHardcopy.mockRejectedValue(new Error('Failed to fetch hardcopy'));
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useMemo, useRef, useState } from 'react';
2
2
 
3
+ import Logger from '@envive-ai/react-hooks/application/logging';
3
4
  import { useAmplitude } from '@envive-ai/react-hooks/contexts/amplitudeContext';
4
5
  import { useTrackComponentVisibleEvent } from '@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent';
5
6
  import { HardcopyResponse, useHardcopy } from '@envive-ai/react-hooks/contexts/hardcopyContext';
@@ -9,6 +10,12 @@ import { OrgUIConfigV3, WidgetConfigV3 } from '@envive-ai/react-hooks/contexts/t
9
10
  import { useUiConfig } from '@envive-ai/react-hooks/contexts/uiConfigContext';
10
11
  import { BaseWidgetProps, WithBaseWidgetOptions } from './types';
11
12
 
13
+ const logger = new Logger('withBaseWidget');
14
+
15
+ // How long a widget may stay in its loading state after it starts fetching before we
16
+ // consider it stuck and log an error for external session tools to pick up.
17
+ export const WIDGET_LOADING_WATCHDOG_MS = 5000;
18
+
12
19
  export function withBaseWidget<P extends BaseWidgetProps>(
13
20
  Widget: React.ComponentType<P>,
14
21
  options?: WithBaseWidgetOptions,
@@ -67,6 +74,41 @@ export function withBaseWidget<P extends BaseWidgetProps>(
67
74
  return isVisible && !!widgetConfigId && !!widgetType;
68
75
  }, [isVisible, widgetConfigId, widgetType]);
69
76
 
77
+ // Watchdog: a widget that is still in its loading state this long after it started
78
+ // fetching is stuck (or on a very slow connection). Log a console error so session
79
+ // tools that capture the console (Quantum Metric, Datadog RUM) can count and segment
80
+ // these sessions. Mirror the settled flags through a ref so mid-flight settles don't
81
+ // restart the timer, while the log still reports which requests were pending.
82
+ const settledStateRef = useRef({ hardcopy: false, widgetConfig: false, uiConfig: false });
83
+ settledStateRef.current = {
84
+ hardcopy: hardcopySettled,
85
+ widgetConfig: widgetConfigSettled,
86
+ uiConfig: uiConfigSettled,
87
+ };
88
+ useEffect(() => {
89
+ if (!startLoading || ownRequestsSettled) {
90
+ return undefined;
91
+ }
92
+ const timer = setTimeout(() => {
93
+ const settled = settledStateRef.current;
94
+ logger.logError(
95
+ `Widget still loading ${WIDGET_LOADING_WATCHDOG_MS}ms after fetches started`,
96
+ undefined,
97
+ {
98
+ widget_type: widgetType,
99
+ widget_config_id: widgetConfigId,
100
+ pending_requests: Object.entries(settled)
101
+ .filter(([, isSettled]) => !isSettled)
102
+ .map(([name]) => name),
103
+ // Network Information API — Chromium/Android only, undefined on Safari
104
+ connection_type: (navigator as Navigator & { connection?: { effectiveType?: string } })
105
+ .connection?.effectiveType,
106
+ },
107
+ );
108
+ }, WIDGET_LOADING_WATCHDOG_MS);
109
+ return () => clearTimeout(timer);
110
+ }, [startLoading, ownRequestsSettled, widgetConfigId, widgetType]);
111
+
70
112
  useEffect(() => {
71
113
  if (!startLoading || hardcopyFetchedRef.current) {
72
114
  return;