@envive-ai/react-hooks 0.3.12 → 0.3.13

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 (167) hide show
  1. package/dist/application/commerce-api.cjs +4 -28
  2. package/dist/application/commerce-api.d.cts +1 -3
  3. package/dist/application/commerce-api.d.ts +1 -3
  4. package/dist/application/commerce-api.js +4 -28
  5. package/dist/application/utils/analyticsUtils.cjs +5 -5
  6. package/dist/application/utils/analyticsUtils.d.cts +2 -2
  7. package/dist/application/utils/analyticsUtils.d.ts +2 -2
  8. package/dist/application/utils/analyticsUtils.js +3 -3
  9. package/dist/atoms/app/index.d.cts +7 -7
  10. package/dist/atoms/app/index.d.ts +7 -7
  11. package/dist/atoms/chat/chatState.cjs +5 -5
  12. package/dist/atoms/chat/chatState.d.cts +19 -19
  13. package/dist/atoms/chat/chatState.d.ts +19 -19
  14. package/dist/atoms/chat/chatState.js +3 -3
  15. package/dist/atoms/chat/form.d.cts +2 -2
  16. package/dist/atoms/chat/form.d.ts +2 -2
  17. package/dist/atoms/chat/index.d.cts +2 -2
  18. package/dist/atoms/chat/lastMessage.d.cts +2 -2
  19. package/dist/atoms/chat/lastMessage.d.ts +2 -2
  20. package/dist/atoms/chat/messageQueue.d.cts +6 -6
  21. package/dist/atoms/chat/messageQueue.d.ts +6 -6
  22. package/dist/atoms/chat/performanceMetrics.d.cts +6 -6
  23. package/dist/atoms/chat/performanceMetrics.d.ts +6 -6
  24. package/dist/atoms/chat/renderedWidgetRefs.d.cts +2 -2
  25. package/dist/atoms/chat/renderedWidgetRefs.d.ts +2 -2
  26. package/dist/atoms/chat/replies.cjs +4 -4
  27. package/dist/atoms/chat/replies.d.cts +3 -3
  28. package/dist/atoms/chat/replies.d.ts +1 -1
  29. package/dist/atoms/chat/replies.js +3 -3
  30. package/dist/atoms/chat/suggestions.d.cts +2 -2
  31. package/dist/atoms/chat/suggestions.d.ts +2 -2
  32. package/dist/atoms/envive/enviveConfig.d.cts +13 -13
  33. package/dist/atoms/envive/enviveConfig.d.ts +1 -1
  34. package/dist/atoms/globalSearch/globalSearch.d.cts +5 -5
  35. package/dist/atoms/globalSearch/globalSearch.d.ts +5 -5
  36. package/dist/atoms/org/customerService.d.cts +6 -6
  37. package/dist/atoms/org/customerService.d.ts +6 -6
  38. package/dist/atoms/org/graphqlConfig.d.cts +4 -4
  39. package/dist/atoms/org/graphqlConfig.d.ts +4 -4
  40. package/dist/atoms/org/index.cjs +1 -1
  41. package/dist/atoms/org/index.js +1 -1
  42. package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
  43. package/dist/atoms/org/orgAnalyticsConfig.d.cts +5 -5
  44. package/dist/atoms/search/chatSearch.d.cts +17 -17
  45. package/dist/atoms/search/chatSearch.d.ts +17 -17
  46. package/dist/atoms/search/searchAPI.d.cts +13 -13
  47. package/dist/atoms/search/searchAPI.d.ts +13 -13
  48. package/dist/atoms/search/types.d.cts +1 -1
  49. package/dist/atoms/search/utils.d.cts +1 -1
  50. package/dist/atoms/search/utils.d.ts +1 -1
  51. package/dist/atoms/widget/chatPreviewLoading.d.cts +2 -2
  52. package/dist/atoms/widget/chatPreviewLoading.d.ts +2 -2
  53. package/dist/config/locators/components/search/index.d.cts +1 -1
  54. package/dist/contexts/amplitudeContext/amplitudeContext.cjs +5 -4
  55. package/dist/contexts/amplitudeContext/amplitudeContext.d.cts +3 -2
  56. package/dist/contexts/amplitudeContext/amplitudeContext.d.ts +3 -2
  57. package/dist/contexts/amplitudeContext/amplitudeContext.js +5 -4
  58. package/dist/contexts/amplitudeContext/index.cjs +3 -3
  59. package/dist/contexts/amplitudeContext/index.d.cts +1 -1
  60. package/dist/contexts/amplitudeContext/index.d.ts +1 -1
  61. package/dist/contexts/amplitudeContext/index.js +1 -1
  62. package/dist/contexts/cdnContext/cdnContext.cjs +1 -1
  63. package/dist/contexts/cdnContext/cdnContext.js +1 -1
  64. package/dist/contexts/enviveConfigContext/enviveConfigContext.cjs +1 -1
  65. package/dist/contexts/enviveConfigContext/enviveConfigContext.js +1 -1
  66. package/dist/contexts/enviveContext/types.d.cts +1 -1
  67. package/dist/contexts/graphqlContext/graphqlContext.cjs +2 -2
  68. package/dist/contexts/graphqlContext/graphqlContext.js +2 -2
  69. package/dist/contexts/graphqlContext/mockV3Config.cjs +3 -2
  70. package/dist/contexts/graphqlContext/mockV3Config.js +3 -2
  71. package/dist/contexts/hardcopyContext/hardcopyContext.cjs +9 -8
  72. package/dist/contexts/hardcopyContext/hardcopyContext.js +7 -6
  73. package/dist/contexts/newOrgConfigContext/newOrgConfigContext.cjs +1 -1
  74. package/dist/contexts/newOrgConfigContext/newOrgConfigContext.js +1 -1
  75. package/dist/contexts/pageContext/pageContext.cjs +1 -1
  76. package/dist/contexts/pageContext/pageContext.js +1 -1
  77. package/dist/contexts/salesAgentContext/chatAPI.cjs +11 -10
  78. package/dist/contexts/salesAgentContext/chatAPI.js +4 -3
  79. package/dist/contexts/salesAgentContext/salesAgentContext.cjs +1 -1
  80. package/dist/contexts/salesAgentContext/salesAgentContext.js +1 -1
  81. package/dist/contexts/salesAgentContext/salesAgentService.cjs +9 -8
  82. package/dist/contexts/salesAgentContext/salesAgentService.js +7 -6
  83. package/dist/contexts/searchContext/searchContext.cjs +2 -2
  84. package/dist/contexts/searchContext/searchContext.js +2 -2
  85. package/dist/contexts/systemSettingsContext/systemSettingsContext.cjs +1 -1
  86. package/dist/contexts/systemSettingsContext/systemSettingsContext.js +1 -1
  87. package/dist/contexts/types.d.cts +1 -1
  88. package/dist/contexts/types.d.ts +1 -1
  89. package/dist/contexts/typesV3.cjs +1 -1
  90. package/dist/contexts/typesV3.d.cts +10 -1
  91. package/dist/contexts/typesV3.d.ts +10 -1
  92. package/dist/contexts/typesV3.js +1 -1
  93. package/dist/contexts/userIdentityContext/userIdentityContext.cjs +2 -34
  94. package/dist/contexts/userIdentityContext/userIdentityContext.d.cts +1 -2
  95. package/dist/contexts/userIdentityContext/userIdentityContext.d.ts +1 -2
  96. package/dist/contexts/userIdentityContext/userIdentityContext.js +2 -33
  97. package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.cjs +1 -1
  98. package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.d.cts +2 -2
  99. package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.d.ts +2 -2
  100. package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.js +1 -1
  101. package/dist/hooks/ChatToggle/useChatToggle.cjs +6 -5
  102. package/dist/hooks/ChatToggle/useChatToggle.js +4 -3
  103. package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.cts +2 -2
  104. package/dist/hooks/Search/useSearch.cjs +9 -8
  105. package/dist/hooks/Search/useSearch.js +4 -3
  106. package/dist/hooks/Search/useSearchInput.cjs +6 -6
  107. package/dist/hooks/Search/useSearchInput.js +3 -3
  108. package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.cjs +6 -5
  109. package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.d.cts +2 -2
  110. package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.d.ts +2 -2
  111. package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.js +3 -2
  112. package/dist/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.cjs +4 -3
  113. package/dist/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.js +3 -2
  114. package/dist/hooks/utils.d.cts +1 -1
  115. package/dist/hooks/utils.d.ts +1 -1
  116. package/dist/services/amplitudeService/amplitudeService.cjs +17 -57
  117. package/dist/services/amplitudeService/amplitudeService.d.cts +4 -47
  118. package/dist/services/amplitudeService/amplitudeService.d.ts +4 -47
  119. package/dist/services/amplitudeService/amplitudeService.js +14 -52
  120. package/dist/services/amplitudeService/eventNames.cjs +59 -0
  121. package/dist/services/amplitudeService/eventNames.d.cts +54 -0
  122. package/dist/services/amplitudeService/eventNames.d.ts +54 -0
  123. package/dist/services/amplitudeService/eventNames.js +57 -0
  124. package/dist/services/amplitudeService/index.cjs +3 -2
  125. package/dist/services/amplitudeService/index.d.cts +2 -1
  126. package/dist/services/amplitudeService/index.d.ts +2 -1
  127. package/dist/services/amplitudeService/index.js +2 -1
  128. package/dist/services/ga4ProjectionService/ga4EventSchema.cjs +108 -0
  129. package/dist/services/ga4ProjectionService/ga4EventSchema.js +108 -0
  130. package/dist/services/ga4ProjectionService/ga4ProjectionService.cjs +71 -0
  131. package/dist/services/ga4ProjectionService/ga4ProjectionService.js +71 -0
  132. package/dist/types/customerService.cjs +2 -1
  133. package/dist/types/customerService.d.cts +2 -1
  134. package/dist/types/customerService.d.ts +2 -1
  135. package/dist/types/customerService.js +2 -1
  136. package/package.json +1 -6
  137. package/src/application/commerce-api.ts +0 -29
  138. package/src/application/utils/analyticsUtils.ts +1 -1
  139. package/src/atoms/chat/chatState.ts +1 -1
  140. package/src/atoms/chat/replies.ts +1 -1
  141. package/src/contexts/graphqlContext/mockV3Config.ts +3 -0
  142. package/src/contexts/salesAgentContext/salesAgentService.ts +5 -2
  143. package/src/contexts/typesV3.ts +10 -0
  144. package/src/contexts/userIdentityContext/__tests__/userIdentityContext.test.tsx +1 -66
  145. package/src/contexts/userIdentityContext/userIdentityContext.tsx +0 -47
  146. package/src/hooks/AmplitudeOperations/useAmplitudeOperations.ts +2 -4
  147. package/src/hooks/ChatToggle/useChatToggle.ts +2 -4
  148. package/src/hooks/Search/useSearch.tsx +2 -4
  149. package/src/hooks/Search/useSearchInput.ts +1 -1
  150. package/src/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.ts +2 -4
  151. package/src/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.ts +2 -4
  152. package/src/services/amplitudeService/amplitudeService.ts +14 -50
  153. package/src/services/amplitudeService/eventNames.ts +52 -0
  154. package/src/services/ga4ProjectionService/__tests__/ga4ProjectionService.test.ts +334 -0
  155. package/src/services/ga4ProjectionService/ga4EventSchema.ts +143 -0
  156. package/src/services/ga4ProjectionService/ga4ProjectionService.ts +137 -0
  157. package/src/types/customerService.ts +1 -0
  158. package/dist/hooks/IdentifyUser/index.cjs +0 -3
  159. package/dist/hooks/IdentifyUser/index.d.cts +0 -2
  160. package/dist/hooks/IdentifyUser/index.d.ts +0 -2
  161. package/dist/hooks/IdentifyUser/index.js +0 -3
  162. package/dist/hooks/IdentifyUser/useIdentifyUser.cjs +0 -35
  163. package/dist/hooks/IdentifyUser/useIdentifyUser.d.cts +0 -10
  164. package/dist/hooks/IdentifyUser/useIdentifyUser.d.ts +0 -10
  165. package/dist/hooks/IdentifyUser/useIdentifyUser.js +0 -34
  166. package/src/hooks/IdentifyUser/index.ts +0 -1
  167. package/src/hooks/IdentifyUser/useIdentifyUser.ts +0 -29
@@ -1,10 +0,0 @@
1
- //#region src/hooks/IdentifyUser/useIdentifyUser.d.ts
2
- declare const useIdentifyUser: () => {
3
- loading: boolean;
4
- error: Error | null;
5
- executeIdentifyUser: () => Promise<void>;
6
- isReady: boolean;
7
- };
8
- //#endregion
9
- export { useIdentifyUser };
10
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlSWRlbnRpZnlVc2VyLmQudHMiLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2hvb2tzL0lkZW50aWZ5VXNlci91c2VJZGVudGlmeVVzZXIuZC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVjbGFyZSBjb25zdCB1c2VJZGVudGlmeVVzZXI6ICgpID0+IHtcbiAgICBsb2FkaW5nOiBib29sZWFuO1xuICAgIGVycm9yOiBFcnJvciB8IG51bGw7XG4gICAgZXhlY3V0ZUlkZW50aWZ5VXNlcjogKCkgPT4gUHJvbWlzZTx2b2lkPjtcbiAgICBpc1JlYWR5OiBib29sZWFuO1xufTtcbiJdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVcsa0JBQWtCO0NBQUM7T0FBVztPQUFHO0NBQUEifQ==
@@ -1,34 +0,0 @@
1
- import { useUserIdentity } from "../../contexts/userIdentityContext/userIdentityContext.js";
2
- import { useCallback, useState } from "react";
3
-
4
- //#region src/hooks/IdentifyUser/useIdentifyUser.ts
5
- const useIdentifyUser = () => {
6
- const { identifyUser, isReady } = useUserIdentity();
7
- const [loading, setLoading] = useState(false);
8
- const [error, setError] = useState(null);
9
- return {
10
- loading,
11
- error,
12
- executeIdentifyUser: useCallback(async () => {
13
- if (!isReady) {
14
- setError(/* @__PURE__ */ new Error("UserIdentityContext not ready."));
15
- return;
16
- }
17
- setLoading(true);
18
- setError(null);
19
- try {
20
- await identifyUser();
21
- } catch (err) {
22
- setError(err instanceof Error ? err : /* @__PURE__ */ new Error("Unknown error during user identification."));
23
- throw err;
24
- } finally {
25
- setLoading(false);
26
- }
27
- }, [identifyUser, isReady]),
28
- isReady
29
- };
30
- };
31
-
32
- //#endregion
33
- export { useIdentifyUser };
34
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlSWRlbnRpZnlVc2VyLmpzIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ob29rcy9JZGVudGlmeVVzZXIvdXNlSWRlbnRpZnlVc2VyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUNhbGxiYWNrLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IHVzZVVzZXJJZGVudGl0eSB9IGZyb20gJ3NyYy9jb250ZXh0cy91c2VySWRlbnRpdHlDb250ZXh0L3VzZXJJZGVudGl0eUNvbnRleHQnO1xuXG5leHBvcnQgY29uc3QgdXNlSWRlbnRpZnlVc2VyID0gKCkgPT4ge1xuICBjb25zdCB7IGlkZW50aWZ5VXNlciwgaXNSZWFkeSB9ID0gdXNlVXNlcklkZW50aXR5KCk7XG4gIGNvbnN0IFtsb2FkaW5nLCBzZXRMb2FkaW5nXSA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BQ2xELE9BQUksQ0FBQyxTQUFTO0FBQ1osNkJBQVMsSUFBSSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3JEOztBQUdGLGNBQVcsS0FBSztBQUNoQixZQUFTLEtBQUs7QUFFZCxPQUFJO0FBQ0YsVUFBTSxjQUFjO1lBQ2IsS0FBSztBQUNaLGFBQVMsZUFBZSxRQUFRLHNCQUFNLElBQUksTUFBTSw0Q0FBNEMsQ0FBQztBQUM3RixVQUFNO2FBQ0U7QUFDUixlQUFXLE1BQU07O0tBRWxCLENBQUMsY0FBYyxRQUFRLENBQUM7RUFFbUI7RUFBUyJ9
@@ -1 +0,0 @@
1
- export * from './useIdentifyUser';
@@ -1,29 +0,0 @@
1
- import { useCallback, useState } from 'react';
2
- import { useUserIdentity } from 'src/contexts/userIdentityContext/userIdentityContext';
3
-
4
- export const useIdentifyUser = () => {
5
- const { identifyUser, isReady } = useUserIdentity();
6
- const [loading, setLoading] = useState(false);
7
- const [error, setError] = useState<Error | null>(null);
8
-
9
- const executeIdentifyUser = useCallback(async () => {
10
- if (!isReady) {
11
- setError(new Error('UserIdentityContext not ready.'));
12
- return;
13
- }
14
-
15
- setLoading(true);
16
- setError(null);
17
-
18
- try {
19
- await identifyUser();
20
- } catch (err) {
21
- setError(err instanceof Error ? err : new Error('Unknown error during user identification.'));
22
- throw err;
23
- } finally {
24
- setLoading(false);
25
- }
26
- }, [identifyUser, isReady]);
27
-
28
- return { loading, error, executeIdentifyUser, isReady };
29
- };