@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.
- package/dist/application/commerce-api.cjs +4 -28
- package/dist/application/commerce-api.d.cts +1 -3
- package/dist/application/commerce-api.d.ts +1 -3
- package/dist/application/commerce-api.js +4 -28
- package/dist/application/utils/analyticsUtils.cjs +5 -5
- package/dist/application/utils/analyticsUtils.d.cts +2 -2
- package/dist/application/utils/analyticsUtils.d.ts +2 -2
- package/dist/application/utils/analyticsUtils.js +3 -3
- package/dist/atoms/app/index.d.cts +7 -7
- package/dist/atoms/app/index.d.ts +7 -7
- package/dist/atoms/chat/chatState.cjs +5 -5
- package/dist/atoms/chat/chatState.d.cts +19 -19
- package/dist/atoms/chat/chatState.d.ts +19 -19
- package/dist/atoms/chat/chatState.js +3 -3
- package/dist/atoms/chat/form.d.cts +2 -2
- package/dist/atoms/chat/form.d.ts +2 -2
- package/dist/atoms/chat/index.d.cts +2 -2
- package/dist/atoms/chat/lastMessage.d.cts +2 -2
- package/dist/atoms/chat/lastMessage.d.ts +2 -2
- package/dist/atoms/chat/messageQueue.d.cts +6 -6
- package/dist/atoms/chat/messageQueue.d.ts +6 -6
- package/dist/atoms/chat/performanceMetrics.d.cts +6 -6
- package/dist/atoms/chat/performanceMetrics.d.ts +6 -6
- package/dist/atoms/chat/renderedWidgetRefs.d.cts +2 -2
- package/dist/atoms/chat/renderedWidgetRefs.d.ts +2 -2
- package/dist/atoms/chat/replies.cjs +4 -4
- package/dist/atoms/chat/replies.d.cts +3 -3
- package/dist/atoms/chat/replies.d.ts +1 -1
- package/dist/atoms/chat/replies.js +3 -3
- package/dist/atoms/chat/suggestions.d.cts +2 -2
- package/dist/atoms/chat/suggestions.d.ts +2 -2
- package/dist/atoms/envive/enviveConfig.d.cts +13 -13
- package/dist/atoms/envive/enviveConfig.d.ts +1 -1
- package/dist/atoms/globalSearch/globalSearch.d.cts +5 -5
- package/dist/atoms/globalSearch/globalSearch.d.ts +5 -5
- package/dist/atoms/org/customerService.d.cts +6 -6
- package/dist/atoms/org/customerService.d.ts +6 -6
- package/dist/atoms/org/graphqlConfig.d.cts +4 -4
- package/dist/atoms/org/graphqlConfig.d.ts +4 -4
- package/dist/atoms/org/index.cjs +1 -1
- package/dist/atoms/org/index.js +1 -1
- package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
- package/dist/atoms/org/orgAnalyticsConfig.d.cts +5 -5
- package/dist/atoms/search/chatSearch.d.cts +17 -17
- package/dist/atoms/search/chatSearch.d.ts +17 -17
- package/dist/atoms/search/searchAPI.d.cts +13 -13
- package/dist/atoms/search/searchAPI.d.ts +13 -13
- package/dist/atoms/search/types.d.cts +1 -1
- package/dist/atoms/search/utils.d.cts +1 -1
- package/dist/atoms/search/utils.d.ts +1 -1
- package/dist/atoms/widget/chatPreviewLoading.d.cts +2 -2
- package/dist/atoms/widget/chatPreviewLoading.d.ts +2 -2
- package/dist/config/locators/components/search/index.d.cts +1 -1
- package/dist/contexts/amplitudeContext/amplitudeContext.cjs +5 -4
- package/dist/contexts/amplitudeContext/amplitudeContext.d.cts +3 -2
- package/dist/contexts/amplitudeContext/amplitudeContext.d.ts +3 -2
- package/dist/contexts/amplitudeContext/amplitudeContext.js +5 -4
- package/dist/contexts/amplitudeContext/index.cjs +3 -3
- package/dist/contexts/amplitudeContext/index.d.cts +1 -1
- package/dist/contexts/amplitudeContext/index.d.ts +1 -1
- package/dist/contexts/amplitudeContext/index.js +1 -1
- package/dist/contexts/cdnContext/cdnContext.cjs +1 -1
- package/dist/contexts/cdnContext/cdnContext.js +1 -1
- package/dist/contexts/enviveConfigContext/enviveConfigContext.cjs +1 -1
- package/dist/contexts/enviveConfigContext/enviveConfigContext.js +1 -1
- package/dist/contexts/enviveContext/types.d.cts +1 -1
- package/dist/contexts/graphqlContext/graphqlContext.cjs +2 -2
- package/dist/contexts/graphqlContext/graphqlContext.js +2 -2
- package/dist/contexts/graphqlContext/mockV3Config.cjs +3 -2
- package/dist/contexts/graphqlContext/mockV3Config.js +3 -2
- package/dist/contexts/hardcopyContext/hardcopyContext.cjs +9 -8
- package/dist/contexts/hardcopyContext/hardcopyContext.js +7 -6
- package/dist/contexts/newOrgConfigContext/newOrgConfigContext.cjs +1 -1
- package/dist/contexts/newOrgConfigContext/newOrgConfigContext.js +1 -1
- package/dist/contexts/pageContext/pageContext.cjs +1 -1
- package/dist/contexts/pageContext/pageContext.js +1 -1
- package/dist/contexts/salesAgentContext/chatAPI.cjs +11 -10
- package/dist/contexts/salesAgentContext/chatAPI.js +4 -3
- package/dist/contexts/salesAgentContext/salesAgentContext.cjs +1 -1
- package/dist/contexts/salesAgentContext/salesAgentContext.js +1 -1
- package/dist/contexts/salesAgentContext/salesAgentService.cjs +9 -8
- package/dist/contexts/salesAgentContext/salesAgentService.js +7 -6
- package/dist/contexts/searchContext/searchContext.cjs +2 -2
- package/dist/contexts/searchContext/searchContext.js +2 -2
- package/dist/contexts/systemSettingsContext/systemSettingsContext.cjs +1 -1
- package/dist/contexts/systemSettingsContext/systemSettingsContext.js +1 -1
- package/dist/contexts/types.d.cts +1 -1
- package/dist/contexts/types.d.ts +1 -1
- package/dist/contexts/typesV3.cjs +1 -1
- package/dist/contexts/typesV3.d.cts +10 -1
- package/dist/contexts/typesV3.d.ts +10 -1
- package/dist/contexts/typesV3.js +1 -1
- package/dist/contexts/userIdentityContext/userIdentityContext.cjs +2 -34
- package/dist/contexts/userIdentityContext/userIdentityContext.d.cts +1 -2
- package/dist/contexts/userIdentityContext/userIdentityContext.d.ts +1 -2
- package/dist/contexts/userIdentityContext/userIdentityContext.js +2 -33
- package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.cjs +1 -1
- package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.d.cts +2 -2
- package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.d.ts +2 -2
- package/dist/hooks/AmplitudeOperations/useAmplitudeOperations.js +1 -1
- package/dist/hooks/ChatToggle/useChatToggle.cjs +6 -5
- package/dist/hooks/ChatToggle/useChatToggle.js +4 -3
- package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.cts +2 -2
- package/dist/hooks/Search/useSearch.cjs +9 -8
- package/dist/hooks/Search/useSearch.js +4 -3
- package/dist/hooks/Search/useSearchInput.cjs +6 -6
- package/dist/hooks/Search/useSearchInput.js +3 -3
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.cjs +6 -5
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.d.cts +2 -2
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.d.ts +2 -2
- package/dist/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.js +3 -2
- package/dist/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.cjs +4 -3
- package/dist/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.js +3 -2
- package/dist/hooks/utils.d.cts +1 -1
- package/dist/hooks/utils.d.ts +1 -1
- package/dist/services/amplitudeService/amplitudeService.cjs +17 -57
- package/dist/services/amplitudeService/amplitudeService.d.cts +4 -47
- package/dist/services/amplitudeService/amplitudeService.d.ts +4 -47
- package/dist/services/amplitudeService/amplitudeService.js +14 -52
- package/dist/services/amplitudeService/eventNames.cjs +59 -0
- package/dist/services/amplitudeService/eventNames.d.cts +54 -0
- package/dist/services/amplitudeService/eventNames.d.ts +54 -0
- package/dist/services/amplitudeService/eventNames.js +57 -0
- package/dist/services/amplitudeService/index.cjs +3 -2
- package/dist/services/amplitudeService/index.d.cts +2 -1
- package/dist/services/amplitudeService/index.d.ts +2 -1
- package/dist/services/amplitudeService/index.js +2 -1
- package/dist/services/ga4ProjectionService/ga4EventSchema.cjs +108 -0
- package/dist/services/ga4ProjectionService/ga4EventSchema.js +108 -0
- package/dist/services/ga4ProjectionService/ga4ProjectionService.cjs +71 -0
- package/dist/services/ga4ProjectionService/ga4ProjectionService.js +71 -0
- package/dist/types/customerService.cjs +2 -1
- package/dist/types/customerService.d.cts +2 -1
- package/dist/types/customerService.d.ts +2 -1
- package/dist/types/customerService.js +2 -1
- package/package.json +1 -6
- package/src/application/commerce-api.ts +0 -29
- package/src/application/utils/analyticsUtils.ts +1 -1
- package/src/atoms/chat/chatState.ts +1 -1
- package/src/atoms/chat/replies.ts +1 -1
- package/src/contexts/graphqlContext/mockV3Config.ts +3 -0
- package/src/contexts/salesAgentContext/salesAgentService.ts +5 -2
- package/src/contexts/typesV3.ts +10 -0
- package/src/contexts/userIdentityContext/__tests__/userIdentityContext.test.tsx +1 -66
- package/src/contexts/userIdentityContext/userIdentityContext.tsx +0 -47
- package/src/hooks/AmplitudeOperations/useAmplitudeOperations.ts +2 -4
- package/src/hooks/ChatToggle/useChatToggle.ts +2 -4
- package/src/hooks/Search/useSearch.tsx +2 -4
- package/src/hooks/Search/useSearchInput.ts +1 -1
- package/src/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.ts +2 -4
- package/src/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.ts +2 -4
- package/src/services/amplitudeService/amplitudeService.ts +14 -50
- package/src/services/amplitudeService/eventNames.ts +52 -0
- package/src/services/ga4ProjectionService/__tests__/ga4ProjectionService.test.ts +334 -0
- package/src/services/ga4ProjectionService/ga4EventSchema.ts +143 -0
- package/src/services/ga4ProjectionService/ga4ProjectionService.ts +137 -0
- package/src/types/customerService.ts +1 -0
- package/dist/hooks/IdentifyUser/index.cjs +0 -3
- package/dist/hooks/IdentifyUser/index.d.cts +0 -2
- package/dist/hooks/IdentifyUser/index.d.ts +0 -2
- package/dist/hooks/IdentifyUser/index.js +0 -3
- package/dist/hooks/IdentifyUser/useIdentifyUser.cjs +0 -35
- package/dist/hooks/IdentifyUser/useIdentifyUser.d.cts +0 -10
- package/dist/hooks/IdentifyUser/useIdentifyUser.d.ts +0 -10
- package/dist/hooks/IdentifyUser/useIdentifyUser.js +0 -34
- package/src/hooks/IdentifyUser/index.ts +0 -1
- 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlSWRlbnRpZnlVc2VyLmpzIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ob29rcy9JZGVudGlmeVVzZXIvdXNlSWRlbnRpZnlVc2VyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUNhbGxiYWNrLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IHVzZVVzZXJJZGVudGl0eSB9IGZyb20gJ3NyYy9jb250ZXh0cy91c2VySWRlbnRpdHlDb250ZXh0L3VzZXJJZGVudGl0eUNvbnRleHQnO1xuXG5leHBvcnQgY29uc3QgdXNlSWRlbnRpZnlVc2VyID0gKCkgPT4ge1xuICBjb25zdCB7IGlkZW50aWZ5VXNlciwgaXNSZWFkeSB9ID0gdXNlVXNlcklkZW50aXR5KCk7XG4gIGNvbnN0IFtsb2FkaW5nLCBzZXRMb2FkaW5nXSA9IHVzZVN0YXRlKGZhbHNlKTtcbiAg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Q1osNkJBQVMsSUFBSSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3JEOztBQUdGLGNBQVcsS0FBSztBQUNoQixZQUFTLEtBQUs7QUFFZCxPQUFJO0FBQ0YsVUFBTSxjQUFjO1lBQ2IsS0FBSztBQUNaLGFBQVMsZUFBZSxRQUFRLHNCQUFNLElBQUksTUFBTSw0Q0FBNEMsQ0FBQztBQUM3RixVQUFNO2FBQ0U7QUFDUixlQUFXLE1BQU07O0tBRWxCLENBQUMsY0FBYyxRQUFRLENBQUM7RUFFbUI7RUFBUyJ9
|
|
@@ -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
|
-
};
|