@planningcenter/chat-react-native 3.37.0-rc.0 → 3.37.0-rc.2

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 (63) hide show
  1. package/build/components/display/action_button.d.ts +3 -1
  2. package/build/components/display/action_button.d.ts.map +1 -1
  3. package/build/components/display/action_button.js +8 -1
  4. package/build/components/display/action_button.js.map +1 -1
  5. package/build/hooks/groups/use_group_chat_conversation_payload.d.ts +168 -0
  6. package/build/hooks/groups/use_group_chat_conversation_payload.d.ts.map +1 -0
  7. package/build/hooks/groups/use_group_chat_conversation_payload.js +23 -0
  8. package/build/hooks/groups/use_group_chat_conversation_payload.js.map +1 -0
  9. package/build/hooks/groups/use_groups_conversation_create.js +1 -1
  10. package/build/hooks/groups/use_groups_conversation_create.js.map +1 -1
  11. package/build/hooks/services/use_find_or_create_services_conversation.d.ts +11 -3
  12. package/build/hooks/services/use_find_or_create_services_conversation.d.ts.map +1 -1
  13. package/build/hooks/services/use_find_or_create_services_conversation.js +10 -14
  14. package/build/hooks/services/use_find_or_create_services_conversation.js.map +1 -1
  15. package/build/hooks/services/use_services_chat_conversation_payload.d.ts +164 -0
  16. package/build/hooks/services/use_services_chat_conversation_payload.d.ts.map +1 -0
  17. package/build/hooks/services/use_services_chat_conversation_payload.js +16 -0
  18. package/build/hooks/services/use_services_chat_conversation_payload.js.map +1 -0
  19. package/build/hooks/use_conversation_validate.d.ts +12 -0
  20. package/build/hooks/use_conversation_validate.d.ts.map +1 -0
  21. package/build/hooks/use_conversation_validate.js +28 -0
  22. package/build/hooks/use_conversation_validate.js.map +1 -0
  23. package/build/hooks/use_features.d.ts +1 -0
  24. package/build/hooks/use_features.d.ts.map +1 -1
  25. package/build/hooks/use_features.js +1 -0
  26. package/build/hooks/use_features.js.map +1 -1
  27. package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
  28. package/build/screens/conversation_new/components/groups_form.js +14 -1
  29. package/build/screens/conversation_new/components/groups_form.js.map +1 -1
  30. package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
  31. package/build/screens/conversation_new/components/services_form.js +20 -2
  32. package/build/screens/conversation_new/components/services_form.js.map +1 -1
  33. package/build/screens/team_conversation_screen.d.ts.map +1 -1
  34. package/build/screens/team_conversation_screen.js +6 -3
  35. package/build/screens/team_conversation_screen.js.map +1 -1
  36. package/build/types/resources/conversation_validate.d.ts +10 -0
  37. package/build/types/resources/conversation_validate.d.ts.map +1 -0
  38. package/build/types/resources/conversation_validate.js +2 -0
  39. package/build/types/resources/conversation_validate.js.map +1 -0
  40. package/build/types/resources/index.d.ts +1 -0
  41. package/build/types/resources/index.d.ts.map +1 -1
  42. package/build/types/resources/index.js +1 -0
  43. package/build/types/resources/index.js.map +1 -1
  44. package/build/utils/native_adapters/log.d.ts +11 -0
  45. package/build/utils/native_adapters/log.d.ts.map +1 -1
  46. package/build/utils/native_adapters/log.js +9 -0
  47. package/build/utils/native_adapters/log.js.map +1 -1
  48. package/package.json +2 -2
  49. package/src/__tests__/hooks/use_conversation_validate.test.tsx +117 -0
  50. package/src/components/display/action_button.tsx +18 -0
  51. package/src/hooks/groups/use_group_chat_conversation_payload.ts +38 -0
  52. package/src/hooks/groups/use_groups_conversation_create.ts +1 -1
  53. package/src/hooks/services/use_find_or_create_services_conversation.ts +27 -24
  54. package/src/hooks/services/use_services_chat_conversation_payload.ts +26 -0
  55. package/src/hooks/use_conversation_validate.ts +45 -0
  56. package/src/hooks/use_features.ts +1 -0
  57. package/src/screens/conversation_new/components/groups_form.tsx +17 -1
  58. package/src/screens/conversation_new/components/services_form.tsx +26 -2
  59. package/src/screens/team_conversation_screen.tsx +6 -6
  60. package/src/types/resources/conversation_validate.ts +11 -0
  61. package/src/types/resources/index.ts +1 -0
  62. package/src/utils/native_adapters/__tests__/log.test.ts +62 -0
  63. package/src/utils/native_adapters/log.ts +22 -0
@@ -1,18 +1,31 @@
1
+ export type ReportErrorScope = 'screen' | 'message' | 'http'
2
+
3
+ export type ReportErrorContext = {
4
+ componentStack?: string
5
+ scope?: ReportErrorScope
6
+ screenName?: string
7
+ tags?: Record<string, string>
8
+ extra?: Record<string, unknown>
9
+ }
10
+
1
11
  interface LogAdapterConfig {
2
12
  enabled: boolean
3
13
  error: (message: string, ...args: any[]) => void
4
14
  info: (message: string, ...args: any[]) => void
15
+ reportError: (error: Error, context?: ReportErrorContext) => void
5
16
  }
6
17
 
7
18
  export class LogAdapter {
8
19
  enabled: boolean
9
20
  onError?: LogAdapterConfig['error']
10
21
  onInfo?: LogAdapterConfig['info']
22
+ onReportError?: LogAdapterConfig['reportError']
11
23
 
12
24
  constructor(config: Partial<LogAdapterConfig> = {}) {
13
25
  this.enabled = config.enabled ?? false
14
26
  this.onError = config.error
15
27
  this.onInfo = config.info
28
+ this.onReportError = config.reportError
16
29
  }
17
30
 
18
31
  error(message: string, ...args: any[]) {
@@ -26,4 +39,13 @@ export class LogAdapter {
26
39
 
27
40
  this.onInfo?.(message, ...args)
28
41
  }
42
+
43
+ reportError(error: Error, context?: ReportErrorContext) {
44
+ if (this.onReportError) {
45
+ this.onReportError(error, context)
46
+ return
47
+ }
48
+
49
+ console.error(error, context)
50
+ }
29
51
  }