@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.
- package/build/components/display/action_button.d.ts +3 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/action_button.js +8 -1
- package/build/components/display/action_button.js.map +1 -1
- package/build/hooks/groups/use_group_chat_conversation_payload.d.ts +168 -0
- package/build/hooks/groups/use_group_chat_conversation_payload.d.ts.map +1 -0
- package/build/hooks/groups/use_group_chat_conversation_payload.js +23 -0
- package/build/hooks/groups/use_group_chat_conversation_payload.js.map +1 -0
- package/build/hooks/groups/use_groups_conversation_create.js +1 -1
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts +11 -3
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.js +10 -14
- package/build/hooks/services/use_find_or_create_services_conversation.js.map +1 -1
- package/build/hooks/services/use_services_chat_conversation_payload.d.ts +164 -0
- package/build/hooks/services/use_services_chat_conversation_payload.d.ts.map +1 -0
- package/build/hooks/services/use_services_chat_conversation_payload.js +16 -0
- package/build/hooks/services/use_services_chat_conversation_payload.js.map +1 -0
- package/build/hooks/use_conversation_validate.d.ts +12 -0
- package/build/hooks/use_conversation_validate.d.ts.map +1 -0
- package/build/hooks/use_conversation_validate.js +28 -0
- package/build/hooks/use_conversation_validate.js.map +1 -0
- package/build/hooks/use_features.d.ts +1 -0
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -0
- package/build/hooks/use_features.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +14 -1
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +20 -2
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/team_conversation_screen.d.ts.map +1 -1
- package/build/screens/team_conversation_screen.js +6 -3
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/resources/conversation_validate.d.ts +10 -0
- package/build/types/resources/conversation_validate.d.ts.map +1 -0
- package/build/types/resources/conversation_validate.js +2 -0
- package/build/types/resources/conversation_validate.js.map +1 -0
- package/build/types/resources/index.d.ts +1 -0
- package/build/types/resources/index.d.ts.map +1 -1
- package/build/types/resources/index.js +1 -0
- package/build/types/resources/index.js.map +1 -1
- package/build/utils/native_adapters/log.d.ts +11 -0
- package/build/utils/native_adapters/log.d.ts.map +1 -1
- package/build/utils/native_adapters/log.js +9 -0
- package/build/utils/native_adapters/log.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/hooks/use_conversation_validate.test.tsx +117 -0
- package/src/components/display/action_button.tsx +18 -0
- package/src/hooks/groups/use_group_chat_conversation_payload.ts +38 -0
- package/src/hooks/groups/use_groups_conversation_create.ts +1 -1
- package/src/hooks/services/use_find_or_create_services_conversation.ts +27 -24
- package/src/hooks/services/use_services_chat_conversation_payload.ts +26 -0
- package/src/hooks/use_conversation_validate.ts +45 -0
- package/src/hooks/use_features.ts +1 -0
- package/src/screens/conversation_new/components/groups_form.tsx +17 -1
- package/src/screens/conversation_new/components/services_form.tsx +26 -2
- package/src/screens/team_conversation_screen.tsx +6 -6
- package/src/types/resources/conversation_validate.ts +11 -0
- package/src/types/resources/index.ts +1 -0
- package/src/utils/native_adapters/__tests__/log.test.ts +62 -0
- 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
|
}
|