@envive-ai/react-hooks 0.3.23 → 0.3.24

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 (53) hide show
  1. package/dist/atoms/app/index.d.cts +7 -7
  2. package/dist/atoms/app/index.d.ts +7 -7
  3. package/dist/atoms/app/variant.d.cts +6 -6
  4. package/dist/atoms/chat/chatState.cjs +2 -2
  5. package/dist/atoms/chat/chatState.d.cts +20 -20
  6. package/dist/atoms/chat/chatState.d.ts +20 -20
  7. package/dist/atoms/chat/chatState.js +2 -2
  8. package/dist/atoms/chat/form.d.cts +3 -3
  9. package/dist/atoms/chat/form.d.ts +2 -2
  10. package/dist/atoms/chat/index.d.cts +1 -1
  11. package/dist/atoms/chat/lastMessage.d.cts +2 -2
  12. package/dist/atoms/chat/lastMessage.d.ts +2 -2
  13. package/dist/atoms/chat/messageQueue.d.ts +6 -6
  14. package/dist/atoms/chat/performanceMetrics.d.cts +6 -6
  15. package/dist/atoms/chat/performanceMetrics.d.ts +6 -6
  16. package/dist/atoms/chat/renderedWidgetRefs.d.ts +2 -2
  17. package/dist/atoms/chat/replies.d.cts +2 -2
  18. package/dist/atoms/chat/replies.d.ts +2 -2
  19. package/dist/atoms/chat/suggestions.d.cts +2 -2
  20. package/dist/atoms/chat/suggestions.d.ts +2 -2
  21. package/dist/atoms/envive/enviveConfig.d.cts +13 -13
  22. package/dist/atoms/envive/enviveConfig.d.ts +13 -13
  23. package/dist/atoms/globalSearch/globalSearch.d.cts +5 -5
  24. package/dist/atoms/org/customerService.d.cts +6 -6
  25. package/dist/atoms/org/customerService.d.ts +6 -6
  26. package/dist/atoms/org/graphqlConfig.d.cts +4 -4
  27. package/dist/atoms/org/graphqlConfig.d.ts +4 -4
  28. package/dist/atoms/org/newOrgConfigAtom.d.cts +2 -2
  29. package/dist/atoms/org/newOrgConfigAtom.d.ts +2 -2
  30. package/dist/atoms/org/orgAnalyticsConfig.d.cts +5 -5
  31. package/dist/atoms/org/orgAnalyticsConfig.d.ts +5 -5
  32. package/dist/atoms/search/chatSearch.d.cts +17 -17
  33. package/dist/atoms/search/chatSearch.d.ts +17 -17
  34. package/dist/atoms/search/searchAPI.d.cts +13 -13
  35. package/dist/atoms/search/searchAPI.d.ts +13 -13
  36. package/dist/atoms/search/types.d.ts +1 -1
  37. package/dist/atoms/search/utils.d.ts +1 -1
  38. package/dist/atoms/widget/chatPreviewLoading.d.cts +2 -2
  39. package/dist/atoms/widget/chatPreviewLoading.d.ts +2 -2
  40. package/dist/contexts/enviveContext/enviveContext.cjs +3 -3
  41. package/dist/contexts/enviveContext/enviveContext.js +3 -3
  42. package/dist/contexts/graphqlContext/graphqlContext.cjs +4 -4
  43. package/dist/contexts/graphqlContext/graphqlContext.js +4 -4
  44. package/dist/contexts/types.d.cts +1 -1
  45. package/dist/contexts/types.d.ts +1 -1
  46. package/dist/contexts/typesV3.d.cts +1 -1
  47. package/dist/hooks/GrabAndScroll/useGrabAndScroll.d.cts +2 -2
  48. package/dist/hooks/Search/useSearchInput.cjs +1 -1
  49. package/dist/hooks/Search/useSearchInput.js +1 -1
  50. package/dist/hooks/utils.d.cts +1 -1
  51. package/package.json +1 -1
  52. package/src/atoms/chat/chatState.ts +1 -1
  53. package/src/contexts/graphqlContext/graphqlContext.tsx +6 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-hooks",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "description": "React hooks for connecting to Envive AI services.",
5
5
  "keywords": [
6
6
  "react",
@@ -26,7 +26,7 @@ export const initializedAtom = atom<boolean>(false);
26
26
  export const chatIsOpenAtom = atom<boolean>(false);
27
27
  export const requestFailureAtom = atom<boolean>(false);
28
28
  export const formSubmitAtom = atom<FormSubmittedAttributes>();
29
- export const listeningToSpeechAtom = atom<boolean>(false);
29
+ export const listeningToSpeechAtom = atom<'start' | 'stop' | 'abort' | undefined>(undefined);
30
30
  export const chatOnToggleAtom = atom(
31
31
  null,
32
32
  (
@@ -254,21 +254,19 @@ export const GraphQLProvider = ({
254
254
  const isSemanticColors = !window.location.href.includes('globals=merchant');
255
255
  const isStorybook = window.top?.location.href.includes('?path=');
256
256
 
257
- // If the v3 root config is not found and we are configured to return the deprecated config, we will return the mocked config
258
- if ((!v3RootConfig && mockV3ConfigToDeprecatedConfig) || (isStorybook && isSemanticColors)) {
257
+ // If no v3 colors are found, return the default mock config to allow unconfigured merchants to work by default
258
+ if (!v3RootConfig?.colors || (isStorybook && isSemanticColors)) {
259
259
  logger.logDebug('GraphQLContext | Returning mock v3 config', {
260
- colorsConfig: mockV3ColorsConfig as ColorsConfigV3Response,
260
+ colorsConfig: mockV3ColorsConfig,
261
261
  frontendConfig: mockV3FrontendConfig as FrontendConfigV3Response,
262
262
  });
263
263
  const colorsConfig = mockV3ColorsConfig;
264
264
  const frontendConfig = mockV3FrontendConfig;
265
265
  return {
266
- colorsConfig: isSemanticColors
267
- ? (colorsConfig as ColorsConfigV3Response)
268
- : (v3ColorsConfig as ColorsConfigV3Response),
266
+ colorsConfig,
269
267
  frontendConfig: frontendConfig as FrontendConfigV3Response,
270
268
  orgPageConfig: {
271
- pageVariants: [],
269
+ pageVariants: DEFAULT_PAGE_VARIANTS,
272
270
  widgetConfigs: {},
273
271
  mountingConfigs: {},
274
272
  },
@@ -277,7 +275,7 @@ export const GraphQLProvider = ({
277
275
 
278
276
  logger.logDebug('GraphQLContext | Returning v3 config', {
279
277
  colorsConfig: v3ColorsConfig as ColorsConfigV3Response,
280
- frontendConfig: v3FrontendConfig as FrontendConfigV3Response,
278
+ frontendConfig: v3FrontendConfig,
281
279
  orgPageConfig: {
282
280
  pageVariants: v3pageVariants,
283
281
  widgetConfigs: v3WidgetConfigs,