@planningcenter/chat-react-native 3.33.1-rc.0 → 3.33.1-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/conversation/jump_to_bottom_button.d.ts.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +0 -2
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +1 -1
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/mute_indicator.d.ts.map +1 -1
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -1
- package/build/components/display/action_button.d.ts.map +1 -1
- package/build/components/display/badge.d.ts +1 -6
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +0 -8
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/button.d.ts +1 -5
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +0 -4
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/image_attachment_preview.d.ts +1 -5
- package/build/components/display/image_attachment_preview.d.ts.map +1 -1
- package/build/components/display/image_attachment_preview.js +0 -4
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/pressable_row.d.ts.map +1 -1
- package/build/components/display/video_attachment_preview.d.ts.map +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/conversation_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +1 -1
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +3 -3
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts.map +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.d.ts +20 -20
- package/build/hooks/services/use_team_plans.d.ts +1 -1
- package/build/hooks/use_api.d.ts +36 -36
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_at_font_scale_breakpoint.d.ts.map +1 -1
- package/build/hooks/use_chat_permissions.d.ts +20 -20
- package/build/hooks/use_conversation.d.ts +4 -4
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation_avatar_update.d.ts.map +1 -1
- package/build/hooks/use_conversation_membership.d.ts.map +1 -1
- package/build/hooks/use_conversation_message.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +2 -2
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts +18 -18
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_create_android_ripple_color.d.ts.map +1 -1
- package/build/hooks/use_font_scale.d.ts.map +1 -1
- package/build/hooks/use_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.d.ts +32 -32
- package/build/hooks/use_organization.d.ts +3 -3
- package/build/hooks/use_people_person.d.ts.map +1 -1
- package/build/hooks/use_report_message.d.ts.map +1 -1
- package/build/hooks/use_scalable_number_of_lines.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +6 -6
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_typing_indicators.d.ts.map +1 -1
- package/build/hooks/use_typing_status_cache.d.ts.map +1 -1
- package/build/navigation/index.d.ts +46 -46
- package/build/navigation/index.d.ts.map +1 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +20 -20
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +52 -52
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.d.ts.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +0 -1
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.d.ts.map +1 -1
- package/build/screens/get_help_screen.d.ts.map +1 -1
- package/build/screens/message_report_screen.d.ts.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +8 -8
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts +3 -3
- package/build/screens/team_conversation_screen.d.ts.map +1 -1
- package/build/utils/assert_keys_are_numbers.d.ts.map +1 -1
- package/build/utils/cache/messages_cache.d.ts +1 -1
- package/build/utils/cache/messages_cache.d.ts.map +1 -1
- package/build/utils/cache/page_mutations.d.ts +4 -4
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/request_helpers.d.ts.map +1 -1
- package/build/utils/client/transform_request_data.d.ts.map +1 -1
- package/build/utils/client/utils.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.d.ts +1 -1
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +2 -7
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/native_adapters/document_picker.d.ts +5 -1
- package/build/utils/native_adapters/document_picker.d.ts.map +1 -1
- package/build/utils/native_adapters/document_picker.js +3 -1
- package/build/utils/native_adapters/document_picker.js.map +1 -1
- package/build/utils/parse_simple_markdown.d.ts.map +1 -1
- package/build/utils/performance_tracking.js +1 -1
- package/build/utils/performance_tracking.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/get_chat_configuration.d.ts +1 -1
- package/build/utils/request/get_chat_configuration.d.ts.map +1 -1
- package/build/utils/request/get_features.d.ts +1 -1
- package/build/utils/request/get_features.d.ts.map +1 -1
- package/build/utils/request/get_message.d.ts +1 -1
- package/build/utils/request/get_message.d.ts.map +1 -1
- package/build/utils/request/get_messages.d.ts +1 -1
- package/build/utils/request/get_messages.d.ts.map +1 -1
- package/build/utils/response_error.d.ts.map +1 -1
- package/build/utils/session.d.ts.map +1 -1
- package/build/utils/session.js +1 -1
- package/build/utils/session.js.map +1 -1
- package/build/utils/session_manager.js +1 -1
- package/build/utils/session_manager.js.map +1 -1
- package/build/utils/system_messages.d.ts.map +1 -1
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +1 -1
- package/build/utils/theme.js.map +1 -1
- package/build/utils/uri.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/__tests__/utils/native_adapters/configuration.ts +17 -0
- package/src/__tests__/utils/theme.ts +23 -0
- package/src/components/conversation/jump_to_bottom_button.tsx +0 -2
- package/src/components/conversation/message_form.tsx +11 -9
- package/src/components/display/badge.tsx +1 -7
- package/src/components/display/button.tsx +1 -6
- package/src/components/display/image_attachment_preview.tsx +1 -5
- package/src/contexts/session_context.tsx +1 -1
- package/src/screens/conversation_notification_level_select_screen.tsx +1 -2
- package/src/utils/native_adapters/configuration.ts +3 -8
- package/src/utils/native_adapters/document_picker.ts +8 -2
- package/src/utils/performance_tracking.ts +1 -1
- package/src/utils/session.ts +1 -1
- package/src/utils/session_manager.ts +1 -1
- package/src/utils/theme.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_manager.js","sourceRoot":"","sources":["../../src/utils/session_manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAO,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AAOpE,MAAM,OAAO,cAAc;IACzB,QAAQ,CAAwB;IAChC,gBAAgB,CAAQ;IAExB,YAAY,KAA2B;QACrC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,KAAK,IAAI,EAAE,CAAA;QAClD,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,EAAE,CAAA;QAC9B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,IAAI,0BAA0B,CAAA;IACxE,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,oBAA4B;QACzC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;YAC9C,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,CAAA;QAClC,CAAC;QAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"session_manager.js","sourceRoot":"","sources":["../../src/utils/session_manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAO,OAAO,EAAE,0BAA0B,EAAE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,EAAE,SAAS,CAAC,CAAA;QAC9C,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,CAAC,gBAAgB,GAAG,0BAA0B,CAAA;QACpD,CAAC;IACH,CAAC;IAED,aAAa,CAAC,SAAiB;QAC7B,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;QAC/C,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,WAAW,SAAS,YAAY,CAAC,CAAA;QACnD,CAAC;QACD,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAA;IACnC,CAAC;IAED,aAAa,CAAC,OAAgB;QAC5B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAA;QAC9C,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,EAAE,CAAA;IACpC,CAAC;IAED,kBAAkB,CAAC,KAAiB;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAA;QACnC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC9B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;QACrB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC7B,CAAC;CACF","sourcesContent":["import { omit } from 'lodash'\nimport { OAuthToken } from '../types'\nimport { ENV, Session, UNAUTHENTICATED_SESSION_ID } from './session'\n\ntype SessionManagerProps = {\n sessions?: Record<string, string>\n currentSessionId?: string\n}\n\nexport class SessionManager {\n sessions: Record<string, string>\n currentSessionId: string\n\n constructor(props?: SessionManagerProps) {\n const { sessions, currentSessionId } = props || {}\n this.sessions = sessions || {}\n this.currentSessionId = currentSessionId || UNAUTHENTICATED_SESSION_ID\n }\n\n static hydrate(sessionManagerString: string) {\n try {\n const props = JSON.parse(sessionManagerString)\n return new SessionManager(props)\n } catch (_error) {\n return new SessionManager()\n }\n }\n\n get currentSession() {\n return Session.hydrate<OAuthToken>(\n this.sessions[this.currentSessionId] || new Session<OAuthToken>({}).toString()\n )\n }\n\n setEnv(env: ENV) {\n // Get the current session (handles case where it doesn't exist)\n const session = this.currentSession\n session.env = env\n // Store the session with its ID\n this.upsertSession(session)\n }\n\n toString() {\n return JSON.stringify({ sessions: this.sessions, currentSessionId: this.currentSessionId })\n }\n\n removeSession(sessionId: string) {\n // if unauthenticated, this is a no-op\n this.sessions = omit(this.sessions, sessionId)\n if (this.currentSessionId === sessionId) {\n this.currentSessionId = UNAUTHENTICATED_SESSION_ID\n }\n }\n\n switchSession(sessionId: string) {\n const sessionPresent = this.sessions[sessionId]\n if (!sessionPresent) {\n throw new Error(`Session ${sessionId} not found`)\n }\n this.currentSessionId = sessionId\n }\n\n upsertSession(session: Session) {\n this.sessions[session.id] = session.toString()\n this.currentSessionId = session.id\n }\n\n updateCurrentToken(token: OAuthToken) {\n const session = this.currentSession\n this.removeSession(session.id)\n session.token = token\n this.upsertSession(session)\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system_messages.d.ts","sourceRoot":"","sources":["../../src/utils/system_messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,QAAA,MAAM,oBAAoB,0BAA2B,CAAA;AAErD,KAAK,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,WAAW,EAAE,iBAAiB,CAAA;IAC9B,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3E,uBAAuB,EAAE,MAAM,EAAE,CAAA;CAClC;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"system_messages.d.ts","sourceRoot":"","sources":["../../src/utils/system_messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,QAAA,MAAM,oBAAoB,0BAA2B,CAAA;AAErD,KAAK,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,WAAW,EAAE,iBAAiB,CAAA;IAC9B,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3E,uBAAuB,EAAE,MAAM,EAAE,CAAA;CAClC;AAED,eAAO,MAAM,eAAe,GAAI,SAAS,eAAe,KAAG,OAAO,IAAI,qBAG7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAiB,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAG/E,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC5B,CAAC,OAAO,mBAAmB,CAAC,KAAK,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAA;CACvE;AAED;;;;;;;;;;;;;gDAagD;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,oBAAoB,EAAE,OAAO,CAAA;CAC9B;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AA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E,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,+BAA+B,EAAE,MAAM,CAAA;IACvC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,sBAAsB,EAAE,MAAM,CAAA;IAC9B,4BAA4B,EAAE,MAAM,CAAA;IACpC,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,+BAA+B,EAAE,MAAM,CAAA;IACvC,uBAAuB,EAAE,MAAM,CAAA;IAC/B,uBAAuB,EAAE,MAAM,CAAA;IAC/B,6BAA6B,EAAE,MAAM,CAAA;IACrC,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,+BAA+B,EAAE,MAAM,CAAA;CACxC"}
|
package/build/utils/theme.js
CHANGED
|
@@ -2,7 +2,7 @@ import { PlatformColor } from 'react-native';
|
|
|
2
2
|
import { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map';
|
|
3
3
|
import { tokens } from '../vendor/tapestry/tokens';
|
|
4
4
|
export const defaultTheme = (colorScheme) => {
|
|
5
|
-
const scheme = colorScheme
|
|
5
|
+
const scheme = colorScheme === 'dark' ? 'dark' : 'light';
|
|
6
6
|
const defaultColors = {
|
|
7
7
|
...chatThemeColorMap[scheme],
|
|
8
8
|
...aliasTokensColorMap[scheme],
|
package/build/utils/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.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+B,EAAE,MAAM,CAAC,+BAA+B;CACxE,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { ColorSchemeName, ColorValue, OpaqueColorValue, PlatformColor } from 'react-native'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {\n const scheme = colorScheme || 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAE,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AA8BlD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA4B,EAAa,EAAE;IACtE,MAAM,MAAM,GAAqB,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;IAE1E,MAAM,aAAa,GAAG;QACpB,GAAG,iBAAiB,CAAC,MAAM,CAAC;QAC5B,GAAG,mBAAmB,CA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AAM,CAAC,0BAA0B;IACpD,mBAAmB,EAAE,MAAM,CAAC,4BAA4B;IACxD,iBAAiB,EAAE,MAAM,CAAC,+BAA+B;IACzD,eAAe,EAAE,MAAM,CAAC,+BAA+B;IACvD,eAAe,EAAE,MAAM,CAAC,wBAAwB;IAChD,iBAAiB,EAAE,MAAM,CAAC,0BAA0B;IACpD,eAAe,EAAE,MAAM,CAAC,6BAA6B;IAErD,wDAAwD;IACxD,sBAAsB,EAAE,MAAM,CAAC,8BAA8B;IAC7D,sBAAsB,EAAE,MAAM,CAAC,uBAAuB;IACtD,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;IACjE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,uBAAuB,EAAE,MAAM,CAAC,+BAA+B;IAC/D,uBAAuB,EAAE,MAAM,CAAC,wBAAwB;IACxD,6BAA6B,EAAE,MAAM,CAAC,6BAA6B;IACnE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;CACxE,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { ColorSchemeName, ColorValue, OpaqueColorValue, PlatformColor } from 'react-native'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {\n const scheme: 'light' | 'dark' = colorScheme === 'dark' ? 'dark' : 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
|
package/build/utils/uri.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["../../src/utils/uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,KAAK,KAAK,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAC9C,qBAAa,GAAG;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,KAAK,CAAmB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;gBAEA,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE;IAMtF,IAAI,MAAM,WAET;IAED,IAAI,IAAI,WAEP;IAED,IAAI,SAAS,0CAOZ;IAED,IAAI,MAAM,IAAI,KAAK,GAAG,sBAAsB,GAAG,cAAc,CAM5D;IAED,IAAI,GAAG,mBAON;IAED,IAAI,cAAc,YAEjB;IAED,IAAI,GAAG,4BAEN;IAED,IAAI,OAAO,WAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO;;;MAKV;IAED,MAAM,
|
|
1
|
+
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["../../src/utils/uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,KAAK,KAAK,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAC9C,qBAAa,GAAG;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,KAAK,CAAmB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;gBAEA,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE;IAMtF,IAAI,MAAM,WAET;IAED,IAAI,IAAI,WAEP;IAED,IAAI,SAAS,0CAOZ;IAED,IAAI,MAAM,IAAI,KAAK,GAAG,sBAAsB,GAAG,cAAc,CAM5D;IAED,IAAI,GAAG,mBAON;IAED,IAAI,cAAc,YAEjB;IAED,IAAI,GAAG,4BAEN;IAED,IAAI,OAAO,WAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO;;;MAKV;IAED,MAAM,GAAI,MAAM,MAAM,YAIrB;IAED,GAAG,GAAI,MAAM,MAAM,YAIlB;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.33.1-rc.
|
|
3
|
+
"version": "3.33.1-rc.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -46,24 +46,24 @@
|
|
|
46
46
|
"react-native-device-info": "*",
|
|
47
47
|
"react-native-gesture-handler": "*",
|
|
48
48
|
"react-native-linear-gradient": "^2.8.3",
|
|
49
|
-
"react-native-reanimated": "
|
|
49
|
+
"react-native-reanimated": ">=3.0.0",
|
|
50
50
|
"react-native-safe-area-context": ">=4.0.0",
|
|
51
51
|
"react-native-svg": "*"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@react-native/eslint-config": "
|
|
54
|
+
"@react-native/eslint-config": "~0.83.0",
|
|
55
55
|
"@testing-library/react-hooks": "^8.0.1",
|
|
56
56
|
"@types/jest": "^29.5.14",
|
|
57
57
|
"@typescript-eslint/parser": "^8.32.0",
|
|
58
58
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
59
|
-
"expo-module-scripts": "^
|
|
59
|
+
"expo-module-scripts": "^55.0.0",
|
|
60
60
|
"fast-text-encoding": "^1.0.6",
|
|
61
61
|
"jest": "^29.7.0",
|
|
62
62
|
"jest-fetch-mock": "^3.0.3",
|
|
63
63
|
"msw": "^2.7.3",
|
|
64
64
|
"prettier": "^3.4.2",
|
|
65
65
|
"react-native-url-polyfill": "^2.0.0",
|
|
66
|
-
"typescript": "
|
|
66
|
+
"typescript": "~5.9.2"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "fdaea033b328b8ad4e1cce6aeb5fb0566c144e69"
|
|
69
69
|
}
|
|
@@ -125,6 +125,23 @@ describe('ChatAdapters', () => {
|
|
|
125
125
|
})
|
|
126
126
|
|
|
127
127
|
expect(DocumentPicker).toEqual(documentPicker)
|
|
128
|
+
expect(DocumentPicker.configured).toBe(true)
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
it('falls back to an unconfigured adapter when omitted', async () => {
|
|
132
|
+
ChatAdapters.configure({
|
|
133
|
+
clipboard,
|
|
134
|
+
audio,
|
|
135
|
+
video,
|
|
136
|
+
imagePicker,
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
expect(DocumentPicker).toBeDefined()
|
|
140
|
+
expect(DocumentPicker.configured).toBe(false)
|
|
141
|
+
await expect(DocumentPicker.openAsync()).resolves.toEqual({
|
|
142
|
+
canceled: true,
|
|
143
|
+
assets: null,
|
|
144
|
+
})
|
|
128
145
|
})
|
|
129
146
|
})
|
|
130
147
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defaultTheme } from '../../utils/theme'
|
|
2
|
+
import { aliasTokensColorMap } from '../../vendor/tapestry/alias_tokens_color_map'
|
|
3
|
+
|
|
4
|
+
describe('defaultTheme', () => {
|
|
5
|
+
test('returns the dark color palette when colorScheme is "dark"', () => {
|
|
6
|
+
expect(defaultTheme('dark').colors).toMatchObject(aliasTokensColorMap.dark)
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test('returns the light color palette when colorScheme is "light"', () => {
|
|
10
|
+
expect(defaultTheme('light').colors).toMatchObject(aliasTokensColorMap.light)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('falls back to the light palette when colorScheme is null', () => {
|
|
14
|
+
expect(defaultTheme(null).colors).toMatchObject(aliasTokensColorMap.light)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
test('falls back to the light palette for React Native 0.83\'s "unspecified" variant', () => {
|
|
18
|
+
// RN 0.83 added "unspecified" to ColorSchemeName. Anything that is not
|
|
19
|
+
// literally "dark" should fall through to the light palette so we never
|
|
20
|
+
// render an unstyled or misthemed UI.
|
|
21
|
+
expect(defaultTheme('unspecified').colors).toMatchObject(aliasTokensColorMap.light)
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -27,8 +27,6 @@ export const JumpToBottomButton = ({ onPress, visible }: JumpToBottomButtonProps
|
|
|
27
27
|
damping: 16,
|
|
28
28
|
stiffness: 170,
|
|
29
29
|
overshootClamping: false,
|
|
30
|
-
restDisplacementThreshold: 0.2,
|
|
31
|
-
restSpeedThreshold: 2,
|
|
32
30
|
reduceMotion: ReduceMotion.System,
|
|
33
31
|
})
|
|
34
32
|
}, [visible, progress])
|
|
@@ -593,15 +593,17 @@ function MessageFormAttachmentPicker() {
|
|
|
593
593
|
onPress={pickImage}
|
|
594
594
|
style={styles.attachmentPickerButton}
|
|
595
595
|
/>
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
596
|
+
{DocumentPicker.configured && (
|
|
597
|
+
<IconButton
|
|
598
|
+
accessibilityLabel="Attach a file"
|
|
599
|
+
accessibilityHint="Opens your files to attach documents"
|
|
600
|
+
size="lg"
|
|
601
|
+
appearance="neutral"
|
|
602
|
+
name="general.blankFile"
|
|
603
|
+
onPress={pickFile}
|
|
604
|
+
style={styles.attachmentPickerButton}
|
|
605
|
+
/>
|
|
606
|
+
)}
|
|
605
607
|
</View>
|
|
606
608
|
)}
|
|
607
609
|
<IconButton
|
|
@@ -13,13 +13,7 @@ import { useStatusColorAppearanceMap, type StatusAppearanceUnion } from './utils
|
|
|
13
13
|
// ====== Constants ================
|
|
14
14
|
// =================================
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
default: 'default',
|
|
18
|
-
meta: 'meta',
|
|
19
|
-
metaSubtle: 'metaSubtle',
|
|
20
|
-
} as const
|
|
21
|
-
|
|
22
|
-
type VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]
|
|
16
|
+
type VariantUnion = 'default' | 'meta' | 'metaSubtle'
|
|
23
17
|
|
|
24
18
|
type VariantStyles = Record<
|
|
25
19
|
VariantUnion,
|
|
@@ -32,12 +32,7 @@ type SizeStyle = Record<
|
|
|
32
32
|
}
|
|
33
33
|
>
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
fill: 'fill',
|
|
37
|
-
outline: 'outline',
|
|
38
|
-
} as const
|
|
39
|
-
|
|
40
|
-
type VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]
|
|
35
|
+
type VariantUnion = 'fill' | 'outline'
|
|
41
36
|
type VariantColors = Record<
|
|
42
37
|
VariantUnion,
|
|
43
38
|
{
|
|
@@ -5,11 +5,7 @@ import { Icon } from './icon'
|
|
|
5
5
|
import { IconButton } from './icon_button'
|
|
6
6
|
import { Image } from './image'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
sm: 'sm',
|
|
10
|
-
md: 'md',
|
|
11
|
-
} as const
|
|
12
|
-
type ImageSizeUnion = (typeof SIZES)[keyof typeof SIZES]
|
|
8
|
+
type ImageSizeUnion = 'sm' | 'md'
|
|
13
9
|
|
|
14
10
|
interface ImageAttachmentPreviewProps {
|
|
15
11
|
fileName: string
|
|
@@ -178,7 +178,7 @@ export function SessionContextProvider({
|
|
|
178
178
|
const updatedManager = SessionManager.hydrate(managerString)
|
|
179
179
|
try {
|
|
180
180
|
updatedManager.switchSession(sessionId)
|
|
181
|
-
} catch (
|
|
181
|
+
} catch (_error) {
|
|
182
182
|
Alert.alert('Error', 'Session is not authenticated')
|
|
183
183
|
}
|
|
184
184
|
await setManagerString(updatedManager.toString())
|
|
@@ -27,7 +27,6 @@ export function ConversationNotificationLevelSelectScreen({
|
|
|
27
27
|
const { data: conversation } = useConversation({ conversation_id })
|
|
28
28
|
const { mutate: updateNotificationLevel } = useConversationMembershipUpdate({ conversation_id })
|
|
29
29
|
|
|
30
|
-
const notificationLevel = conversation.conversationMembership?.notificationLevel
|
|
31
30
|
const notificationLevelOptions =
|
|
32
31
|
conversation.conversationMembership?.notificationLevelOptions ?? []
|
|
33
32
|
|
|
@@ -36,7 +35,7 @@ export function ConversationNotificationLevelSelectScreen({
|
|
|
36
35
|
const muted = value === 'nothing'
|
|
37
36
|
updateNotificationLevel({
|
|
38
37
|
muted,
|
|
39
|
-
notificationLevel: value
|
|
38
|
+
notificationLevel: value,
|
|
40
39
|
})
|
|
41
40
|
}
|
|
42
41
|
navigation.goBack()
|
|
@@ -15,7 +15,7 @@ type ChatConfigurations = {
|
|
|
15
15
|
audio: AudioAdapter
|
|
16
16
|
video: VideoAdapter
|
|
17
17
|
imagePicker: ImagePickerAdapter
|
|
18
|
-
documentPicker
|
|
18
|
+
documentPicker?: DocumentPickerAdapter
|
|
19
19
|
log?: LogAdapter
|
|
20
20
|
linking?: LinkingAdapter
|
|
21
21
|
haptic?: HapticAdapter
|
|
@@ -27,7 +27,7 @@ export class ChatAdapters {
|
|
|
27
27
|
Audio = configurations.audio
|
|
28
28
|
Video = configurations.video
|
|
29
29
|
ImagePicker = configurations.imagePicker
|
|
30
|
-
DocumentPicker = configurations.documentPicker
|
|
30
|
+
DocumentPicker = configurations.documentPicker || new DocumentPickerAdapter()
|
|
31
31
|
Log = configurations.log || new LogAdapter()
|
|
32
32
|
Linking = configurations.linking || new LinkingAdapter(RNLinking)
|
|
33
33
|
Haptic = configurations.haptic || new HapticAdapter()
|
|
@@ -74,12 +74,7 @@ export let ImagePicker: ImagePickerAdapter = new ImagePickerAdapter({
|
|
|
74
74
|
},
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
-
export let DocumentPicker: DocumentPickerAdapter = new DocumentPickerAdapter(
|
|
78
|
-
openAsync: async () => {
|
|
79
|
-
methodMissing()
|
|
80
|
-
return { canceled: true, assets: null }
|
|
81
|
-
},
|
|
82
|
-
})
|
|
77
|
+
export let DocumentPicker: DocumentPickerAdapter = new DocumentPickerAdapter()
|
|
83
78
|
|
|
84
79
|
export let Log: LogAdapter = new LogAdapter()
|
|
85
80
|
|
|
@@ -17,10 +17,16 @@ type DocumentPickerCanceledResult = {
|
|
|
17
17
|
|
|
18
18
|
export type DocumentPickerResult = DocumentPickerSuccessResult | DocumentPickerCanceledResult
|
|
19
19
|
|
|
20
|
+
interface DocumentPicker {
|
|
21
|
+
openAsync: () => Promise<DocumentPickerResult>
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
export class DocumentPickerAdapter {
|
|
21
25
|
openAsync: () => Promise<DocumentPickerResult>
|
|
26
|
+
configured: boolean
|
|
22
27
|
|
|
23
|
-
constructor(methods
|
|
24
|
-
this.openAsync = methods
|
|
28
|
+
constructor(methods?: DocumentPicker) {
|
|
29
|
+
this.openAsync = methods?.openAsync ?? (async () => ({ canceled: true, assets: null }))
|
|
30
|
+
this.configured = !!methods
|
|
25
31
|
}
|
|
26
32
|
}
|
package/src/utils/session.ts
CHANGED
package/src/utils/theme.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface DefaultTheme {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {
|
|
34
|
-
const scheme = colorScheme
|
|
34
|
+
const scheme: 'light' | 'dark' = colorScheme === 'dark' ? 'dark' : 'light'
|
|
35
35
|
|
|
36
36
|
const defaultColors = {
|
|
37
37
|
...chatThemeColorMap[scheme],
|